[cairo] rsvg and cairo alpha puzzle

Bertram Felgenhauer bertram.felgenhauer at googlemail.com
Fri Nov 30 10:16:11 PST 2007


Carl Worth wrote:
> Oh, and also there's this comment in rsvg_cairo_new_drawing_ctx:
> 
>     /* adjust transform so that the corner of the bounding box above is
>      * at (0,0) - we compensate for this in rsvg_handle_render_cairo_sub()
>      * below */
>     state->affine[4] -= render->offset_x;
>     state->affine[5] -= render->offset_y;
> 
> Librsvg hackers, care to comment on this?

That's my code. The thing that probably goes wrong is the fiddling
with device offsets that is done in rsvg_handle_render_cairo_sub():

    cairo_surface_get_device_offset (surface, &save_dx, &save_dy);
    render = (RsvgCairoRender *) draw->render;
    cairo_surface_set_device_offset (surface,
                                     save_dx + render->offset_x,
                                     save_dy + render->offset_y);

    rsvg_node_draw ((RsvgNode *) handle->priv->treebase, draw, 0);

    cairo_surface_set_device_offset (surface, save_dx, save_dy);

Apparently with a push_group in effect changing the device offsets
like this does not affect the rendering to the group.

I'll work on a patch to fix this properly in rsvg, and hopefully
have code to show by the end of the weekend.

Is there already a bug report about this?

regards,

Bertram


More information about the cairo mailing list