On Fri, 17 Jun 2016 10:48:38 -0700
Bill Spitzak <[email protected]> wrote:

> On Thu, Jun 16, 2016 at 7:13 AM, Pekka Paalanen <[email protected]> wrote:
> 
> >
> > load_image_from_png() now pays attention to the pixel format returned by
> > Cairo, which seems to come out as CAIRO_FORMAT_RGB24 in
> > internal-screenshot-test, not as CAIRO_FORMAT_ARGB32 as expected. I do
> > not know if Cairo actually guarantees the x8/a8 channel to be 0xff for
> > RGB24, but better to not trust it. Therefore the image is explicitly
> > converted to a8r8g8b8 as needed. This also adds support for loading A8
> > and RGB16_565 images, provided that Cairo delivers them.
> >  
> 
> That's some mistaken "optimization" somebody added to that cairo png
> loader. It tests to see if the alpha channel is 0xff everywhere and returns
> RGB24 in that case. As you demonstrate the only result is that the caller
> then wastes time filling in the alpha channel. It also annoys programmers
> that expect ARGB32 to mean "the png file has an alpha channel" (there are a
> couple bug reports of this).

Hi Bill,

thanks for sharing that, nice to know.

As long as things are not documented one way or another (does RGB24
guarantee 0xff alpha or not), we have to keep the paranoia.


Thanks,
pq

Attachment: pgpJ7HTFMrSKJ.pgp
Description: OpenPGP digital signature

_______________________________________________
wayland-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/wayland-devel

Reply via email to