[cairo] [PATCH] Fix intersect_with_boxes() to produce tight clip extents

Chris Wilson chris at chris-wilson.co.uk
Fri Jun 24 09:02:59 PDT 2011


On Fri, 24 Jun 2011 17:39:15 +0200, Uli Schlachter <psychon at znc.in> wrote:
> On 21.06.2011 10:19, Taekyun Kim wrote:
> > From: Taekyun Kim <tkq.kim at samsung.com>
> > 
> > Previous code was intersecting extents with infinitely large rectangle.
> > ---
> >  src/cairo-clip.c |    4 ++--
> >  1 files changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/src/cairo-clip.c b/src/cairo-clip.c
> > index a695cd7..e272d54 100644
> > --- a/src/cairo-clip.c
> > +++ b/src/cairo-clip.c
> > @@ -1399,8 +1399,8 @@ intersect_with_boxes (cairo_composite_rectangles_t *extents,
> >      cairo_rectangle_int_t rect;
> >      cairo_box_t box;
> >  
> > -    box.p1.x = box.p1.y = INT_MIN;
> > -    box.p2.x = box.p2.y = INT_MAX;
> > +    box.p1.x = box.p1.y = INT_MAX;
> > +    box.p2.x = box.p2.y = INT_MIN;
> >      while (num_boxes--) {
> >  	if (boxes->p1.x < box.p1.x)
> >  	    box.p1.x = boxes->p1.x;
> 
> Hi,
> 
> This patch broke the xcb backend. It looks like it is clipping away too much,
> because some of the resulting graphics are missing. Also, most of the tests that
> broke are about clipping. I bisected with clip-disjoint clip-fill-eo-unbounded
> trap-clip, see below.

The patch is definitely a fix for the clipping code, so it is looking
likely that it has revealed further bugs. Joy.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre


More information about the cairo mailing list