[librsvg: 22/90] Don't get the temporary surface in a roundabout way



commit 9d14cd1ca4c8220f7b5dda5275309e427039d6bb
Author: Federico Mena Quintero <federico gnome org>
Date:   Mon Mar 11 16:07:19 2019 -0600

    Don't get the temporary surface in a roundabout way

 rsvg_internals/src/drawing_ctx.rs | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
---
diff --git a/rsvg_internals/src/drawing_ctx.rs b/rsvg_internals/src/drawing_ctx.rs
index a33dab75..8d736912 100644
--- a/rsvg_internals/src/drawing_ctx.rs
+++ b/rsvg_internals/src/drawing_ctx.rs
@@ -448,7 +448,6 @@ impl DrawingCtx {
                 && clip_in_object_space.is_none()
                 && enable_background == EnableBackground::Accumulate);
 
-
             let res = if needs_temporary_surface {
                 let surface = self.create_surface_for_toplevel_viewport().map_err(|e| {
                     self.cr.restore();
@@ -466,16 +465,14 @@ impl DrawingCtx {
 
                 let mut res = draw_fn(self);
 
-                let child_surface = cairo::ImageSurface::from(self.cr.get_target()).unwrap();
-
                 let filter_result_surface = if let Some(filter_uri) = filter {
-                    self.run_filter(filter_uri, node, values, &child_surface, self.bbox)
+                    self.run_filter(filter_uri, node, values, &surface, self.bbox)
                         .map_err(|e| {
                             self.cr.restore();
                             e
                         })?
                 } else {
-                    child_surface
+                    surface
                 };
 
                 self.cr = self.cr_stack.pop().unwrap();


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