From mboxrd@z Thu Jan 1 00:00:00 1970 From: bugzilla-daemon@freedesktop.org Subject: [Bug 92309] Box drawn around cursor in multiple 3D games Date: Wed, 02 Dec 2015 17:16:35 +0000 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0914472580==" Return-path: Received: from culpepper.freedesktop.org (unknown [131.252.210.165]) by gabe.freedesktop.org (Postfix) with ESMTP id 077356EA3E for ; Wed, 2 Dec 2015 09:16:35 -0800 (PST) In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org --===============0914472580== Content-Type: multipart/alternative; boundary="1449076594.8c3ad3F0.13210"; charset="UTF-8" --1449076594.8c3ad3F0.13210 Date: Wed, 2 Dec 2015 17:16:34 +0000 MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable https://bugs.freedesktop.org/show_bug.cgi?id=3D92309 --- Comment #19 from Kamil P=C3=A1ral --- I believe you can automatically detect invalid input in some cases. If you receive an image in which R or G or B value is higher than A value, for any available pixel, you can be certain that the image does not have premultipl= ied alpha but straight alpha (this situation can never happen with premultiplied alpha, by definition). You can then assume a developer mistake and "fix" the image automatically. It might even resolve most of the usual cursor-related mistakes (we can clearly see colored boxes, while it's expected to be transparent, so those images have RGB>A for some pixels). However, this has downsides as well. It does not cover all cases (for images where all RGB are lower or equal to their respective A, you can't decide whether it is premultiplied or straight). The automatic detection and conversion might involve some performance hit. And it might not be a good A= PI design, because trying to be overly helpful often leads to lowered predictability and more difficult debugging. But that would be someone else= 's call. I might also be talking utter nonsense because I have no expertise in graph= ics. --=20 You are receiving this mail because: You are the assignee for the bug. --1449076594.8c3ad3F0.13210 Date: Wed, 2 Dec 2015 17:16:34 +0000 MIME-Version: 1.0 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Commen= t # 19 on bug 92309<= /a> from Kamil P=C3=A1ral
I believe you can automatically detect invalid input in some c=
ases. If you
receive an image in which R or G or B value is higher than A value, for any
available pixel, you can be certain that the image does not have premultipl=
ied
alpha but straight alpha (this situation can never happen with premultiplied
alpha, by definition). You can then assume a developer mistake and "fi=
x" the
image automatically. It might even resolve most of the usual cursor-related
mistakes (we can clearly see colored boxes, while it's expected to be
transparent, so those images have RGB>A for some pixels).

However, this has downsides as well. It does not cover all cases (for images
where all RGB are lower or equal to their respective A, you can't decide
whether it is premultiplied or straight). The automatic detection and
conversion might involve some performance hit. And it might not be a good A=
PI
design, because trying to be overly helpful often leads to lowered
predictability and more difficult debugging. But that would be someone else=
's
call.

I might also be talking utter nonsense because I have no expertise in graph=
ics.


You are receiving this mail because: =20=20=20=20=20=20
  • You are the assignee for the bug.
--1449076594.8c3ad3F0.13210-- --===============0914472580== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KZHJpLWRldmVs IG1haWxpbmcgbGlzdApkcmktZGV2ZWxAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHA6Ly9saXN0 cy5mcmVlZGVza3RvcC5vcmcvbWFpbG1hbi9saXN0aW5mby9kcmktZGV2ZWwK --===============0914472580==--