Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(95)

Side by Side Diff: third_party/WebKit/Source/core/animation/animatable/AnimatableDoubleAndBool.cpp

Issue 2750293003: Delete unused AnimatableValue code (Closed)
Patch Set: Fix unit tests Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698