[librsvg: 3/6] Pass the current_color to stroke and fill
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc: 
- Subject: [librsvg: 3/6] Pass the current_color to stroke and fill
- Date: Wed,  2 Sep 2020 00:49:38 +0000 (UTC)
commit 26c70c0920a768b50f3b7668293b9f0bdaa9b71c
Author: Federico Mena Quintero <federico gnome org>
Date:   Tue Sep 1 19:23:16 2020 -0500
    Pass the current_color to stroke and fill
 rsvg_internals/src/drawing_ctx.rs | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/rsvg_internals/src/drawing_ctx.rs b/rsvg_internals/src/drawing_ctx.rs
index e5cbf144..a322a095 100644
--- a/rsvg_internals/src/drawing_ctx.rs
+++ b/rsvg_internals/src/drawing_ctx.rs
@@ -1166,9 +1166,8 @@ impl DrawingCtx {
         acquired_nodes: &mut AcquiredNodes,
         values: &ComputedValues,
         bbox: &BoundingBox,
+        current_color: cssparser::RGBA,
     ) -> Result<(), RenderingError> {
-        let current_color = values.color().0;
-
         self.set_source_paint_server(
             acquired_nodes,
             &values.stroke().0,
@@ -1192,9 +1191,8 @@ impl DrawingCtx {
         acquired_nodes: &mut AcquiredNodes,
         values: &ComputedValues,
         bbox: &BoundingBox,
+        current_color: cssparser::RGBA,
     ) -> Result<(), RenderingError> {
-        let current_color = values.color().0;
-
         self.set_source_paint_server(
             acquired_nodes,
             &values.fill().0,
@@ -1244,16 +1242,18 @@ impl DrawingCtx {
                 bbox
             };
 
+            let current_color = values.color().0;
+
             for &target in &values.paint_order().targets {
                 match target {
                     PaintTarget::Fill if !clipping => {
                         path.to_cairo(&cr, is_square_linecap)?;
-                        dc.fill(&cr, an, values, &bbox)?;
+                        dc.fill(&cr, an, values, &bbox, current_color)?;
                         cr.new_path();
                     }
                     PaintTarget::Stroke if !clipping => {
                         path.to_cairo(&cr, is_square_linecap)?;
-                        dc.stroke(&cr, an, values, &bbox)?;
+                        dc.stroke(&cr, an, values, &bbox, current_color)?;
                         cr.new_path();
                     }
                     PaintTarget::Markers if markers == Markers::Yes => {
[
Date Prev][
Date Next]   [
Thread Prev][
Thread Next]   
[
Thread Index]
[
Date Index]
[
Author Index]