[cairo] Clip region problems

Bill Spitzak spitzak at d2.com
Wed May 18 15:56:47 PDT 2005


What happens if you create multiple cairo_surface_t objects for the same 
object? Is this supposed to work? (my guess is that it works for some 
backends, and not for others...)

I'm thinking the correct answer is that you must create more than one 
cairo_surface_t if you want more than one thread to draw at the same 
time, and whether this is possible depends on the back end, though it 
should be supported for on-screen windows. You should allow any number 
of readers at the same time on any cairo_surface_t as long as no writer 
is active.

Wasn't there also a plan to make cairo_t and cairo_surface_t the same 
object (ie cairo_create(surface) would not exist, instead the surface 
itself can be used). This would match this idea well. Also in my use of 
the new Cairo so far, it seems like a good idea, I currently need to 
keep two pointers around but the surface one is only used for two calls 
(resize and delete), reducing this to one pointer would make it easier, 
and make it clear that they cannot be changed independently.

I certainly agree that there should be no "source clip". Even if storing 
the clip into an XRender object is a good idea, any use of it as a 
source should temporarily turn it off. Or perhaps XRender should add a 
new call or change this to ignore the clip, as it sounds like a 
misfeature...



More information about the cairo mailing list