[cairo] how to substitute CAIRO_CLIP_PATH_IS_BOX ?

Chris Wilson chris at chris-wilson.co.uk
Thu Dec 17 02:04:33 PST 2015


On Thu, Dec 17, 2015 at 12:51:48AM +0100, Enrico Weigelt, metux IT consult wrote:
> On 16.12.2015 16:21, Chris Wilson wrote:
> 
> => i915_surface_paint_with_alpha()
> > But for the basic i915, we just want boxes and as cheaply as possible.
> > So, the code just asks 10: "is it a box" then draw else reduce; goto 10;
> 
> hmm, I dont see that loop anywhere.

I was trying to convey the essence of the code. (We only send boxes to
the GPU, everything else to go from a complex path to a set of boxes.)
 
> is it happening via _clip_and_composite_boxes() ?
> 
> 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.
 
> => 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. 
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre


More information about the cairo mailing list