[Bug 92309] Box drawn around cursor in multiple 3D games
bugzilla-daemon at freedesktop.org
bugzilla-daemon at freedesktop.org
Wed Dec 2 09:16:35 PST 2015
https://bugs.freedesktop.org/show_bug.cgi?id=92309
--- Comment #19 from Kamil Páral <kamil.paral at gmail.com> ---
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 premultiplied
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 API
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 graphics.
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/dri-devel/attachments/20151202/1a2f634f/attachment.html>
More information about the dri-devel
mailing list