[cairo] Patch improving fallbacks

Owen Taylor otaylor at redhat.com
Mon Jan 31 08:16:42 PST 2005


On Sun, 2005-01-30 at 21:49 -0800, Keith Packard wrote:
> What is image_extra?

image_extra is just a void * for the backend to save a pointer
to backend specific resources.

For example, the Win32 backend, when temporarily getting a sub-portion
of an image, creates a cairo_win32_surface_t that "has a" 
cairo_image_surface_t. It returns the cairo_image_surface_t, but
it needs the cairo_win32_surface_t to actually draw the surface
back to the parent surface. So it stores it in image_extra.

I experimented with various alternatives:

 - Adding cairo_image_surface_set_user_data() 
 - Returning a native surface with a get_image_surface() virtual
   method
 - Returning a native surface with a get_pixman_image() virtual
   method

And the void * came out cleanest and simplest.

Regards,
						Owen

-------------- 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/20050131/75f189ec/attachment.pgp


More information about the cairo mailing list