[librsvg: 17/27] Remove current_color argument from stroke() and fill()
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg: 17/27] Remove current_color argument from stroke() and fill()
- Date: Fri, 5 Mar 2021 23:36:27 +0000 (UTC)
commit 357d014885d3cde7cfe89ccd4e44595a92ac2255
Author: Federico Mena Quintero <federico gnome org>
Date: Fri Mar 5 13:55:15 2021 -0600
Remove current_color argument from stroke() and fill()
Those functions obtain the entire ComputedValues, and current_color
always gets extracted from there in the same way.
src/drawing_ctx.rs | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
---
diff --git a/src/drawing_ctx.rs b/src/drawing_ctx.rs
index cef9bc7a..6e0347a1 100644
--- a/src/drawing_ctx.rs
+++ b/src/drawing_ctx.rs
@@ -1203,12 +1203,11 @@ impl DrawingCtx {
acquired_nodes: &mut AcquiredNodes<'_>,
values: &ComputedValues,
bbox: &BoundingBox,
- current_color: cssparser::RGBA,
) -> Result<(), RenderingError> {
let paint_source = values
.stroke()
.0
- .resolve(acquired_nodes, values.stroke_opacity().0, current_color)?
+ .resolve(acquired_nodes, values.stroke_opacity().0, values.color().0)?
.to_user_space(bbox, self, values);
self.set_paint_source(&paint_source, values.stroke_opacity().0, acquired_nodes)
@@ -1227,12 +1226,11 @@ impl DrawingCtx {
acquired_nodes: &mut AcquiredNodes<'_>,
values: &ComputedValues,
bbox: &BoundingBox,
- current_color: cssparser::RGBA,
) -> Result<(), RenderingError> {
let paint_source = values
.fill()
.0
- .resolve(acquired_nodes, values.fill_opacity().0, current_color)?
+ .resolve(acquired_nodes, values.fill_opacity().0, values.color().0)?
.to_user_space(bbox, self, values);
self.set_paint_source(&paint_source, values.fill_opacity().0, acquired_nodes)
@@ -1271,8 +1269,6 @@ impl DrawingCtx {
return Ok(dc.empty_bbox());
}
- let current_color = values.color().0;
-
cr.set_antialias(cairo::Antialias::from(values.shape_rendering()));
dc.setup_cr_for_stroke(&cr, values);
@@ -1295,9 +1291,9 @@ impl DrawingCtx {
if values.is_visible() {
if target == PaintTarget::Stroke {
- dc.stroke(&cr, an, values, &bbox, current_color)?;
+ dc.stroke(&cr, an, values, &bbox)?;
} else {
- dc.fill(&cr, an, values, &bbox, current_color)?;
+ dc.fill(&cr, an, values, &bbox)?;
}
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]