[librsvg: 3/3] Merge branch 'pborelli/librsvg-acquired_nodes'



commit 4590b7c7e43b54de88f179841b41e3e67108b760
Merge: bcbe99a7 e7a16afb
Author: Federico Mena Quintero <federico gnome org>
Date:   Sat Feb 1 20:43:05 2020 +0100

    Merge branch 'pborelli/librsvg-acquired_nodes'

 rsvg_internals/src/document.rs                     | 161 +++++++++-
 rsvg_internals/src/drawing_ctx.rs                  | 332 +++++++--------------
 rsvg_internals/src/filters/blend.rs                |   6 +-
 rsvg_internals/src/filters/color_matrix.rs         |   4 +-
 rsvg_internals/src/filters/component_transfer.rs   |   4 +-
 rsvg_internals/src/filters/composite.rs            |   6 +-
 rsvg_internals/src/filters/context.rs              |  21 +-
 rsvg_internals/src/filters/convolve_matrix.rs      |   4 +-
 rsvg_internals/src/filters/displacement_map.rs     |   6 +-
 rsvg_internals/src/filters/flood.rs                |   2 +
 rsvg_internals/src/filters/gaussian_blur.rs        |   4 +-
 rsvg_internals/src/filters/image.rs                |  26 +-
 rsvg_internals/src/filters/light/lighting.rs       |   7 +-
 rsvg_internals/src/filters/merge.rs                |   7 +-
 rsvg_internals/src/filters/mod.rs                  |   8 +-
 rsvg_internals/src/filters/morphology.rs           |   4 +-
 rsvg_internals/src/filters/offset.rs               |   4 +-
 rsvg_internals/src/filters/tile.rs                 |   4 +-
 rsvg_internals/src/filters/turbulence.rs           |   2 +
 rsvg_internals/src/gradient.rs                     |  14 +-
 rsvg_internals/src/handle.rs                       |  75 ++---
 rsvg_internals/src/image.rs                        |   7 +-
 rsvg_internals/src/marker.rs                       |  22 +-
 rsvg_internals/src/node.rs                         |  11 +-
 rsvg_internals/src/paint_server.rs                 |   9 +-
 rsvg_internals/src/pattern.rs                      |  19 +-
 rsvg_internals/src/shapes.rs                       |  45 ++-
 rsvg_internals/src/structure.rs                    |  35 ++-
 rsvg_internals/src/surface_utils/shared_surface.rs |   5 +-
 rsvg_internals/src/text.rs                         |  43 ++-
 rsvg_internals/src/xml.rs                          |  10 +-
 31 files changed, 560 insertions(+), 347 deletions(-)
---
diff --cc rsvg_internals/src/drawing_ctx.rs
index f04c0adc,470b5170..6514b461
--- a/rsvg_internals/src/drawing_ctx.rs
+++ b/rsvg_internals/src/drawing_ctx.rs
@@@ -567,7 -566,7 +566,7 @@@ impl DrawingCtx 
                      // Clip
  
                      dc.cr.set_matrix(affines.outside_temporary_surface.into());
-                     dc.clip_to_node(&clip_in_object_space, &bbox)?;
 -                    let _: () = dc.clip_to_node(&clip_in_object_space, acquired_nodes, &bbox)?;
++                    dc.clip_to_node(&clip_in_object_space, acquired_nodes, &bbox)?;
  
                      // Mask
  
@@@ -722,9 -724,16 +724,16 @@@
  
                  if !filter_node.borrow().is_in_error() {
                      // FIXME: deal with out of memory here
-                     filters::render(&filter_node, values, child_surface, self, node_bbox)
+                     filters::render(
+                         &filter_node,
+                         values,
+                         child_surface,
+                         acquired_nodes,
+                         self,
+                         node_bbox,
+                     )
                  } else {
 -                    Ok(child_surface.clone())
 +                    Ok(child_surface)
                  }
              }
  
diff --cc rsvg_internals/src/pattern.rs
index 671f2da8,38aeb765..bdedf78b
--- a/rsvg_internals/src/pattern.rs
+++ b/rsvg_internals/src/pattern.rs
@@@ -344,30 -346,29 +346,31 @@@ impl AsPaintSource for ResolvedPattern 
          draw_ctx.set_cairo_context(&cr_pattern);
  
          // Set up transformations to be determined by the contents units
 -
 -        // Draw everything
 -        let pattern_cascaded = CascadedValues::new_from_node(&node_with_children);
 -        let pattern_values = pattern_cascaded.get();
 -
          cr_pattern.set_matrix(caffine.into());
  
 -        let UnitInterval(o) = opacity;
 -        if o < 1.0 {
 -            cr_pattern.push_group();
 +        // Declare a drawing function
 +        fn draw_children(
++            acquired_nodes: &mut AcquiredNodes,
 +            ctx: &mut DrawingCtx,
 +            node: &RsvgNode,
 +        ) -> Result<BoundingBox, RenderingError> {
 +            let pattern_cascaded = CascadedValues::new_from_node(&node);
 +            let pattern_values = pattern_cascaded.get();
-             ctx.with_discrete_layer(&node, pattern_values, false, &mut |dc| {
-                 node.draw_children(&pattern_cascaded, dc, false)
++            ctx.with_discrete_layer(&node, acquired_nodes, pattern_values, false, &mut |an, dc| {
++                node.draw_children(an, &pattern_cascaded, dc, false)
 +            })
          }
  
 -        let res = draw_ctx.with_discrete_layer(
 -            &node_with_children,
 -            acquired_nodes,
 -            pattern_values,
 -            false,
 -            &mut |an, dc| node_with_children.draw_children(an, &pattern_cascaded, dc, false),
 -        );
 -
 +        // Draw everything
 +        let res;
 +        let UnitInterval(o) = opacity;
          if o < 1.0 {
 +            cr_pattern.push_group();
-             res = draw_children(draw_ctx, &node_with_children);
++            res = draw_children(acquired_nodes, draw_ctx, &node_with_children);
              cr_pattern.pop_group_to_source();
              cr_pattern.paint_with_alpha(o);
 +        } else {
-             res = draw_children(draw_ctx, &node_with_children);
++            res = draw_children(acquired_nodes, draw_ctx, &node_with_children);
          }
  
          // Return to the original coordinate system and rendering context


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