[cairo] how to substitute CAIRO_CLIP_PATH_IS_BOX ?

Enrico Weigelt, metux IT consult enrico.weigelt at gr13.net
Thu Dec 17 16:29:33 PST 2015


On 17.12.2015 11:04, Chris Wilson wrote:

Hi,

>> by the way: what's the purpose of copying the clip  (instead of
>> directly using the passed one) ? is it changed somewhere ?
> 
> We may modify the clip as we go (change it to a different form, etc).
> Mostly we try and do a shallow copy.

okay, already suspected that. but i just dont see the piece of code
which does that ... :(

>> => i915_surface_fill_with_alpha()
>>
>>>> Another user is i915_surface_fill_with_alpha() .. I haven't really
>>>> understood, whats going on here, but it seems that we're testing
>>>> whether the fill path is is affected by the clip path (or maybe
>>>> even equal to it).
>>>
>>> Right, it tries to discard the clip path. I think that was superseded by
>>> the geometric intersection between clip and fill.
>>
>> In which way exactly superseded ? I there any function which I could/
>> should replace it with ?
> 
> Instead of just checking if the clip matches the fill, I would just
> intersect the fill with the clip. 

Something like this ?

>>> local_clip = _cairo_clip_intersect_rectilinear_path(clip,
>>>                                                     path,
>>>                                                     fill_rule,
>>>                                                     antialias)

Shoud I do it before or after the
_cairo_composite_rectangles_init_for_fill() call ?


Oh, I've just seen that _cairo_composite_rectangles_init_for_fill()
aleady does some intersection - is that already what you meant ?


--mtx

--
Enrico Weigelt,
metux IT consulting
+49-151-27565287


More information about the cairo mailing list