[cairo] const-ness fixes for transform_distance and transform_point

Keith Packard keithp at keithp.com
Mon May 9 10:30:03 PDT 2005

On Mon, 2005-05-09 at 13:26 -0400, Owen Taylor wrote:
> On Mon, 2005-05-09 at 10:07 -0700, Keith Packard wrote:
> > On Mon, 2005-05-09 at 13:06 -0400, Owen Taylor wrote:
> > 
> > > This does muddle the "plain structure returns are out-parameters"
> > > rule that I documented in the language binding appendix.
> > 
> > And what about the re-entrancy issues of returning a pointer to static
> > data?  
>  cairo_surface_t *cairo_get_target (cairo_t *cr);
> is returning a pointer to non-referenced data, so that already prevents
> us from enabling simultaneous access to the same cairo_t from 
> multiple threads.

I don't see these as equivalent; cairo_get_target always returns the
"same" value -- the target surface is always the same surface; I see
this as a logically fixed mapping from the cairo_t to the persistant
'surface object'.

In contrast the matrix appears as a transformation whose value is not
related to its storage, but rather as a pure coordinate mapping
function.  In this way, it is equivalent to the font extents example.
Would you have the cairo_t contain a static font extents structure just
so we could return a pointer to it?

The fact that cairo_t *does* contain a cairo_matrix_t is an
implementation detail that is clouding the issue here.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.freedesktop.org/archives/cairo/attachments/20050509/1471ad49/attachment.pgp

More information about the cairo mailing list