[librsvg: 23/90] DrawingCtx::is_cairo_context_nested(): Removed; now the offsets are always 0



commit 305d2d8804c3537e59a6b458845959bbddb35031
Author: Federico Mena Quintero <federico gnome org>
Date:   Wed Mar 13 11:15:34 2019 -0600

    DrawingCtx::is_cairo_context_nested(): Removed; now the offsets are always 0

 rsvg_internals/src/drawing_ctx.rs | 14 +-------------
 1 file changed, 1 insertion(+), 13 deletions(-)
---
diff --git a/rsvg_internals/src/drawing_ctx.rs b/rsvg_internals/src/drawing_ctx.rs
index 8d736912..040ecf5b 100644
--- a/rsvg_internals/src/drawing_ctx.rs
+++ b/rsvg_internals/src/drawing_ctx.rs
@@ -353,10 +353,6 @@ impl DrawingCtx {
             })
     }
 
-    fn is_cairo_context_nested(&self, cr: &cairo::Context) -> bool {
-        cr.to_raw_none() != self.initial_cr.to_raw_none()
-    }
-
     // Returns (clip_in_user_space, clip_in_object_space), both Option<RsvgNode>
     fn get_clip_in_user_and_object_space(
         &mut self,
@@ -732,20 +728,12 @@ impl DrawingCtx {
     }
 
     pub fn get_snapshot(&self, surface: &cairo::ImageSurface) {
-        // let (x, y) = (self.rect.x, self.rect.y);
-        let (x, y) = (0.0, 0.0);
-
         // TODO: as far as I can tell this should not render elements past the last (topmost) one
         // with enable-background: new (because technically we shouldn't have been caching them).
         // Right now there are no enable-background checks whatsoever.
         let cr = cairo::Context::new(&surface);
         for draw in self.cr_stack.iter() {
-            let nested = self.is_cairo_context_nested(&draw);
-            cr.set_source_surface(
-                &draw.get_target(),
-                if nested { 0f64 } else { -x },
-                if nested { 0f64 } else { -y },
-            );
+            cr.set_source_surface(&draw.get_target(), 0.0, 0.0);
             cr.paint();
         }
     }


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