Commit 823a2257 authored by Paolo Borelli's avatar Paolo Borelli

drawing_ctx: move useful comment to rust

parent 4e7c2b6c
......@@ -133,24 +133,6 @@ rsvg_drawing_ctx_get_cairo_context (RsvgDrawingCtx *ctx)
return ctx->cr;
}
/* FIXME: Usage of this function is more less a hack. Some code does this:
*
* save_cr = rsvg_drawing_ctx_get_cairo_context (ctx);
*
* some_surface = create_surface ();
*
* cr = cairo_create (some_surface);
*
* rsvg_drawing_ctx_set_cairo_context (ctx, cr);
*
* ... draw with ctx but to that temporary surface
*
* rsvg_drawing_ctx_set_cairo_context (ctx, save_cr);
*
* It would be better to have an explicit push/pop for the cairo_t, or
* pushing a temporary surface, or something that does not involve
* monkeypatching the cr directly.
*/
void
rsvg_drawing_ctx_set_cairo_context (RsvgDrawingCtx *ctx, cairo_t *cr)
{
......
......@@ -88,6 +88,11 @@ pub fn get_cairo_context(draw_ctx: *const RsvgDrawingCtx) -> cairo::Context {
}
}
// FIXME: Usage of this function is more less a hack... The caller
// manually saves and then restore the draw_ctx.cr.
// It would be better to have an explicit push/pop for the cairo_t, or
// pushing a temporary surface, or something that does not involve
// monkeypatching the cr directly.
pub fn set_cairo_context(draw_ctx: *const RsvgDrawingCtx, cr: &cairo::Context) {
unsafe {
let raw_cr = cr.to_glib_none().0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment