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

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

Issue 251463003: Web Animations API: Sort keyframes by offset (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: move Keyframe::compareOffsets out of KeyframeEffectModel.cpp Created 6 years, 7 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 "CSSPropertyNames.h" 8 #include "CSSPropertyNames.h"
9 #include "core/animation/AnimatableValue.h" 9 #include "core/animation/AnimatableValue.h"
10 #include "core/animation/AnimationEffect.h" 10 #include "core/animation/AnimationEffect.h"
(...skipping 12 matching lines...) Expand all
23 23
24 void setOffset(double offset) { m_offset = offset; } 24 void setOffset(double offset) { m_offset = offset; }
25 double offset() const { return m_offset; } 25 double offset() const { return m_offset; }
26 26
27 void setComposite(AnimationEffect::CompositeOperation composite) { m_composi te = composite; } 27 void setComposite(AnimationEffect::CompositeOperation composite) { m_composi te = composite; }
28 AnimationEffect::CompositeOperation composite() const { return m_composite; } 28 AnimationEffect::CompositeOperation composite() const { return m_composite; }
29 29
30 void setEasing(PassRefPtr<TimingFunction> easing) { m_easing = easing; } 30 void setEasing(PassRefPtr<TimingFunction> easing) { m_easing = easing; }
31 TimingFunction* easing() const { return m_easing.get(); } 31 TimingFunction* easing() const { return m_easing.get(); }
32 32
33 static bool compareOffsets(const RefPtrWillBeMember<Keyframe>&, const RefPtr WillBeMember<Keyframe>&); 33 static bool compareOffsets(const RefPtrWillBeMember<Keyframe>& a, const RefP trWillBeMember<Keyframe>& b)
34 {
35 return a->offset() < b->offset();
36 }
37
34 virtual PropertySet properties() const = 0; 38 virtual PropertySet properties() const = 0;
35 39
36 virtual PassRefPtrWillBeRawPtr<Keyframe> clone() const = 0; 40 virtual PassRefPtrWillBeRawPtr<Keyframe> clone() const = 0;
37 PassRefPtrWillBeRawPtr<Keyframe> cloneWithOffset(double offset) const 41 PassRefPtrWillBeRawPtr<Keyframe> cloneWithOffset(double offset) const
38 { 42 {
39 RefPtrWillBeRawPtr<Keyframe> theClone = clone(); 43 RefPtrWillBeRawPtr<Keyframe> theClone = clone();
40 theClone->setOffset(offset); 44 theClone->setOffset(offset);
41 return theClone.release(); 45 return theClone.release();
42 } 46 }
43 47
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 } 93 }
90 94
91 double m_offset; 95 double m_offset;
92 AnimationEffect::CompositeOperation m_composite; 96 AnimationEffect::CompositeOperation m_composite;
93 RefPtr<TimingFunction> m_easing; 97 RefPtr<TimingFunction> m_easing;
94 }; 98 };
95 99
96 } 100 }
97 101
98 #endif 102 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698