[librsvg: 6/12] Path: extract a make_path_builder function
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg: 6/12] Path: extract a make_path_builder function
- Date: Tue, 10 Dec 2019 19:45:02 +0000 (UTC)
commit abfd8ace7dc9c54eddc9b8c23dc4e1b6815d449e
Author: Federico Mena Quintero <federico gnome org>
Date: Tue Dec 10 10:20:17 2019 -0600
Path: extract a make_path_builder function
This one returns a Cow::Borrowed with the pre-parsed PathBuilder.
rsvg_internals/src/shapes.rs | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
---
diff --git a/rsvg_internals/src/shapes.rs b/rsvg_internals/src/shapes.rs
index f8fe03e1..16aba9fe 100644
--- a/rsvg_internals/src/shapes.rs
+++ b/rsvg_internals/src/shapes.rs
@@ -139,7 +139,18 @@ impl NodeTrait for Path {
clipping: bool,
) -> Result<BoundingBox, RenderingError> {
let values = cascaded.get();
- render_path_builder(&self.builder, draw_ctx, node, values, true, clipping)
+ let builder = self.make_path_builder(values, draw_ctx);
+ render_path_builder(&builder, draw_ctx, node, values, true, clipping)
+ }
+}
+
+impl Path {
+ fn make_path_builder(
+ &self,
+ _values: &ComputedValues,
+ _draw_ctx: &mut DrawingCtx,
+ ) -> Cow<PathBuilder> {
+ Cow::Borrowed(&self.builder)
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]