[cairo] Clip invariance issue

Søren Sandmann sandmann at cs.au.dk
Thu Mar 29 23:04:44 PDT 2012


Hi,

The attached program demonstrates an issue with the image surface (it
likely exists with other surface types as well, but I haven't tested).

The issue is that rendering a polygon incrementally through a set of
clip boxes that combine to fill the entire surface produces different
results than rendering the same polygon without clipping. This can lead
to artefacts in cases where the application relies on partial repaints,
such as when receiving an expose event from the X server or when
scrolling.

The program generates a complex polygon and a complex clip region, and
then it renders the polygon once through the clip and then once again
through the inverse of the clip. The output is then compared to the same
polygon rendered without clipping, and if they differ, it reports the
maximum difference. The two images are saved as image{1,2}.png for easy
comparison.

A typical max difference is around 30, which seems quite bad even if it
is decided that cairo will not guarantee pixel-exact matches for this
usecase.


Søren


-------------- next part --------------
A non-text attachment was scrubbed...
Name: clip-invariance.c
Type: text/x-csrc
Size: 7082 bytes
Desc: The test program
URL: <http://lists.cairographics.org/archives/cairo/attachments/20120330/1a712e88/attachment-0001.c>


More information about the cairo mailing list