[cairo-bugs] [Bug 84044] test/cairo-test-suite reports wrong max diff comparing different opaque images

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Sat Oct 4 02:05:38 PDT 2014


--- Comment #4 from Uli Schlachter <psychon at znc.in> ---
(In reply to Massimo from comment #3)
> (In reply to Uli Schlachter from comment #2)
> > Isn't the bug here really in the code that compares the images?
> > 
> > You are blaming test/buffer-diff.c line 80 which is:
> > 
> >    if ((row_a[x] & mask) != (row_b[x] & mask))
> > 
> I blamed test/buffer-diff.c because when that condition is
> TRUE, the maximum diff computed includes also the non-alpha
> channel:
> http://cgit.freedesktop.org/cairo/tree/test/buffer-diff.c#n85
> So my first observation was reading a test log in which
> two identical images (argb32 and rgb24) had reported two
> max diff values compared to the same reference.

Ah, I missed that part. From a quick look, I'd fix that by changing these two

            int value_a = (row_a[x] >> (channel*8)) & 0xff;
            int value_b = (row_b[x] >> (channel*8)) & 0xff;


            int value_a = ((row_a[x] & mask) >> (channel*8)) & 0xff;

Oh and line 101 needs to be changed as well, something like "&& mask !=
0x00ffffff". Here it seems simpler to pass a cairo_format_t or cairo_bool_t
into buffer_diff_core() and calculate the mask based on that.

> yes, there are also other bugs in test/pdiff

I'd rather fix these problems in pdiff instead of somewhere in the code
producing these images. In theory, these two code paths are independent from
each other and pdiff could be used from something else than just the test

You are receiving this mail because:
You are the QA Contact for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cairographics.org/archives/cairo-bugs/attachments/20141004/5dd45a84/attachment-0001.html>

More information about the cairo-bugs mailing list