[librsvg: 13/15] Call draw_ctx.draw_shape() directly




commit e8e7a2796c9ca1c1aa779cc77d8ec1c4ba311bdc
Author: Federico Mena Quintero <federico gnome org>
Date:   Tue Dec 1 15:59:10 2020 -0600

    Call draw_ctx.draw_shape() directly

 src/shapes.rs | 20 ++------------------
 1 file changed, 2 insertions(+), 18 deletions(-)
---
diff --git a/src/shapes.rs b/src/shapes.rs
index 6fb3ba20..5b6736ab 100644
--- a/src/shapes.rs
+++ b/src/shapes.rs
@@ -34,17 +34,6 @@ impl Shape {
     fn new(path: Rc<SvgPath>, markers: Markers) -> Shape {
         Shape { path, markers }
     }
-
-    fn draw(
-        &self,
-        node: &Node,
-        acquired_nodes: &mut AcquiredNodes<'_>,
-        values: &ComputedValues,
-        draw_ctx: &mut DrawingCtx,
-        clipping: bool,
-    ) -> Result<BoundingBox, RenderingError> {
-        draw_ctx.draw_shape(self, node, acquired_nodes, values, clipping)
-    }
 }
 
 trait BasicShape {
@@ -63,13 +52,8 @@ macro_rules! impl_draw {
                 clipping: bool,
             ) -> Result<BoundingBox, RenderingError> {
                 let values = cascaded.get();
-                self.make_shape(values, draw_ctx).draw(
-                    node,
-                    acquired_nodes,
-                    values,
-                    draw_ctx,
-                    clipping,
-                )
+                let shape = self.make_shape(values, draw_ctx);
+                draw_ctx.draw_shape(&shape, node, acquired_nodes, values, clipping)
             }
         }
     };


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