[cairo] cairo_matrix_t

Bill Spitzak spitzak at d2.com
Thu Nov 4 14:29:19 PST 2004


On Thursday 04 November 2004 11:02 am, Carl Worth wrote:
> The benefit of the current implementation is that locking is only needed
> on a per-object basis, (ie. two threads calling in through the same
> cairo_t* or the same cairo_matrix_t*, etc.). But, if we were to make
> cairo_current_matrix return a non-copied pointer to the CTM inside the
> cairo_t, then we've changed that model. Then, locking would be necessary
> between one thread with that cairo_matrix_t* and another with the
> original cairo_t*.

It seems to me that the return value of cairo_current_matrix can be said to 
belong to a certain cairo_t and thus sending it to another thread can be 
considered just as unsafe as sharing the cairo_t itself with another thread. 
You could just say that it is not allowed, that the calling program must do 
the copy if it wants to. It seems to me the uses of this matrix seperate from 
the cairo_t are extremely rare or non-esistent so I can't see this being a 
problem or limitation.



More information about the cairo mailing list