Bug 38641

Summary: Commit 441f9c5037dd3246 exposes bigger bug
Product: cairo Reporter: James Cloos <cloos>
Component: generalAssignee: Carl Worth <cworth>
Status: RESOLVED FIXED QA Contact: cairo-bugs mailing list <cairo-bugs>
Severity: blocker    
Priority: highest    
Version: 1.10.3   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: Complete fix to intersect_with_boxes(). The old code forgot to dereference the boxes pointer.
Another possible patch to fix the issue

Description James Cloos 2011-06-24 06:41:23 UTC
Created attachment 48380 [details] [review]
Complete fix to intersect_with_boxes().  The old code forgot to dereference the boxes pointer.

That commit only partially fixes things; the code still fails to look at all of
the num_boxes boxes, but rather looks at the 0th box num_boxes times.

W/o this further fix seamonkey frequently fails to update its window
until an Expose event shows up.  Or only updates a tiny chunk of the window.

[bz Version field should, of course, be master....]
Comment 1 Andrea Canciani 2011-06-24 06:58:32 UTC
Created attachment 48381 [details] [review]
Another possible patch to fix the issue

Sorry for the delay (I read your message in the mailing list, but I was busy tacking other issues)

I'd like the attached fix better, because it avoids the initialization (asserting that it can actually do that) and walks the boxes in order, which is less surprising when reading the code (at least for me, because it's easier to see that it iterates exactly on everything, without having to worry about the first/last element).
Comment 2 James Cloos 2011-06-24 13:54:38 UTC
For attachment #48381 [details] [review]:

Reviewed-by: James Cloos <cloos@jhcloos.com>

Testing now.
Comment 3 James Cloos 2011-06-24 14:34:26 UTC
For attachment #48381 [details] [review]:

with the obvious addition of declaring int i:

Tested-by: James Cloos <cloos@jhcloos.com>

It works as well as my patch does.
Comment 4 Andrea Canciani 2011-06-25 04:42:38 UTC
The second attachment has been pushed to master:

commit a447e949799000760835beeafd2d45c76580fb9e
Author: Andrea Canciani <ranma42@gmail.com>
Date:   Fri Jun 24 15:52:24 2011 +0200

    clip: Fix boxes extents computation in intersect_with_boxes
    
    The extents of the boxes were being computed by taking into account
    just the first box instead of all of them.
    
    Based on a patch by James Cloos.
    
    Fixes clip-disjoint, clip-stroke-unbounded, clip-fill-nz-unbounded,
    clip-fill-eo-unbounded, clip-fill, clip-stroke, trap-clip.
    
    See https://bugs.freedesktop.org/show_bug.cgi?id=38641
    
    Reviewed-by: James Cloos <cloos@jhcloos.com>
    Tested-by: James Cloos <cloos@jhcloos.com>

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.