[librsvg] drawing_ctx.rs: Bind rsvg_render_surface()



commit 2045fdab2455ff155e888daeaa1aee2d41a9be0c
Author: Federico Mena Quintero <federico gnome org>
Date:   Mon Sep 25 18:36:52 2017 -0500

    drawing_ctx.rs: Bind rsvg_render_surface()

 rust/src/drawing_ctx.rs |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)
---
diff --git a/rust/src/drawing_ctx.rs b/rust/src/drawing_ctx.rs
index ed8fe34..ee25c62 100644
--- a/rust/src/drawing_ctx.rs
+++ b/rust/src/drawing_ctx.rs
@@ -80,6 +80,12 @@ extern "C" {
 
     fn rsvg_render_path_builder (draw_ctx: *const RsvgDrawingCtx,
                                  builder: *const RsvgPathBuilder);
+    fn rsvg_render_surface (draw_ctx: *const RsvgDrawingCtx,
+                            surface: *const cairo_sys::cairo_surface_t,
+                            x: f64,
+                            y: f64,
+                            w: f64,
+                            h: f64);
 
     fn rsvg_cairo_get_cairo_context (draw_ctx: *const RsvgDrawingCtx) -> *mut cairo_sys::cairo_t;
     fn rsvg_cairo_set_cairo_context (draw_ctx: *const RsvgDrawingCtx, cr: *const cairo_sys::cairo_t);
@@ -154,6 +160,15 @@ pub fn render_path_builder (draw_ctx: *const RsvgDrawingCtx,
     unsafe { rsvg_render_path_builder (draw_ctx, builder); }
 }
 
+pub fn render_surface (draw_ctx: *const RsvgDrawingCtx,
+                       surface: &cairo::ImageSurface,
+                       x: f64,
+                       y: f64,
+                       w: f64,
+                       h: f64) {
+    unsafe { rsvg_render_surface (draw_ctx, surface.to_raw_none(), x, y, w, h); }
+}
+
 pub fn get_cairo_context (draw_ctx: *const RsvgDrawingCtx) -> cairo::Context {
     unsafe {
         let raw_cr = rsvg_cairo_get_cairo_context (draw_ctx);


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