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

Side by Side Diff: Source/core/animation/AnimatableValue.h

Issue 204183002: Remove CompositableValue. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@opacity
Patch Set: Created 6 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
« no previous file with comments | « no previous file | Source/core/animation/AnimationEffect.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 13 matching lines...) Expand all
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */ 29 */
30 30
31 #ifndef AnimatableValue_h 31 #ifndef AnimatableValue_h
32 #define AnimatableValue_h 32 #define AnimatableValue_h
33 33
34 #include "core/animation/AnimationEffect.h"
35 #include "core/css/CSSValue.h" 34 #include "core/css/CSSValue.h"
36 #include "wtf/RefCounted.h" 35 #include "wtf/RefCounted.h"
37 36
38 namespace WebCore { 37 namespace WebCore {
39 38
40 class AnimatableValue : public AnimationEffect::CompositableValue { 39 class AnimatableValue : public RefCounted<AnimatableValue> {
41 public: 40 public:
42 virtual ~AnimatableValue() { } 41 virtual ~AnimatableValue() { }
43 42
44 static const AnimatableValue* neutralValue(); 43 static const AnimatableValue* neutralValue();
45 44
46 static PassRefPtr<AnimatableValue> interpolate(const AnimatableValue*, const AnimatableValue*, double fraction); 45 static PassRefPtr<AnimatableValue> interpolate(const AnimatableValue*, const AnimatableValue*, double fraction);
47 // For noncommutative values read add(A, B) to mean the value A with B compo sed onto it. 46 // For noncommutative values read add(A, B) to mean the value A with B compo sed onto it.
48 static PassRefPtr<AnimatableValue> add(const AnimatableValue*, const Animata bleValue*); 47 static PassRefPtr<AnimatableValue> add(const AnimatableValue*, const Animata bleValue*);
49 static double distance(const AnimatableValue* from, const AnimatableValue* t o); 48 static double distance(const AnimatableValue* from, const AnimatableValue* t o);
50 static bool usesDefaultInterpolation(const AnimatableValue* from, const Anim atableValue* to) 49 static bool usesDefaultInterpolation(const AnimatableValue* from, const Anim atableValue* to)
51 { 50 {
52 return !from->isSameType(to) || from->usesDefaultInterpolationWith(to); 51 return !from->isSameType(to) || from->usesDefaultInterpolationWith(to);
53 } 52 }
54 53
55 bool equals(const AnimatableValue* value) const 54 bool equals(const AnimatableValue* value) const
56 { 55 {
57 return isSameType(value) && equalTo(value); 56 return isSameType(value) && equalTo(value);
58 } 57 }
59 bool equals(const AnimatableValue& value) const 58 bool equals(const AnimatableValue& value) const
60 { 59 {
61 return equals(&value); 60 return equals(&value);
62 } 61 }
63 62
64 virtual bool dependsOnUnderlyingValue() const OVERRIDE FINAL { return false; }
65 virtual PassRefPtr<AnimatableValue> compositeOnto(const AnimatableValue*) co nst OVERRIDE FINAL { return takeConstRef(this); }
66 virtual bool isAnimatableValue() const { return true; }
67
68 bool isClipPathOperation() const { return type() == TypeClipPathOperation; } 63 bool isClipPathOperation() const { return type() == TypeClipPathOperation; }
69 bool isColor() const { return type() == TypeColor; } 64 bool isColor() const { return type() == TypeColor; }
70 bool isDouble() const { return type() == TypeDouble; } 65 bool isDouble() const { return type() == TypeDouble; }
71 bool isFilterOperations() const { return type() == TypeFilterOperations; } 66 bool isFilterOperations() const { return type() == TypeFilterOperations; }
72 bool isImage() const { return type() == TypeImage; } 67 bool isImage() const { return type() == TypeImage; }
73 bool isLength() const { return type() == TypeLength; } 68 bool isLength() const { return type() == TypeLength; }
74 bool isLengthBox() const { return type() == TypeLengthBox; } 69 bool isLengthBox() const { return type() == TypeLengthBox; }
75 bool isLengthBoxAndBool() const { return type() == TypeLengthBoxAndBool; } 70 bool isLengthBoxAndBool() const { return type() == TypeLengthBoxAndBool; }
76 bool isLengthPoint() const { return type() == TypeLengthPoint; } 71 bool isLengthPoint() const { return type() == TypeLengthPoint; }
77 bool isLengthSize() const { return type() == TypeLengthSize; } 72 bool isLengthSize() const { return type() == TypeLengthSize; }
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 virtual bool equalTo(const AnimatableValue*) const = 0; 130 virtual bool equalTo(const AnimatableValue*) const = 0;
136 131
137 virtual double distanceTo(const AnimatableValue*) const; 132 virtual double distanceTo(const AnimatableValue*) const;
138 133
139 friend class KeyframeEffectModel; 134 friend class KeyframeEffectModel;
140 }; 135 };
141 136
142 #define DEFINE_ANIMATABLE_VALUE_TYPE_CASTS(thisType, predicate) \ 137 #define DEFINE_ANIMATABLE_VALUE_TYPE_CASTS(thisType, predicate) \
143 DEFINE_TYPE_CASTS(thisType, AnimatableValue, value, value->predicate, value. predicate) 138 DEFINE_TYPE_CASTS(thisType, AnimatableValue, value, value->predicate, value. predicate)
144 139
145 DEFINE_TYPE_CASTS(AnimatableValue, AnimationEffect::CompositableValue, value, va lue->isAnimatableValue(), value.isAnimatableValue());
146
147 } // namespace WebCore 140 } // namespace WebCore
148 141
149 #endif // AnimatableValue_h 142 #endif // AnimatableValue_h
OLDNEW
« no previous file with comments | « no previous file | Source/core/animation/AnimationEffect.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698