[cairo] Cairo/PNG shaked up.
otaylor at redhat.com
Sun Apr 17 12:50:15 PDT 2005
On Sun, 2005-04-17 at 21:09 +0200, Hans Breuer wrote:
> Looking to make it even smaller I tried a little change. If in the
> renderer->cr = cairo_create ();
> cairo_scale (renderer->cr, renderer->scale, renderer->scale);
> cairo_translate (renderer->cr, -renderer->dia->extents.left,
> cairo_set_target_surface (renderer->cr, renderer->surface);
> /* clear background */
> the set_target_surface() call is moved before the scale() call the
> is right again - for the PNG export case. I haven't tested with the
> backends, but think the order of calls should not be decisive here.
> Bug or feature?
Really neither. We really never nailed down whether set_target_surface()
resets the transform or not, and I think the code is somewhat
inconsistent now, but the plan going forward is to make cairo_create()
take a cairo_surface_t as a parameter and to remove
set_target_surface() making the question moot.
So, for now, you should always set the target surface immediately
after creating the cairo_t.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.freedesktop.org/archives/cairo/attachments/20050417/e16d5eb2/attachment.pgp
More information about the cairo