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

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

Issue 1302463002: Make classes and structures in Source/core/animation fast-allocated. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 4 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 #ifndef Keyframe_h 5 #ifndef Keyframe_h
6 #define Keyframe_h 6 #define Keyframe_h
7 7
8 #include "core/CoreExport.h" 8 #include "core/CoreExport.h"
9 #include "core/animation/AnimationEffect.h" 9 #include "core/animation/AnimationEffect.h"
10 #include "core/animation/EffectModel.h" 10 #include "core/animation/EffectModel.h"
11 #include "core/animation/PropertyHandle.h" 11 #include "core/animation/PropertyHandle.h"
12 #include "core/animation/animatable/AnimatableValue.h" 12 #include "core/animation/animatable/AnimatableValue.h"
13 #include "wtf/Allocator.h"
13 14
14 namespace blink { 15 namespace blink {
15 16
16 using PropertyHandleSet = HashSet<PropertyHandle>; 17 using PropertyHandleSet = HashSet<PropertyHandle>;
17 18
18 class Element; 19 class Element;
19 class ComputedStyle; 20 class ComputedStyle;
20 21
21 // FIXME: Make Keyframe immutable 22 // FIXME: Make Keyframe immutable
22 class CORE_EXPORT Keyframe : public RefCountedWillBeGarbageCollectedFinalized<Ke yframe> { 23 class CORE_EXPORT Keyframe : public RefCountedWillBeGarbageCollectedFinalized<Ke yframe> {
24 WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED(Keyframe);
25 WTF_MAKE_NONCOPYABLE(Keyframe);
23 public: 26 public:
24 virtual ~Keyframe() { } 27 virtual ~Keyframe() { }
25 28
26 void setOffset(double offset) { m_offset = offset; } 29 void setOffset(double offset) { m_offset = offset; }
27 double offset() const { return m_offset; } 30 double offset() const { return m_offset; }
28 31
29 void setComposite(EffectModel::CompositeOperation composite) { m_composite = composite; } 32 void setComposite(EffectModel::CompositeOperation composite) { m_composite = composite; }
30 EffectModel::CompositeOperation composite() const { return m_composite; } 33 EffectModel::CompositeOperation composite() const { return m_composite; }
31 34
32 void setEasing(PassRefPtr<TimingFunction> easing) { m_easing = easing; } 35 void setEasing(PassRefPtr<TimingFunction> easing) { m_easing = easing; }
(...skipping 13 matching lines...) Expand all
46 theClone->setOffset(offset); 49 theClone->setOffset(offset);
47 return theClone.release(); 50 return theClone.release();
48 } 51 }
49 52
50 virtual bool isAnimatableValueKeyframe() const { return false; } 53 virtual bool isAnimatableValueKeyframe() const { return false; }
51 virtual bool isStringKeyframe() const { return false; } 54 virtual bool isStringKeyframe() const { return false; }
52 55
53 DEFINE_INLINE_VIRTUAL_TRACE() { } 56 DEFINE_INLINE_VIRTUAL_TRACE() { }
54 57
55 class PropertySpecificKeyframe : public NoBaseWillBeGarbageCollectedFinalize d<PropertySpecificKeyframe> { 58 class PropertySpecificKeyframe : public NoBaseWillBeGarbageCollectedFinalize d<PropertySpecificKeyframe> {
59 WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED(PropertySpecificKeyframe);
60 WTF_MAKE_NONCOPYABLE(PropertySpecificKeyframe);
56 public: 61 public:
57 virtual ~PropertySpecificKeyframe() { } 62 virtual ~PropertySpecificKeyframe() { }
58 double offset() const { return m_offset; } 63 double offset() const { return m_offset; }
59 TimingFunction& easing() const { return *m_easing; } 64 TimingFunction& easing() const { return *m_easing; }
60 EffectModel::CompositeOperation composite() const { return m_composite; } 65 EffectModel::CompositeOperation composite() const { return m_composite; }
61 double underlyingFraction() const { return m_composite == EffectModel::C ompositeReplace ? 0 : 1; } 66 double underlyingFraction() const { return m_composite == EffectModel::C ompositeReplace ? 0 : 1; }
62 virtual bool isNeutral() const { ASSERT_NOT_REACHED(); return false; } 67 virtual bool isNeutral() const { ASSERT_NOT_REACHED(); return false; }
63 virtual PassOwnPtrWillBeRawPtr<PropertySpecificKeyframe> cloneWithOffset (double offset) const = 0; 68 virtual PassOwnPtrWillBeRawPtr<PropertySpecificKeyframe> cloneWithOffset (double offset) const = 0;
64 69
65 // FIXME: Remove this once CompositorAnimations no longer depends on Ani matableValues 70 // FIXME: Remove this once CompositorAnimations no longer depends on Ani matableValues
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 } 105 }
101 106
102 double m_offset; 107 double m_offset;
103 EffectModel::CompositeOperation m_composite; 108 EffectModel::CompositeOperation m_composite;
104 RefPtr<TimingFunction> m_easing; 109 RefPtr<TimingFunction> m_easing;
105 }; 110 };
106 111
107 } // namespace blink 112 } // namespace blink
108 113
109 #endif // Keyframe_h 114 #endif // Keyframe_h
OLDNEW
« no previous file with comments | « Source/core/animation/InterpolationType.h ('k') | Source/core/animation/LengthPropertyFunctions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698