mirror of
https://github.com/servo/servo.git
synced 2025-08-10 16:05:43 +01:00
Derive ComputeSquaredDistance for animated filters
This commit is contained in:
parent
cf4f89c36e
commit
f017743a55
3 changed files with 16 additions and 20 deletions
|
@ -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(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue