[librsvg] DrawingCtx.draw_node_on_surface(): Pass the affine directly



commit 4167ade78108e6851ea520e02d212eda1100f301
Author: Federico Mena Quintero <federico gnome org>
Date:   Wed Oct 23 14:38:33 2019 -0500

    DrawingCtx.draw_node_on_surface(): Pass the affine directly
    
    Instead of indirectly through the draw_ctx.cr, since draw_ctx.cr is
    not even used when drawing to that surface.

 rsvg_internals/src/drawing_ctx.rs   | 4 ++--
 rsvg_internals/src/filters/image.rs | 3 +--
 2 files changed, 3 insertions(+), 4 deletions(-)
---
diff --git a/rsvg_internals/src/drawing_ctx.rs b/rsvg_internals/src/drawing_ctx.rs
index a06af390..07275734 100644
--- a/rsvg_internals/src/drawing_ctx.rs
+++ b/rsvg_internals/src/drawing_ctx.rs
@@ -825,15 +825,15 @@ impl DrawingCtx {
         node: &RsvgNode,
         cascaded: &CascadedValues<'_>,
         surface: &cairo::ImageSurface,
+        affine: cairo::Matrix,
         width: f64,
         height: f64,
     ) -> Result<BoundingBox, RenderingError> {
         let save_cr = self.cr.clone();
         let save_rect = self.rect;
-        let save_affine = self.get_cairo_context().get_matrix();
 
         let cr = cairo::Context::new(surface);
-        cr.set_matrix(save_affine);
+        cr.set_matrix(affine);
 
         self.cr = cr;
         self.rect.x = 0.0;
diff --git a/rsvg_internals/src/filters/image.rs b/rsvg_internals/src/filters/image.rs
index a8d69cac..9451c181 100644
--- a/rsvg_internals/src/filters/image.rs
+++ b/rsvg_internals/src/filters/image.rs
@@ -55,8 +55,6 @@ impl Image {
             ctx.source_graphic().height(),
         )?;
 
-        draw_ctx.get_cairo_context().set_matrix(ctx.paffine());
-
         let node_being_filtered_values = ctx.get_computed_values_from_node_being_filtered();
 
         let cascaded = CascadedValues::new_from_values(&drawable, node_being_filtered_values);
@@ -66,6 +64,7 @@ impl Image {
                 &drawable,
                 &cascaded,
                 &surface,
+                ctx.paffine(),
                 f64::from(ctx.source_graphic().width()),
                 f64::from(ctx.source_graphic().height()),
             )


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