[librsvg/librsvg-2.50] Create the drawsub_stack outside the DrawingCtx
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg/librsvg-2.50] Create the drawsub_stack outside the DrawingCtx
- Date: Fri, 2 Oct 2020 19:24:36 +0000 (UTC)
commit 0145124613cb53b0efd39be35fd831588b920a40
Author: Federico Mena Quintero <federico gnome org>
Date: Fri Jun 19 17:52:04 2020 -0500
Create the drawsub_stack outside the DrawingCtx
rsvg_internals/src/drawing_ctx.rs | 19 ++++++++++++-------
1 file changed, 12 insertions(+), 7 deletions(-)
---
diff --git a/rsvg_internals/src/drawing_ctx.rs b/rsvg_internals/src/drawing_ctx.rs
index f42b57bc..a28efd89 100644
--- a/rsvg_internals/src/drawing_ctx.rs
+++ b/rsvg_internals/src/drawing_ctx.rs
@@ -159,20 +159,24 @@ pub fn draw_tree(
acquired_nodes: &mut AcquiredNodes,
cascaded: &CascadedValues<'_>,
) -> Result<BoundingBox, RenderingError> {
+ let drawsub_stack = if let Some(limit_to_stack) = limit_to_stack {
+ limit_to_stack
+ .ancestors()
+ .map(|n| n.clone())
+ .collect()
+ } else {
+ Vec::new()
+ };
+
let mut draw_ctx = DrawingCtx::new(
cr,
viewport,
dpi,
measuring,
testing,
+ drawsub_stack,
);
- if let Some(limit_to_stack) = limit_to_stack {
- for n in limit_to_stack.ancestors() {
- draw_ctx.drawsub_stack.push(n.clone());
- }
- }
-
draw_ctx.draw_node_from_stack(node, acquired_nodes, cascaded, false)
}
@@ -183,6 +187,7 @@ impl DrawingCtx {
dpi: Dpi,
measuring: bool,
testing: bool,
+ drawsub_stack: Vec<Node>,
) -> DrawingCtx {
let initial_transform = Transform::from(cr.get_matrix());
@@ -220,7 +225,7 @@ impl DrawingCtx {
cr_stack: Vec::new(),
cr: cr.clone(),
view_box_stack: Rc::new(RefCell::new(view_box_stack)),
- drawsub_stack: Vec::new(),
+ drawsub_stack,
measuring,
testing,
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]