[cairo] clipping bug

Carl Worth cworth at cworth.org
Mon Sep 19 17:25:26 PDT 2005


On Mon, 12 Sep 2005 14:05:03 -0400, Jason Dorje Short wrote:
> Radek Doulík wrote:
> > On Wed, 2005-08-31 at 09:08 -0700, Carl Worth wrote:
> >>On Thu, 25 Aug 2005 15:22:01 +0200, Radek Doulík wrote:
> >>
> >>>I prepared a fix which stops compositing even earlier. That way it will
> >>>not hide other bugs, where compositing with zero width or height. It is
> >>>included in the new patch.
>
> goto is uglier than a long if block.  If indentation is too much or the 
> block is too long a helper function can be used.

The proposed patch was broken in that it returned an uninitialized
status value.

Here's a simpler patch that avoids changing any of the cairo_clip
logic at all, (using an idea already implemented elsewhere in
cairo-xlib-surface.c). The one remaining call to XCreatePixmap that
doesn't have this style of protection does already have a separate
early bailout for size-zero or smaller intermediate surfaces.

I've now committed this fix so it will be in both 1.2.0 and 1.0.2.

Let me know if you run into any similar problems.

-Carl

===================================================================
RCS file: /mirrors/freedesktop/cairo/cairo/src/cairo-xlib-surface.c,v
retrieving revision 1.120
diff -u -p -r1.120 cairo-xlib-surface.c
--- src/cairo-xlib-surface.c    31 Aug 2005 22:09:35 -0000      1.120
+++ src/cairo-xlib-surface.c    20 Sep 2005 00:10:05 -0000
@@ -1363,7 +1363,8 @@ _create_a8_picture (cairo_xlib_surface_t
     unsigned long mask = 0;

     Pixmap pixmap = XCreatePixmap (surface->dpy, surface->drawable,
-                                  width, height,
+                                  width <= 0 ? 1 : width,
+                                  height <= 0 ? 1 : height,
                                   8);
     Picture picture;
-------------- 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/20050919/4c20375d/attachment.pgp


More information about the cairo mailing list