Commit 7669a121 authored by Ivan Molodetskikh's avatar Ivan Molodetskikh

Remove extra FilterContext::compute_bounds() arg

parent a9f76253
......@@ -12,7 +12,6 @@ use coord_units::CoordUnits;
use drawing_ctx::{self, RsvgDrawingCtx};
use length::RsvgLength;
use node::RsvgNode;
use state::ComputedValues;
use super::input::Input;
use super::node::NodeFilter;
......@@ -86,9 +85,6 @@ impl FilterContext {
draw_ctx: *mut RsvgDrawingCtx,
channelmap: [i32; 4],
) -> Self {
let cascaded = filter_node.get_cascaded_values();
let values = cascaded.get();
let cr_affine = drawing_ctx::get_cairo_context(draw_ctx).get_matrix();
let bbox = drawing_ctx::get_bbox(draw_ctx);
let bbox_rect = bbox.rect.unwrap();
......@@ -138,7 +134,7 @@ impl FilterContext {
let last_result = FilterOutput {
surface: rv.source_surface.clone(),
bounds: rv.compute_bounds(&values, None, None, None, None),
bounds: rv.compute_bounds(None, None, None, None),
};
rv.last_result = Some(last_result);
......@@ -209,12 +205,14 @@ impl FilterContext {
/// Computes and returns the filter primitive bounds.
pub fn compute_bounds(
&self,
values: &ComputedValues,
x: Option<RsvgLength>,
y: Option<RsvgLength>,
width: Option<RsvgLength>,
height: Option<RsvgLength>,
) -> IRect {
let cascaded = self.node.get_cascaded_values();
let values = cascaded.get();
let filter = self.node.get_impl::<NodeFilter>().unwrap();
let mut bbox = BoundingBox::new(&cairo::Matrix::identity());
......@@ -403,9 +401,6 @@ pub unsafe extern "C" fn rsvg_filter_context_get_lastresult(
let ctx = &*ctx;
let cascaded = ctx.node.get_cascaded_values();
let values = cascaded.get();
match ctx.last_result {
Some(FilterOutput {
ref surface,
......@@ -416,7 +411,7 @@ pub unsafe extern "C" fn rsvg_filter_context_get_lastresult(
},
None => RsvgFilterPrimitiveOutput {
surface: ctx.source_surface.to_glib_none().0,
bounds: ctx.compute_bounds(&values, None, None, None, None),
bounds: ctx.compute_bounds(None, None, None, None),
},
}
}
......@@ -481,8 +476,6 @@ pub unsafe extern "C" fn rsvg_filter_primitive_get_bounds(
assert!(!ctx.is_null());
let ctx = &*ctx;
let cascaded = ctx.node.get_cascaded_values();
let values = cascaded.get();
let mut x = None;
let mut y = None;
......@@ -507,5 +500,5 @@ pub unsafe extern "C" fn rsvg_filter_primitive_get_bounds(
};
}
ctx.compute_bounds(&values, x, y, width, height)
ctx.compute_bounds(x, y, width, height)
}
......@@ -82,12 +82,7 @@ impl Primitive {
/// Computes and returns the filter primitive bounds.
#[inline]
fn get_bounds(&self, ctx: &FilterContext) -> IRect {
let node = ctx.get_filter_node();
let cascaded = node.get_cascaded_values();
let values = cascaded.get();
ctx.compute_bounds(
&values,
self.x.get(),
self.y.get(),
self.width.get(),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment