[cairo] Problem with unaligned clip regions

Uli Schlachter psychon at znc.in
Thu Mar 17 14:24:52 PDT 2011


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Am 17.03.2011 19:33, Tristan Schmelcher wrote:
> To add some more information, the black area is created by
> combine_src_u in pixman, and it is black because the corresponding
> mask values are all zero. The mask comes from
> _composite_unaligned_boxes in cairo-image-surface.c, which is called
> from _composite_boxes, which is in turn called from
> _clip_and_composite_boxes. That's about the limit that I can debug
> this though since I don't really understand the box compositing code.

Hi,

I took a closer look at this and it seems to me that _composite_unaligned_boxes
cannot handle more than one box with some operators, e.g. "source".

Attached is the original test case wrapped into a format that cairo-test-suite
can understand (but still needs a good name, some comments, a copyright header,
...).

The original clip is optimized away by _cairo_clip_to_boxes, so this code is hit
without a clip mask and two boxes.

Also, there is an attempted fix attached. No idea if this is correct, but it
works for me. All the existing tests in the test suite hit this code path with
boxes->num_boxes == 1. The only exception is image-bug-710072-unaligned which
has 6 boxes with operator "over". I only have choosen this "if" condition
because it worked for all cases that I found, not because I think it is correct.

Could someone who actually has a clue take a closer look at this?

Cheers,
Uli

- -- 
Sometimes the people that know software the best are the ones
that hate it the most.                                      -- infogulch
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)

iQEcBAEBCAAGBQJNgnwiAAoJECLkKOvLj8sGezUIAJ/udRmg8sayTFQtS4h3AdBB
GErPshjgsvp7kn4uDlm8qAadut9M9nbRgISZDebkUKeqtgLTMsfjRlqc3nApKzol
1G1FqQ/8bFPrirA7CBi9f53iLb9x36U6zUYJL/YhshYvbTrwR9A1jvV1B3pma9uz
NvmMWqaf/JkaUuMWDjxgfUHsgwzPytVTi5K6GSgLvGr32nAzER4Wfdh03pQRk8ea
hZASP/2o9M7sgJihQRoP4Lzrkakd0TlLJFlVegSgh7D+R1OD63ZYm5aLRjSzpHXh
2d0gGi005V1MAlnXabVjUqqD8Fzx997d6nK+bJZVfy+d+EyeUu6rugBaETZ5nIY=
=5VJK
-----END PGP SIGNATURE-----
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.c
Type: text/x-csrc
Size: 1721 bytes
Desc: not available
URL: <http://lists.cairographics.org/archives/cairo/attachments/20110317/3eaf22b5/attachment.c>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.patch
Type: text/x-diff
Size: 622 bytes
Desc: not available
URL: <http://lists.cairographics.org/archives/cairo/attachments/20110317/3eaf22b5/attachment.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.c.sig
Type: application/octet-stream
Size: 287 bytes
Desc: not available
URL: <http://lists.cairographics.org/archives/cairo/attachments/20110317/3eaf22b5/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.patch.sig
Type: application/octet-stream
Size: 287 bytes
Desc: not available
URL: <http://lists.cairographics.org/archives/cairo/attachments/20110317/3eaf22b5/attachment-0001.obj>


More information about the cairo mailing list