Get rid of more filter FFI leftovers

parent adb43979
...@@ -226,6 +226,14 @@ name = "num-traits" ...@@ -226,6 +226,14 @@ name = "num-traits"
version = "0.2.5" version = "0.2.5"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "owning_ref"
version = "0.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"stable_deref_trait 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]] [[package]]
name = "pango" name = "pango"
version = "0.4.0" version = "0.4.0"
...@@ -390,6 +398,7 @@ dependencies = [ ...@@ -390,6 +398,7 @@ dependencies = [
"itertools 0.7.8 (registry+https://github.com/rust-lang/crates.io-index)", "itertools 0.7.8 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
"owning_ref 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
"pango 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "pango 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"pango-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", "pango-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
"pangocairo 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", "pangocairo 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
...@@ -419,6 +428,11 @@ name = "smallvec" ...@@ -419,6 +428,11 @@ name = "smallvec"
version = "0.6.2" version = "0.6.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "stable_deref_trait"
version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]] [[package]]
name = "syn" name = "syn"
version = "0.14.4" version = "0.14.4"
...@@ -515,6 +529,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" ...@@ -515,6 +529,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
"checksum num-integer 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)" = "e83d528d2677f0518c570baf2b7abdcf0cd2d248860b68507bdcb3e91d4c0cea" "checksum num-integer 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)" = "e83d528d2677f0518c570baf2b7abdcf0cd2d248860b68507bdcb3e91d4c0cea"
"checksum num-iter 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)" = "af3fdbbc3291a5464dc57b03860ec37ca6bf915ed6ee385e7c6c052c422b2124" "checksum num-iter 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)" = "af3fdbbc3291a5464dc57b03860ec37ca6bf915ed6ee385e7c6c052c422b2124"
"checksum num-traits 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "630de1ef5cc79d0cdd78b7e33b81f083cbfe90de0f4b2b2f07f905867c70e9fe" "checksum num-traits 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "630de1ef5cc79d0cdd78b7e33b81f083cbfe90de0f4b2b2f07f905867c70e9fe"
"checksum owning_ref 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "cdf84f41639e037b484f93433aa3897863b561ed65c6e59c7073d7c561710f37"
"checksum pango 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "45374801e224373c3c0393cd48073c81093494c8735721e81d1dbaa4096b2767" "checksum pango 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "45374801e224373c3c0393cd48073c81093494c8735721e81d1dbaa4096b2767"
"checksum pango-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "94039b3921a4af4058a3e4335e5d15099101f298a92f5afc40bab3a3027594a1" "checksum pango-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "94039b3921a4af4058a3e4335e5d15099101f298a92f5afc40bab3a3027594a1"
"checksum pangocairo 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "db4130d0e0567b177178c9568466277ff167cb43a245b2881e203509ea5fbd84" "checksum pangocairo 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "db4130d0e0567b177178c9568466277ff167cb43a245b2881e203509ea5fbd84"
...@@ -534,6 +549,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" ...@@ -534,6 +549,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
"checksum rulinalg 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "04ada202c9685e1d72a7420c578e92b358dbf807d3dfabb676a3dab9cc3bb12f" "checksum rulinalg 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "04ada202c9685e1d72a7420c578e92b358dbf807d3dfabb676a3dab9cc3bb12f"
"checksum siphasher 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "0df90a788073e8d0235a67e50441d47db7c8ad9debd91cbf43736a2a92d36537" "checksum siphasher 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "0df90a788073e8d0235a67e50441d47db7c8ad9debd91cbf43736a2a92d36537"
"checksum smallvec 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "312a7df010092e73d6bbaf141957e868d4f30efd2bfd9bb1028ad91abec58514" "checksum smallvec 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "312a7df010092e73d6bbaf141957e868d4f30efd2bfd9bb1028ad91abec58514"
"checksum stable_deref_trait 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ffbc596e092fe5f598b12ef46cc03754085ac2f4d8c739ad61c4ae266cc3b3fa"
"checksum syn 0.14.4 (registry+https://github.com/rust-lang/crates.io-index)" = "2beff8ebc3658f07512a413866875adddd20f4fd47b2a4e6c9da65cd281baaea" "checksum syn 0.14.4 (registry+https://github.com/rust-lang/crates.io-index)" = "2beff8ebc3658f07512a413866875adddd20f4fd47b2a4e6c9da65cd281baaea"
"checksum thread_local 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "279ef31c19ededf577bfd12dfae728040a21f635b06a24cd670ff510edd38963" "checksum thread_local 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "279ef31c19ededf577bfd12dfae728040a21f635b06a24cd670ff510edd38963"
"checksum ucd-util 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "fd2be2d6639d0f8fe6cdda291ad456e23629558d466e2789d2c3e9892bda285d" "checksum ucd-util 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "fd2be2d6639d0f8fe6cdda291ad456e23629558d466e2789d2c3e9892bda285d"
......
...@@ -73,7 +73,6 @@ RUST_SRC = \ ...@@ -73,7 +73,6 @@ RUST_SRC = \
rsvg_internals/src/filters/context.rs \ rsvg_internals/src/filters/context.rs \
rsvg_internals/src/filters/displacement_map.rs \ rsvg_internals/src/filters/displacement_map.rs \
rsvg_internals/src/filters/error.rs \ rsvg_internals/src/filters/error.rs \
rsvg_internals/src/filters/ffi.rs \
rsvg_internals/src/filters/flood.rs \ rsvg_internals/src/filters/flood.rs \
rsvg_internals/src/filters/gaussian_blur.rs \ rsvg_internals/src/filters/gaussian_blur.rs \
rsvg_internals/src/filters/image.rs \ rsvg_internals/src/filters/image.rs \
......
...@@ -33,6 +33,7 @@ lazy_static = "1.0.0" ...@@ -33,6 +33,7 @@ lazy_static = "1.0.0"
phf = "0.7.21" phf = "0.7.21"
float-cmp = "0.4.0" float-cmp = "0.4.0"
rulinalg = "0.4" rulinalg = "0.4"
owning_ref = "0.3"
[dependencies.cairo-sys-rs] [dependencies.cairo-sys-rs]
version = "0.6" version = "0.6"
......
...@@ -15,7 +15,7 @@ use bbox::BoundingBox; ...@@ -15,7 +15,7 @@ use bbox::BoundingBox;
use clip_path::{ClipPathUnits, NodeClipPath}; use clip_path::{ClipPathUnits, NodeClipPath};
use coord_units::CoordUnits; use coord_units::CoordUnits;
use defs::{self, RsvgDefs}; use defs::{self, RsvgDefs};
use filters::filter_render; use filters;
use float_eq_cairo::ApproxEqCairo; use float_eq_cairo::ApproxEqCairo;
use length::Dasharray; use length::Dasharray;
use mask::NodeMask; use mask::NodeMask;
...@@ -347,7 +347,7 @@ impl<'a> DrawingCtx { ...@@ -347,7 +347,7 @@ impl<'a> DrawingCtx {
if !filter_node.is_in_error() { if !filter_node.is_in_error() {
// FIXME: deal with out of memory here // FIXME: deal with out of memory here
Some(filter_render(&filter_node, node, &output, self)) Some(filters::render(&filter_node, node, &output, self))
} else { } else {
None None
} }
......
...@@ -6,7 +6,7 @@ use attributes::Attribute; ...@@ -6,7 +6,7 @@ use attributes::Attribute;
use drawing_ctx::DrawingCtx; use drawing_ctx::DrawingCtx;
use error::NodeError; use error::NodeError;
use handle::RsvgHandle; use handle::RsvgHandle;
use node::{NodeResult, NodeTrait, RsvgCNodeImpl, RsvgNode}; use node::{NodeResult, NodeTrait, RsvgNode};
use parsers::ParseError; use parsers::ParseError;
use property_bag::PropertyBag; use property_bag::PropertyBag;
use surface_utils::shared_surface::SharedImageSurface; use surface_utils::shared_surface::SharedImageSurface;
...@@ -65,11 +65,6 @@ impl NodeTrait for Blend { ...@@ -65,11 +65,6 @@ impl NodeTrait for Blend {
Ok(()) Ok(())
} }
#[inline]
fn get_c_impl(&self) -> *const RsvgCNodeImpl {
self.base.get_c_impl()
}
} }
impl Filter for Blend { impl Filter for Blend {
...@@ -118,7 +113,7 @@ impl Filter for Blend { ...@@ -118,7 +113,7 @@ impl Filter for Blend {
} }
#[inline] #[inline]
fn is_affected_by_color_interpolation_filters() -> bool { fn is_affected_by_color_interpolation_filters(&self) -> bool {
true true
} }
} }
......
...@@ -10,7 +10,7 @@ use attributes::Attribute; ...@@ -10,7 +10,7 @@ use attributes::Attribute;
use drawing_ctx::DrawingCtx; use drawing_ctx::DrawingCtx;
use error::NodeError; use error::NodeError;
use handle::RsvgHandle; use handle::RsvgHandle;
use node::{NodeResult, NodeTrait, RsvgCNodeImpl, RsvgNode}; use node::{NodeResult, NodeTrait, RsvgNode};
use parsers::{self, ListLength, NumberListError, ParseError}; use parsers::{self, ListLength, NumberListError, ParseError};
use property_bag::PropertyBag; use property_bag::PropertyBag;
use surface_utils::{ use surface_utils::{
...@@ -160,11 +160,6 @@ impl NodeTrait for ColorMatrix { ...@@ -160,11 +160,6 @@ impl NodeTrait for ColorMatrix {
Ok(()) Ok(())
} }
#[inline]
fn get_c_impl(&self) -> *const RsvgCNodeImpl {
self.base.get_c_impl()
}
} }
impl Filter for ColorMatrix { impl Filter for ColorMatrix {
...@@ -247,7 +242,7 @@ impl Filter for ColorMatrix { ...@@ -247,7 +242,7 @@ impl Filter for ColorMatrix {
} }
#[inline] #[inline]
fn is_affected_by_color_interpolation_filters() -> bool { fn is_affected_by_color_interpolation_filters(&self) -> bool {
true true
} }
} }
......
...@@ -7,7 +7,7 @@ use attributes::Attribute; ...@@ -7,7 +7,7 @@ use attributes::Attribute;
use drawing_ctx::DrawingCtx; use drawing_ctx::DrawingCtx;
use error::NodeError; use error::NodeError;
use handle::RsvgHandle; use handle::RsvgHandle;
use node::{NodeResult, NodeTrait, NodeType, RsvgCNodeImpl, RsvgNode}; use node::{NodeResult, NodeTrait, NodeType, RsvgNode};
use parsers::{self, ListLength, NumberListError, ParseError}; use parsers::{self, ListLength, NumberListError, ParseError};
use property_bag::PropertyBag; use property_bag::PropertyBag;
use surface_utils::{ use surface_utils::{
...@@ -211,11 +211,6 @@ impl NodeTrait for ComponentTransfer { ...@@ -211,11 +211,6 @@ impl NodeTrait for ComponentTransfer {
) -> NodeResult { ) -> NodeResult {
self.base.set_atts(node, handle, pbag) self.base.set_atts(node, handle, pbag)
} }
#[inline]
fn get_c_impl(&self) -> *const RsvgCNodeImpl {
self.base.get_c_impl()
}
} }
impl NodeTrait for FuncX { impl NodeTrait for FuncX {
...@@ -384,7 +379,7 @@ impl Filter for ComponentTransfer { ...@@ -384,7 +379,7 @@ impl Filter for ComponentTransfer {
}) })
} }
fn is_affected_by_color_interpolation_filters() -> bool { fn is_affected_by_color_interpolation_filters(&self) -> bool {
true true
} }
} }
......
...@@ -7,7 +7,7 @@ use attributes::Attribute; ...@@ -7,7 +7,7 @@ use attributes::Attribute;
use drawing_ctx::DrawingCtx; use drawing_ctx::DrawingCtx;
use error::{AttributeError, NodeError}; use error::{AttributeError, NodeError};
use handle::RsvgHandle; use handle::RsvgHandle;
use node::{NodeResult, NodeTrait, RsvgCNodeImpl, RsvgNode}; use node::{NodeResult, NodeTrait, RsvgNode};
use parsers::{self, parse, Parse}; use parsers::{self, parse, Parse};
use property_bag::PropertyBag; use property_bag::PropertyBag;
use surface_utils::{ use surface_utils::{
...@@ -93,11 +93,6 @@ impl NodeTrait for Composite { ...@@ -93,11 +93,6 @@ impl NodeTrait for Composite {
Ok(()) Ok(())
} }
#[inline]
fn get_c_impl(&self) -> *const RsvgCNodeImpl {
self.base.get_c_impl()
}
} }
impl Filter for Composite { impl Filter for Composite {
...@@ -199,7 +194,7 @@ impl Filter for Composite { ...@@ -199,7 +194,7 @@ impl Filter for Composite {
} }
#[inline] #[inline]
fn is_affected_by_color_interpolation_filters() -> bool { fn is_affected_by_color_interpolation_filters(&self) -> bool {
true true
} }
} }
......
...@@ -7,7 +7,7 @@ use attributes::Attribute; ...@@ -7,7 +7,7 @@ use attributes::Attribute;
use drawing_ctx::DrawingCtx; use drawing_ctx::DrawingCtx;
use error::NodeError; use error::NodeError;
use handle::RsvgHandle; use handle::RsvgHandle;
use node::{NodeResult, NodeTrait, RsvgCNodeImpl, RsvgNode}; use node::{NodeResult, NodeTrait, RsvgNode};
use parsers::{self, ListLength, NumberListError, ParseError}; use parsers::{self, ListLength, NumberListError, ParseError};
use property_bag::PropertyBag; use property_bag::PropertyBag;
use surface_utils::{ use surface_utils::{
...@@ -208,11 +208,6 @@ impl NodeTrait for ConvolveMatrix { ...@@ -208,11 +208,6 @@ impl NodeTrait for ConvolveMatrix {
Ok(()) Ok(())
} }
#[inline]
fn get_c_impl(&self) -> *const RsvgCNodeImpl {
self.base.get_c_impl()
}
} }
impl Filter for ConvolveMatrix { impl Filter for ConvolveMatrix {
...@@ -366,7 +361,7 @@ impl Filter for ConvolveMatrix { ...@@ -366,7 +361,7 @@ impl Filter for ConvolveMatrix {
} }
#[inline] #[inline]
fn is_affected_by_color_interpolation_filters() -> bool { fn is_affected_by_color_interpolation_filters(&self) -> bool {
true true
} }
} }
......
...@@ -6,7 +6,7 @@ use attributes::Attribute; ...@@ -6,7 +6,7 @@ use attributes::Attribute;
use drawing_ctx::DrawingCtx; use drawing_ctx::DrawingCtx;
use error::NodeError; use error::NodeError;
use handle::RsvgHandle; use handle::RsvgHandle;
use node::{NodeResult, NodeTrait, RsvgCNodeImpl, RsvgNode}; use node::{NodeResult, NodeTrait, RsvgNode};
use parsers::{self, ParseError}; use parsers::{self, ParseError};
use property_bag::PropertyBag; use property_bag::PropertyBag;
use surface_utils::{iterators::Pixels, shared_surface::SharedImageSurface}; use surface_utils::{iterators::Pixels, shared_surface::SharedImageSurface};
...@@ -75,11 +75,6 @@ impl NodeTrait for DisplacementMap { ...@@ -75,11 +75,6 @@ impl NodeTrait for DisplacementMap {
Ok(()) Ok(())
} }
#[inline]
fn get_c_impl(&self) -> *const RsvgCNodeImpl {
self.base.get_c_impl()
}
} }
impl Filter for DisplacementMap { impl Filter for DisplacementMap {
...@@ -161,7 +156,7 @@ impl Filter for DisplacementMap { ...@@ -161,7 +156,7 @@ impl Filter for DisplacementMap {
} }
#[inline] #[inline]
fn is_affected_by_color_interpolation_filters() -> bool { fn is_affected_by_color_interpolation_filters(&self) -> bool {
// Performance TODO: this converts in back and forth to linear RGB while technically it's // Performance TODO: this converts in back and forth to linear RGB while technically it's
// only needed for in2. // only needed for in2.
true true
......
//! Internal FFI and marshalling things.
use cairo;
use drawing_ctx::DrawingCtx;
use node::{NodeType, RsvgNode};
use state::ColorInterpolationFilters;
use surface_utils::shared_surface::SharedImageSurface;
use super::context::FilterContext;
use super::{Filter, FilterError, FilterResult};
/// The type of the render function below.
pub(super) type RenderFunctionType =
fn(&RsvgNode, &FilterContext, &mut DrawingCtx) -> Result<FilterResult, FilterError>;
/// Downcasts the given `node` to the type `T` and calls `Filter::render()` on it.
pub(super) fn render<T: Filter>(
node: &RsvgNode,
ctx: &FilterContext,
draw_ctx: &mut DrawingCtx,
) -> Result<FilterResult, FilterError> {
node.with_impl(|filter: &T| filter.render(node, ctx, draw_ctx))
}
/// The type of the `is_affected_by_color_interpolation_filters` function below.
pub(super) type IsAffectedByColorInterpFunctionType = fn() -> bool;
/// Container for the filter function pointers. Needed to pass them around with C pointers.
#[derive(Clone, Copy)]
pub(super) struct FilterFunctionPointers {
render: RenderFunctionType,
is_affected_by_color_interpolation_filters: IsAffectedByColorInterpFunctionType,
}
impl FilterFunctionPointers {
/// Creates a `FilterFunctionPointers` filled with pointers for `T`.
pub(super) fn new<T: Filter>() -> Self {
Self {
render: render::<T>,
is_affected_by_color_interpolation_filters:
T::is_affected_by_color_interpolation_filters,
}
}
}
/// Creates a new surface applied the filter. This function will create a context for itself, set up
/// the coordinate systems execute all its little primitives and then clean up its own mess.
pub fn filter_render(
filter_node: &RsvgNode,
node_being_filtered: &RsvgNode,
source: &cairo::ImageSurface,
draw_ctx: &mut DrawingCtx,
) -> cairo::ImageSurface {
let filter_node = &*filter_node;
assert_eq!(filter_node.get_type(), NodeType::Filter);
assert!(!filter_node.is_in_error());
// The source surface has multiple references. We need to copy it to a new surface to have a
// unique reference to be able to safely access the pixel data.
let source_surface = cairo::ImageSurface::create(
cairo::Format::ARgb32,
source.get_width(),
source.get_height(),
).unwrap();
{
let cr = cairo::Context::new(&source_surface);
cr.set_source_surface(source, 0f64, 0f64);
cr.paint();
}
let source_surface = SharedImageSurface::new(source_surface).unwrap();
let mut filter_ctx =
FilterContext::new(filter_node, node_being_filtered, source_surface, draw_ctx);
filter_node
.children()
.filter(|c| {
c.get_type() > NodeType::FilterPrimitiveFirst
&& c.get_type() < NodeType::FilterPrimitiveLast
})
.filter(|c| !c.is_in_error())
.map(|c| {
let linear_rgb = {
let cascaded = c.get_cascaded_values();
let values = cascaded.get();
values.color_interpolation_filters == ColorInterpolationFilters::LinearRgb
};
(c, linear_rgb)
})
.for_each(|(c, linear_rgb)| {
let pointers = unsafe { *(c.get_c_impl() as *const FilterFunctionPointers) };
let mut render = |filter_ctx: &mut FilterContext| {
if let Err(_) = (pointers.render)(&c, filter_ctx, draw_ctx)
.and_then(|result| filter_ctx.store_result(result))
{
// Do nothing for now.
}
};
if (pointers.is_affected_by_color_interpolation_filters)() && linear_rgb {
filter_ctx.with_linear_rgb(render);
} else {
render(&mut filter_ctx);
}
});
match filter_ctx.into_output() {
Ok(surface) => surface.into_image_surface(),
Err(err) => {
panic!(
"Could not create an empty surface to return from a filter: {}",
err
);
}
}
}
...@@ -3,7 +3,7 @@ use cssparser; ...@@ -3,7 +3,7 @@ use cssparser;
use drawing_ctx::DrawingCtx; use drawing_ctx::DrawingCtx;
use handle::RsvgHandle; use handle::RsvgHandle;
use node::{NodeResult, NodeTrait, RsvgCNodeImpl, RsvgNode}; use node::{NodeResult, NodeTrait, RsvgNode};
use property_bag::PropertyBag; use property_bag::PropertyBag;
use surface_utils::shared_surface::SharedImageSurface; use surface_utils::shared_surface::SharedImageSurface;
...@@ -35,11 +35,6 @@ impl NodeTrait for Flood { ...@@ -35,11 +35,6 @@ impl NodeTrait for Flood {
) -> NodeResult { ) -> NodeResult {
self.base.set_atts(node, handle, pbag) self.base.set_atts(node, handle, pbag)
} }
#[inline]
fn get_c_impl(&self) -> *const RsvgCNodeImpl {
self.base.get_c_impl()
}
} }
impl Filter for Flood { impl Filter for Flood {
...@@ -96,7 +91,7 @@ impl Filter for Flood { ...@@ -96,7 +91,7 @@ impl Filter for Flood {
} }
#[inline] #[inline]
fn is_affected_by_color_interpolation_filters() -> bool { fn is_affected_by_color_interpolation_filters(&self) -> bool {
false false
} }
} }
...@@ -9,7 +9,7 @@ use attributes::Attribute; ...@@ -9,7 +9,7 @@ use attributes::Attribute;
use drawing_ctx::DrawingCtx; use drawing_ctx::DrawingCtx;
use error::NodeError; use error::NodeError;
use handle::RsvgHandle; use handle::RsvgHandle;
use node::{NodeResult, NodeTrait, RsvgCNodeImpl, RsvgNode}; use node::{NodeResult, NodeTrait, RsvgNode};
use parsers; use parsers;
use property_bag::PropertyBag; use property_bag::PropertyBag;
use surface_utils::{shared_surface::SharedImageSurface, EdgeMode}; use surface_utils::{shared_surface::SharedImageSurface, EdgeMode};
...@@ -67,11 +67,6 @@ impl NodeTrait for GaussianBlur { ...@@ -67,11 +67,6 @@ impl NodeTrait for GaussianBlur {
Ok(()) Ok(())
} }
#[inline]
fn get_c_impl(&self) -> *const RsvgCNodeImpl {
self.base.get_c_impl()
}
} }
/// Computes a gaussian kernel line for the given standard deviation. /// Computes a gaussian kernel line for the given standard deviation.
...@@ -306,7 +301,7 @@ impl Filter for GaussianBlur { ...@@ -306,7 +301,7 @@ impl Filter for GaussianBlur {
} }
#[inline] #[inline]
fn is_affected_by_color_interpolation_filters() -> bool { fn is_affected_by_color_interpolation_filters(&self) -> bool {
true true
} }
} }
...@@ -12,7 +12,7 @@ use aspect_ratio::AspectRatio; ...@@ -12,7 +12,7 @@ use aspect_ratio::AspectRatio;
use attributes::Attribute; use attributes::Attribute;
use drawing_ctx::DrawingCtx; use drawing_ctx::DrawingCtx;
use handle::RsvgHandle; use handle::RsvgHandle;
use node::{CascadedValues, NodeResult, NodeTrait, RsvgCNodeImpl, RsvgNode}; use node::{CascadedValues, NodeResult, NodeTrait, RsvgNode};
use parsers::parse; use parsers::parse;
use property_bag::PropertyBag; use property_bag::PropertyBag;
use surface_utils::shared_surface::SharedImageSurface; use surface_utils::shared_surface::SharedImageSurface;
...@@ -213,11 +213,6 @@ impl NodeTrait for Image { ...@@ -213,11 +213,6 @@ impl NodeTrait for Image {
Ok(()) Ok(())
} }
#[inline]
fn get_c_impl(&self) -> *const RsvgCNodeImpl {
self.base.get_c_impl()
}
} }
impl Filter for Image { impl Filter for Image {
...@@ -252,7 +247,7 @@ impl Filter for Image { ...@@ -252,7 +247,7 @@ impl Filter for Image {
} }
#[inline] #[inline]
fn is_affected_by_color_interpolation_filters() -> bool { fn is_affected_by_color_interpolation_filters(&self) -> bool {
false false
} }
} }
...@@ -14,7 +14,7 @@ use filters::{ ...@@ -14,7 +14,7 @@ use filters::{
PrimitiveWithInput, PrimitiveWithInput,
}; };
use handle::RsvgHandle; use handle::RsvgHandle;
use node::{NodeResult, NodeTrait, NodeType, RsvgCNodeImpl, RsvgNode}; use node::{NodeResult, NodeTrait, NodeType, RsvgNode};
use parsers; use parsers;
use property_bag::PropertyBag; use property_bag::PropertyBag;
use surface_utils::{ use surface_utils::{
...@@ -94,11 +94,6 @@ impl NodeTrait for DiffuseLighting { ...@@ -94,11 +94,6 @@ impl NodeTrait for DiffuseLighting {
Ok(()) Ok(())
} }
#[inline]
fn get_c_impl(&self) -> *const RsvgCNodeImpl {
self.base.get_c_impl()
}
} }
impl Filter for DiffuseLighting { impl Filter for DiffuseLighting {
...@@ -224,7 +219,7 @@ impl Filter for DiffuseLighting { ...@@ -224,7 +219,7 @@ impl Filter for DiffuseLighting {
} }
#[inline] #[inline]
fn is_affected_by_color_interpolation_filters() -> bool { fn is_affected_by_color_interpolation_filters(&self) -> bool {
true true
} }
} }
...@@ -15,7 +15,7 @@ use filters::{ ...@@ -15,7 +15,7 @@ use filters::{
PrimitiveWithInput, PrimitiveWithInput,
}; };
use handle::RsvgHandle; use handle::RsvgHandle;
use node::{NodeResult, NodeTrait, NodeType, RsvgCNodeImpl, RsvgNode}; use node::{NodeResult, NodeTrait, NodeType, RsvgNode};
use parsers; use parsers;
use property_bag::PropertyBag; use property_bag::PropertyBag;
use surface_utils::{ use surface_utils::{
...@@ -111,11 +111,6 @@ impl NodeTrait for SpecularLighting { ...@@ -111,11 +111,6 @@ impl NodeTrait for SpecularLighting {
Ok(()) Ok(())
} }
#[inline]
fn get_c_impl(&self) -> *const RsvgCNodeImpl {
self.base.get_c_impl()
}
} }
impl Filter for SpecularLighting { impl Filter for SpecularLighting {
...@@ -246,7 +241,7 @@ impl Filter for SpecularLighting { ...@@ -246,7 +241,7 @@ impl Filter for SpecularLighting {
} }
#[inline] #[inline]
fn is_affected_by_color_interpolation_filters() -> bool { fn is_affected_by_color_interpolation_filters(&self) -> bool {
true true
} }
} }
...@@ -5,7 +5,7 @@ use cairo::{self, ImageSurface}; ...@@ -5,7 +5,7 @@ use cairo::{self, ImageSurface};
use attributes::Attribute; use attributes::Attribute;
use drawing_ctx::DrawingCtx; use drawing_ctx::DrawingCtx;
use handle::RsvgHandle;