[cairo] Render to image buffer artifacts

Carl Worth cworth at cworth.org
Thu Jan 13 18:10:05 PST 2005


On Thu, 13 Jan 2005 20:06:22 -0500, Chris wrote:
> Thanks for taking time to look into this.  Your patch appears to create
> some rendering artifacts.  Take a look here:
> 
> http://imago.functionalfuture.com/images/scratchy.png

Oh, ick. That's really awful.

I'm sorry about that. The fix should has a slope dependency that I
missed the first time. The attached additional patch (which has been
committed) should fix things.

That will definitely teach me to always run the complete test suite
even when I "know" I'm only fixing a minor bug.

[There's the "official" test suite within the cairo source tree run by
"make check". That's what's growing with each new bug report. But it
doesn't yet have a lot of coverage. The set I neglected to test this
time is a set of SVG files from the W3C SVG test suite. This provides
much better coverage, but isn't as good in that its output often
changes with changes in libsvg that aren't really related to cairo.]

Anyway, thanks for the report. Please let me know if you're still
running into any problems.

-Carl

Index: src/ictrap.c
===================================================================
RCS file: /mirrors/freedesktop/cairo/libpixman/src/ictrap.c,v
retrieving revision 1.14
diff -u -p -r1.14 ictrap.c
--- src/ictrap.c        13 Jan 2005 22:53:14 -0000      1.14
+++ src/ictrap.c        14 Jan 2005 02:02:20 -0000
@@ -1233,8 +1233,12 @@ IcRasterizeTrapezoid (pixman_image_t
*p
             * situations. This defect in the algorithm is bad enough
             * that we plan to discard the current approach
             * entirely. But in the meantime, we do want to have the
-            * correct alpha == 0 in these cases. */
-           if (left.lower.y < y)
+            * correct alpha == 0 in these cases.
+            *
+            * The left edge is entirely "above" if its lower y
+            * coordinate is less than y, *and* its slope is positive.
+            */
+           if (left.lower.y < y && left.m > 0)
                alpha = 0;
            else
                alpha = (RectAlpha (pixel_y, y, y_next, depth)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/cairo/attachments/20050113/42b90a88/attachment.pgp


More information about the cairo mailing list