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

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

Issue 215883005: Web Animations: Introduce String based KeyframeEffectModel (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 8 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef Keyframe_h
6 #define Keyframe_h
7
8 #include "core/animation/TimedItem.h"
9
10 namespace WebCore {
11
12 typedef HashSet<CSSPropertyID> PropertySet;
13
14 class Keyframe : public RefCountedWillBeGarbageCollectedFinalized<Keyframe> {
15 public:
16 virtual ~Keyframe() { }
17 void setOffset(double offset) { m_offset = offset; }
18 double offset() const { return m_offset; }
19 void setComposite(AnimationEffect::CompositeOperation composite) { m_composi te = composite; }
20 AnimationEffect::CompositeOperation composite() const { return m_composite; }
21 void setEasing(PassRefPtr<TimingFunction> easing) { m_easing = easing; }
22 TimingFunction* easing() const { return m_easing.get(); }
23 static bool compareOffsets(const RefPtrWillBeRawPtr<Keyframe>&, const RefPtr WillBeRawPtr<Keyframe>&);
24 virtual PropertySet properties() const = 0;
25 virtual PassRefPtrWillBeRawPtr<Keyframe> clone() const = 0;
26 PassRefPtrWillBeRawPtr<Keyframe> cloneWithOffset(double offset) const
27 {
28 RefPtrWillBeRawPtr<Keyframe> theClone = clone();
29 theClone->setOffset(offset);
30 return theClone.release();
31 }
32
33 virtual bool isAnimatableValueKeyframe() const { return false; }
34 virtual bool isStringKeyframe() const { return false; }
35
36 void trace(Visitor*) { }
37
38 class PropertySpecificKeyframe : public NoBaseWillBeGarbageCollectedFinalize d<PropertySpecificKeyframe> {
39 public:
40 virtual ~PropertySpecificKeyframe() { }
41 double offset() const { return m_offset; }
42 TimingFunction* easing() const { return m_easing.get(); }
43 AnimationEffect::CompositeOperation composite() const { return m_composi te; }
44 virtual PassOwnPtr<PropertySpecificKeyframe> cloneWithOffset(double offs et) const = 0;
45
46 virtual bool isAnimatableValuePropertySpecificKeyframe() const { return false; }
47 virtual bool isStringPropertySpecificKeyframe() const { return false; }
48
49 virtual PassOwnPtr<PropertySpecificKeyframe> neutralKeyframe(double offs et, PassRefPtr<TimingFunction> easing) const = 0;
50 virtual PassRefPtr<Interpolation> createInterpolation(CSSPropertyID, Web Core::Keyframe::PropertySpecificKeyframe *end) const = 0;
51
52 protected:
53 PropertySpecificKeyframe(double offset, PassRefPtr<TimingFunction> easin g, AnimationEffect::CompositeOperation);
54
55 double m_offset;
56 RefPtr<TimingFunction> m_easing;
57 RefPtrWillBeMember<AnimatableValue> m_value;
alancutter (OOO until 2018) 2014/04/01 01:09:40 Should this member variable be here?
shans 2014/04/01 04:01:27 Nope...
58 AnimationEffect::CompositeOperation m_composite;
59 };
60
61 virtual PassOwnPtr<PropertySpecificKeyframe> createPropertySpecificKeyframe( CSSPropertyID) const = 0;
62
63
64 protected:
65 Keyframe()
66 : m_offset(nullValue())
67 , m_composite(AnimationEffect::CompositeReplace)
68 , m_easing(LinearTimingFunction::preset())
69 {
70 }
71 Keyframe(double offset, AnimationEffect::CompositeOperation composite, PassR efPtr<TimingFunction> easing)
72 : m_offset(offset)
73 , m_composite(composite)
74 , m_easing(easing)
75 {
76 }
77
78 double m_offset;
79 AnimationEffect::CompositeOperation m_composite;
80 RefPtr<TimingFunction> m_easing;
81 };
82
83 }
84
85 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698