mirror of
https://github.com/servo/servo.git
synced 2025-08-10 07:55:33 +01:00
Auto merge of #19985 - servo:derive-these-things-too, r=emilio
Derive ComputeSquaredDistance for animated filters <!-- Reviewable:start --> This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/19985) <!-- Reviewable:end -->
This commit is contained in:
commit
c22baf58d0
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