[cairo] implement clone_similar fallback

Vladimir Vukicevic vladimir at pobox.com
Mon Aug 6 23:18:40 PDT 2007


Travis Griggs wrote:
> On Aug 6, 2007, at 22:38, Vladimir Vukicevic wrote:
> 
>>
>> Here's a patch after a discussion on irc... basically, the backend 
>> clone_similar function was called from two places (clip_init_deep_copy 
>> and the pattern acquire_surface_for_gradient), but the function isn't 
>> a required one for backends to implement.  So if it ever failed, both 
>> of these functions just failed.
>>
>> It was hard to hit either of these cases -- the win32 surface didn't 
>> implement clone_similar, but it also never used 
>> pattern_acquire_surface, and the other would only be hit if you tried 
>> to push_group with a mask clip set.
>>
>> Here's a patch that implements fallback for clone_similar; it uses 
>> create_similar_scratch and then calls composite with OPERATOR_SOURCE.
> 
> Would this explain a weird behavior I saw the other day using the Quartz 
> backend? I was doing a push/pop_group, and had a clip shape that was 
> trapezoidal (not rectangular). It worked great on X11, but on Quartz, I 
> got the "extents" of the trapezoid.

Don't think so -- do you have a test case I can look at?  Quartz would 
never hit the mask clipping case, since it does native path clipping 
(Quartz also implements clone_similar, iirc).

     - Vlad



More information about the cairo mailing list