Derive ComputeSquaredDistance for animated filters

This commit is contained in:
Anthony Ramine 2018-02-08 03:14:23 +01:00
parent cf4f89c36e
commit f017743a55
3 changed files with 16 additions and 20 deletions

View file

@ -2871,25 +2871,6 @@ impl ToAnimatedZero for AnimatedFilter {
}
}
// FIXME(nox): This should be derived.
impl ComputeSquaredDistance for AnimatedFilter {
fn compute_squared_distance(&self, other: &Self) -> Result<SquaredDistance, ()> {
match (self, other) {
% for func in FILTER_FUNCTIONS:
(&Filter::${func}(ref this), &Filter::${func}(ref other)) => {
this.compute_squared_distance(other)
},
% endfor
% if product == "gecko":
(&Filter::DropShadow(ref this), &Filter::DropShadow(ref other)) => {
this.compute_squared_distance(other)
},
% endif
_ => Err(()),
}
}
}
impl Animate for AnimatedFilterList {
#[inline]
fn animate(