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 "core/animation/animatable/AnimatableDoubleAndBool.h" | 5 #include "core/animation/animatable/AnimatableDoubleAndBool.h" |
6 | 6 |
7 #include "platform/animation/AnimationUtilities.h" | |
8 | 7 |
9 namespace blink { | 8 namespace blink { |
10 | 9 |
11 bool AnimatableDoubleAndBool::usesDefaultInterpolationWith( | |
12 const AnimatableValue* value) const { | |
13 const AnimatableDoubleAndBool* other = toAnimatableDoubleAndBool(value); | |
14 return flag() != other->flag(); | |
15 } | |
16 | |
17 PassRefPtr<AnimatableValue> AnimatableDoubleAndBool::interpolateTo( | |
18 const AnimatableValue* value, | |
19 double fraction) const { | |
20 const AnimatableDoubleAndBool* other = toAnimatableDoubleAndBool(value); | |
21 if (flag() == other->flag()) | |
22 return AnimatableDoubleAndBool::create( | |
23 blend(m_number, other->m_number, fraction), flag()); | |
24 | |
25 return defaultInterpolateTo(this, value, fraction); | |
26 } | |
27 | |
28 bool AnimatableDoubleAndBool::equalTo(const AnimatableValue* value) const { | 10 bool AnimatableDoubleAndBool::equalTo(const AnimatableValue* value) const { |
29 const AnimatableDoubleAndBool* other = toAnimatableDoubleAndBool(value); | 11 const AnimatableDoubleAndBool* other = toAnimatableDoubleAndBool(value); |
30 return toDouble() == other->toDouble() && flag() == other->flag(); | 12 return m_number == other->m_number && m_flag == other->m_flag; |
31 } | 13 } |
32 | 14 |
33 } // namespace blink | 15 } // namespace blink |
OLD | NEW |