[librsvg: 5/6] shapes: move drawing of path builder here
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg: 5/6] shapes: move drawing of path builder here
- Date: Tue, 26 Jun 2018 02:03:29 +0000 (UTC)
commit a0a361465094f7fa6e7020ad0655376816a572f6
Author: Paolo Borelli <pborelli gnome org>
Date: Mon Jun 25 23:11:44 2018 +0200
shapes: move drawing of path builder here
This gets rid of draw.rs
Makefile.am | 1 -
rsvg_internals/src/draw.rs | 28 ----------------------------
rsvg_internals/src/lib.rs | 1 -
rsvg_internals/src/shapes.rs | 14 ++++++++++++--
4 files changed, 12 insertions(+), 32 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index a7c198d5..30b2f142 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -76,7 +76,6 @@ RUST_SRC = \
rsvg_internals/src/cond.rs \
rsvg_internals/src/coord_units.rs \
rsvg_internals/src/defs.rs \
- rsvg_internals/src/draw.rs \
rsvg_internals/src/drawing_ctx.rs \
rsvg_internals/src/filters/bounds.rs \
rsvg_internals/src/filters/blend.rs \
diff --git a/rsvg_internals/src/lib.rs b/rsvg_internals/src/lib.rs
index 1f34497b..3c023f39 100644
--- a/rsvg_internals/src/lib.rs
+++ b/rsvg_internals/src/lib.rs
@@ -116,7 +116,6 @@ mod cnode;
mod color;
mod cond;
mod defs;
-mod draw;
mod drawing_ctx;
mod error;
pub mod filters;
diff --git a/rsvg_internals/src/shapes.rs b/rsvg_internals/src/shapes.rs
index fc818f1f..dc3cd445 100644
--- a/rsvg_internals/src/shapes.rs
+++ b/rsvg_internals/src/shapes.rs
@@ -1,8 +1,8 @@
+use cairo;
use std::cell::Cell;
use std::cell::RefCell;
use attributes::Attribute;
-use draw::draw_path_builder;
use drawing_ctx::DrawingCtx;
use error::*;
use handle::RsvgHandle;
@@ -24,7 +24,17 @@ fn render_path_builder(
clipping: bool,
) {
draw_ctx.with_discrete_layer(node, values, clipping, &mut |dc| {
- draw_path_builder(dc, values, builder, clipping);
+ let cr = dc.get_cairo_context();
+
+ dc.set_affine_on_cr(&cr);
+ builder.to_cairo(&cr);
+
+ if clipping {
+ cr.set_fill_rule(cairo::FillRule::from(values.clip_rule));
+ } else {
+ cr.set_fill_rule(cairo::FillRule::from(values.fill_rule));
+ dc.stroke_and_fill(&cr, values);
+ }
});
if render_markers {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]