[librsvg: 4/31] Put the mix-blend-mode in StackingContext
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg: 4/31] Put the mix-blend-mode in StackingContext
- Date: Thu, 3 Jun 2021 02:27:10 +0000 (UTC)
commit 88732ae5f2572d87a3aa87341ffeb60596a5a7ab
Author: Federico Mena Quintero <federico gnome org>
Date: Wed Jun 2 15:27:13 2021 -0500
Put the mix-blend-mode in StackingContext
src/drawing_ctx.rs | 4 ++--
src/layout.rs | 6 +++++-
2 files changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/src/drawing_ctx.rs b/src/drawing_ctx.rs
index c6125d4b..adffb4b3 100644
--- a/src/drawing_ctx.rs
+++ b/src/drawing_ctx.rs
@@ -664,7 +664,7 @@ impl DrawingCtx {
let needs_temporary_surface = !(is_opaque
&& stacking_ctx.filter == Filter::None
&& stacking_ctx.mask.is_none()
- && values.mix_blend_mode() == MixBlendMode::Normal
+ && stacking_ctx.mix_blend_mode == MixBlendMode::Normal
&& stacking_ctx.clip_in_object_space.is_none());
if needs_temporary_surface {
@@ -770,7 +770,7 @@ impl DrawingCtx {
saved_cr
.draw_ctx
.cr
- .set_operator(values.mix_blend_mode().into());
+ .set_operator(stacking_ctx.mix_blend_mode.into());
if opacity < 1.0 {
saved_cr.draw_ctx.cr.paint_with_alpha(opacity);
diff --git a/src/layout.rs b/src/layout.rs
index 4570c876..b56a573c 100644
--- a/src/layout.rs
+++ b/src/layout.rs
@@ -10,7 +10,7 @@ use crate::length::*;
use crate::node::*;
use crate::properties::ComputedValues;
use crate::property_defs::{
- Filter, Opacity, StrokeDasharray, StrokeLinecap, StrokeLinejoin, StrokeMiterlimit,
+ Filter, MixBlendMode, Opacity, StrokeDasharray, StrokeLinecap, StrokeLinejoin, StrokeMiterlimit,
};
use crate::transform::Transform;
use crate::unit_interval::UnitInterval;
@@ -36,6 +36,7 @@ pub struct StackingContext {
pub clip_in_user_space: Option<Node>,
pub clip_in_object_space: Option<Node>,
pub mask: Option<Node>,
+ pub mix_blend_mode: MixBlendMode,
}
/// Stroke parameters in user-space coordinates.
@@ -122,6 +123,8 @@ impl StackingContext {
}
});
+ let mix_blend_mode = values.mix_blend_mode();
+
StackingContext {
element_name,
transform,
@@ -130,6 +133,7 @@ impl StackingContext {
clip_in_user_space,
clip_in_object_space,
mask,
+ mix_blend_mode,
}
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]