[librsvg/rustification] New function rsvg_cairo_get_cairo_context()



commit 3a8f07629033ab38011f408534386ad357de1a7d
Author: Federico Mena Quintero <federico gnome org>
Date:   Wed Nov 30 18:06:09 2016 -0600

    New function rsvg_cairo_get_cairo_context()
    
    We use it from the Rust code to extract the cairo_t from an
    RsvgDrawingContext, which in turn is assumed to be a RsvgCairoRender.

 rsvg-cairo-draw.c |    8 ++++++++
 rsvg-cairo-draw.h |    3 +++
 2 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/rsvg-cairo-draw.c b/rsvg-cairo-draw.c
index 4acc62c..6494752 100644
--- a/rsvg-cairo-draw.c
+++ b/rsvg-cairo-draw.c
@@ -740,6 +740,14 @@ rsvg_cairo_render_surface (RsvgDrawingCtx *ctx,
     rsvg_bbox_insert (&render->bbox, &bbox);
 }
 
+cairo_t *
+rsvg_cairo_get_cairo_context (RsvgDrawingCtx *ctx)
+{
+    RsvgCairoRender *render = RSVG_CAIRO_RENDER (ctx->render);
+
+    return render->cr;
+}
+
 static void
 rsvg_cairo_generate_mask (cairo_t * cr, RsvgMask * self, RsvgDrawingCtx * ctx, RsvgBbox * bbox)
 {
diff --git a/rsvg-cairo-draw.h b/rsvg-cairo-draw.h
index 05198e6..286f0c5 100644
--- a/rsvg-cairo-draw.h
+++ b/rsvg-cairo-draw.h
@@ -44,6 +44,9 @@ G_GNUC_INTERNAL
 void         rsvg_cairo_render_surface          (RsvgDrawingCtx *ctx, cairo_surface_t *surface,
                                                  double x, double y, double w, double h);
 G_GNUC_INTERNAL
+cairo_t *rsvg_cairo_get_cairo_context (RsvgDrawingCtx *ctx);
+
+G_GNUC_INTERNAL
 void         rsvg_cairo_push_discrete_layer        (RsvgDrawingCtx *ctx);
 G_GNUC_INTERNAL
 void         rsvg_cairo_pop_discrete_layer      (RsvgDrawingCtx *ctx);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]