OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "config.h" | 5 #include "config.h" |
6 #include "core/animation/animatable/AnimatableDoubleAndBool.h" | 6 #include "core/animation/animatable/AnimatableDoubleAndBool.h" |
7 | 7 |
8 #include "platform/animation/AnimationUtilities.h" | 8 #include "platform/animation/AnimationUtilities.h" |
9 | 9 |
10 namespace blink { | 10 namespace blink { |
11 | 11 |
12 bool AnimatableDoubleAndBool::usesDefaultInterpolationWith(const AnimatableValue
* value) const | 12 bool AnimatableDoubleAndBool::usesDefaultInterpolationWith(const AnimatableValue
* value) const |
13 { | 13 { |
14 const AnimatableDoubleAndBool* other = toAnimatableDoubleAndBool(value); | 14 const AnimatableDoubleAndBool* other = toAnimatableDoubleAndBool(value); |
15 return flag() != other->flag(); | 15 return flag() != other->flag(); |
16 } | 16 } |
17 | 17 |
18 PassRefPtrWillBeRawPtr<AnimatableValue> AnimatableDoubleAndBool::interpolateTo(c
onst AnimatableValue* value, double fraction) const | 18 PassRefPtr<AnimatableValue> AnimatableDoubleAndBool::interpolateTo(const Animata
bleValue* value, double fraction) const |
19 { | 19 { |
20 const AnimatableDoubleAndBool* other = toAnimatableDoubleAndBool(value); | 20 const AnimatableDoubleAndBool* other = toAnimatableDoubleAndBool(value); |
21 if (flag() == other->flag()) | 21 if (flag() == other->flag()) |
22 return AnimatableDoubleAndBool::create(blend(m_number, other->m_number,
fraction), flag()); | 22 return AnimatableDoubleAndBool::create(blend(m_number, other->m_number,
fraction), flag()); |
23 | 23 |
24 return defaultInterpolateTo(this, value, fraction); | 24 return defaultInterpolateTo(this, value, fraction); |
25 } | 25 } |
26 | 26 |
27 bool AnimatableDoubleAndBool::equalTo(const AnimatableValue* value) const | 27 bool AnimatableDoubleAndBool::equalTo(const AnimatableValue* value) const |
28 { | 28 { |
29 const AnimatableDoubleAndBool* other = toAnimatableDoubleAndBool(value); | 29 const AnimatableDoubleAndBool* other = toAnimatableDoubleAndBool(value); |
30 return toDouble() == other->toDouble() && flag() == other->flag(); | 30 return toDouble() == other->toDouble() && flag() == other->flag(); |
31 } | 31 } |
32 | 32 |
33 } | 33 } |
OLD | NEW |