[PATCH weston 08/11] tests: convert reference image loader to pixman
ppaalanen at gmail.com
Mon Jun 20 08:05:36 UTC 2016
On Fri, 17 Jun 2016 10:48:38 -0700
Bill Spitzak <spitzak at gmail.com> wrote:
> On Thu, Jun 16, 2016 at 7:13 AM, Pekka Paalanen <ppaalanen at gmail.com> 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).
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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 811 bytes
Desc: OpenPGP digital signature
More information about the wayland-devel