[librsvg: 78/90] Pass the intial offsetted affine as part of CompositingAffines



commit 1ac98bf336181a57c384b73c537e99fc5c33afa6
Author: Federico Mena Quintero <federico gnome org>
Date:   Thu Mar 21 19:35:17 2019 -0600

    Pass the intial offsetted affine as part of CompositingAffines
    
    This lets us remove the set_initial_affine() method, which was just
    used in the masking code.

 rsvg_internals/src/drawing_ctx.rs | 6 ++----
 rsvg_internals/src/mask.rs        | 2 +-
 2 files changed, 3 insertions(+), 5 deletions(-)
---
diff --git a/rsvg_internals/src/drawing_ctx.rs b/rsvg_internals/src/drawing_ctx.rs
index aad60053..50f693ba 100644
--- a/rsvg_internals/src/drawing_ctx.rs
+++ b/rsvg_internals/src/drawing_ctx.rs
@@ -575,10 +575,6 @@ impl DrawingCtx {
         initial_with_offset
     }
 
-    pub fn set_initial_affine(&self, cr: &cairo::Context) {
-        cr.set_matrix(self.initial_affine_with_offset());
-    }
-
     /// Saves the current Cairo matrix, runs the draw_fn, and restores the matrix
     ///
     /// This is slightly cheaper than a `cr.save()` / `cr.restore()`
@@ -905,6 +901,7 @@ impl DrawingCtx {
 
 pub struct CompositingAffines {
     pub affine: cairo::Matrix,
+    pub initial: cairo::Matrix,
     pub for_temporary_surface: cairo::Matrix,
     pub compositing: cairo::Matrix,
 }
@@ -938,6 +935,7 @@ impl CompositingAffines {
 
         CompositingAffines {
             affine,
+            initial,
             for_temporary_surface,
             compositing,
         }
diff --git a/rsvg_internals/src/mask.rs b/rsvg_internals/src/mask.rs
index dddf82f6..ce18c3f6 100644
--- a/rsvg_internals/src/mask.rs
+++ b/rsvg_internals/src/mask.rs
@@ -142,7 +142,7 @@ impl NodeMask {
         let mask_surface = compute_luminance_to_alpha(&mask_content_surface, opacity)?;
 
         let cr = draw_ctx.get_cairo_context();
-        draw_ctx.set_initial_affine(&cr);
+        cr.set_matrix(affines.initial);
 
         cr.mask_surface(&mask_surface, 0.0, 0.0);
 


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