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

Uli Schlachter psychon at znc.in
Fri Jun 24 09:05:16 PDT 2011


On 24.06.2011 17:57, Andrea Canciani wrote:
> On Fri, Jun 24, 2011 at 5:39 PM, 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.
> 
> I believe that the issue you are seeing might be related with:
> https://bugs.freedesktop.org/show_bug.cgi?id=38641

Thanks, the latest patch there indeed fixes this. Sorry for the noise.

Uli

P.S.:
Your patch doesn't compile:

cairo-clip.c: In function 'intersect_with_boxes':
cairo-clip.c:1406:10: error: 'i' undeclared (first use in this function)
cairo-clip.c:1406:10: note: each undeclared identifier is reported only once for
each function it appears in

Obviously, "int i;" solves this problem.
-- 
Q: Because it reverses the logical flow of conversation.
A: Why is putting a reply at the top of the message frowned upon?


More information about the cairo mailing list