[librsvg] (#268) - Remove the comp-op property; it's not in SVG 1.1 not SVG 2
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg] (#268) - Remove the comp-op property; it's not in SVG 1.1 not SVG 2
- Date: Mon, 14 Jan 2019 14:37:43 +0000 (UTC)
commit e300273cb85d2259a39a34a455795aa79d9f8152
Author: Federico Mena Quintero <federico gnome org>
Date: Mon Jan 14 08:36:41 2019 -0600
(#268) - Remove the comp-op property; it's not in SVG 1.1 not SVG 2
This property for the compositing operator was just in the SVG 1.2
spec, which was never implemented. SVG 2 removed it.
Fixes https://gitlab.gnome.org/GNOME/librsvg/issues/268
rsvg_internals/build.rs | 1 -
rsvg_internals/src/drawing_ctx.rs | 36 ----------------------------------
rsvg_internals/src/image.rs | 2 --
rsvg_internals/src/state.rs | 41 ---------------------------------------
4 files changed, 80 deletions(-)
---
diff --git a/rsvg_internals/build.rs b/rsvg_internals/build.rs
index 567ac0b7..ca7e6f22 100644
--- a/rsvg_internals/build.rs
+++ b/rsvg_internals/build.rs
@@ -27,7 +27,6 @@ fn generate_phf_of_svg_attributes() {
( "clipPathUnits", "ClipPathUnits" ),
( "color", "Color" ),
( "color-interpolation-filters", "ColorInterpolationFilters" ),
- ( "comp-op", "CompOp" ),
( "cx", "Cx" ),
( "cy", "Cy" ),
( "d", "D" ),
diff --git a/rsvg_internals/src/drawing_ctx.rs b/rsvg_internals/src/drawing_ctx.rs
index d76dda79..a5116d39 100644
--- a/rsvg_internals/src/drawing_ctx.rs
+++ b/rsvg_internals/src/drawing_ctx.rs
@@ -21,7 +21,6 @@ use pattern::NodePattern;
use rect::RectangleExt;
use state::{
ClipRule,
- CompOp,
ComputedValues,
EnableBackground,
FillRule,
@@ -348,7 +347,6 @@ impl DrawingCtx {
};
let UnitInterval(opacity) = values.opacity.0;
- let comp_op = values.comp_op;
let enable_background = values.enable_background;
let affine = original_cr.get_matrix();
@@ -388,7 +386,6 @@ impl DrawingCtx {
&& filter.is_none()
&& mask.is_none()
&& clip_in_object_space.is_none()
- && comp_op == CompOp::SrcOver
&& enable_background == EnableBackground::Accumulate);
if needs_temporary_surface {
@@ -441,8 +438,6 @@ impl DrawingCtx {
})?;
}
- original_cr.set_operator(cairo::Operator::from(comp_op));
-
if let Some(mask) = mask {
if let Some(acquired) =
self.get_acquired_node_of_type(Some(mask), NodeType::Mask)
@@ -881,37 +876,6 @@ impl From<StrokeLinecap> for cairo::LineCap {
}
}
-impl From<CompOp> for cairo::Operator {
- fn from(op: CompOp) -> cairo::Operator {
- match op {
- CompOp::Clear => cairo::Operator::Clear,
- CompOp::Src => cairo::Operator::Source,
- CompOp::Dst => cairo::Operator::Dest,
- CompOp::SrcOver => cairo::Operator::Over,
- CompOp::DstOver => cairo::Operator::DestOver,
- CompOp::SrcIn => cairo::Operator::In,
- CompOp::DstIn => cairo::Operator::DestIn,
- CompOp::SrcOut => cairo::Operator::Out,
- CompOp::DstOut => cairo::Operator::DestOut,
- CompOp::SrcAtop => cairo::Operator::Atop,
- CompOp::DstAtop => cairo::Operator::DestAtop,
- CompOp::Xor => cairo::Operator::Xor,
- CompOp::Plus => cairo::Operator::Add,
- CompOp::Multiply => cairo::Operator::Multiply,
- CompOp::Screen => cairo::Operator::Screen,
- CompOp::Overlay => cairo::Operator::Overlay,
- CompOp::Darken => cairo::Operator::Darken,
- CompOp::Lighten => cairo::Operator::Lighten,
- CompOp::ColorDodge => cairo::Operator::ColorDodge,
- CompOp::ColorBurn => cairo::Operator::ColorBurn,
- CompOp::HardLight => cairo::Operator::HardLight,
- CompOp::SoftLight => cairo::Operator::SoftLight,
- CompOp::Difference => cairo::Operator::Difference,
- CompOp::Exclusion => cairo::Operator::Exclusion,
- }
- }
-}
-
impl From<ClipRule> for cairo::FillRule {
fn from(c: ClipRule) -> cairo::FillRule {
match c {
diff --git a/rsvg_internals/src/image.rs b/rsvg_internals/src/image.rs
index 6aa5802f..6a60dc6d 100644
--- a/rsvg_internals/src/image.rs
+++ b/rsvg_internals/src/image.rs
@@ -157,8 +157,6 @@ impl NodeTrait for NodeImage {
let x = x * width / w;
let y = y * height / h;
- cr.set_operator(cairo::Operator::from(values.comp_op));
-
// We need to set extend appropriately, so can't use cr.set_source_surface().
//
// If extend is left at its default value (None), then bilinear scaling uses
diff --git a/rsvg_internals/src/state.rs b/rsvg_internals/src/state.rs
index 870adf60..c38ee07e 100644
--- a/rsvg_internals/src/state.rs
+++ b/rsvg_internals/src/state.rs
@@ -90,7 +90,6 @@ pub struct SpecifiedValues {
pub baseline_shift: SpecifiedValue<BaselineShift>,
pub clip_path: SpecifiedValue<ClipPath>,
pub clip_rule: SpecifiedValue<ClipRule>,
- pub comp_op: SpecifiedValue<CompOp>,
pub color: SpecifiedValue<Color>,
pub color_interpolation_filters: SpecifiedValue<ColorInterpolationFilters>,
pub direction: SpecifiedValue<Direction>,
@@ -142,7 +141,6 @@ pub struct ComputedValues {
pub baseline_shift: BaselineShift,
pub clip_path: ClipPath,
pub clip_rule: ClipRule,
- pub comp_op: CompOp,
pub color: Color,
pub color_interpolation_filters: ColorInterpolationFilters,
pub direction: Direction,
@@ -217,7 +215,6 @@ impl SpecifiedValues {
compute_value!(self, computed, baseline_shift);
compute_value!(self, computed, clip_path);
compute_value!(self, computed, clip_rule);
- compute_value!(self, computed, comp_op);
compute_value!(self, computed, color);
compute_value!(self, computed, color_interpolation_filters);
compute_value!(self, computed, direction);
@@ -311,10 +308,6 @@ impl State {
self.values.color_interpolation_filters = parse_property(value, ())?;
}
- Attribute::CompOp => {
- self.values.comp_op = parse_property(value, ())?;
- }
-
Attribute::Direction => {
self.values.direction = parse_property(value, ())?;
}
@@ -737,40 +730,6 @@ make_property!(
"sRGB" => Srgb,
);
-// https://gitlab.gnome.org/GNOME/librsvg/issues/268 - can we remove this property?
-make_property!(
- ComputedValues,
- CompOp,
- default: SrcOver,
- inherits_automatically: false,
-
- identifiers:
- "clear" => Clear,
- "src" => Src,
- "dst" => Dst,
- "src-over" => SrcOver,
- "dst-over" => DstOver,
- "src-in" => SrcIn,
- "dst-in" => DstIn,
- "src-out" => SrcOut,
- "dst-out" => DstOut,
- "src-atop" => SrcAtop,
- "dst-atop" => DstAtop,
- "xor" => Xor,
- "plus" => Plus,
- "multiply" => Multiply,
- "screen" => Screen,
- "overlay" => Overlay,
- "darken" => Darken,
- "lighten" => Lighten,
- "color-dodge" => ColorDodge,
- "color-burn" => ColorBurn,
- "hard-light" => HardLight,
- "soft-light" => SoftLight,
- "difference" => Difference,
- "exclusion" => Exclusion,
-);
-
// https://www.w3.org/TR/SVG/text.html#DirectionProperty
make_property!(
ComputedValues,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]