| OLD | NEW |
| 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 SampledEffect_h | 5 #ifndef SampledEffect_h |
| 6 #define SampledEffect_h | 6 #define SampledEffect_h |
| 7 | 7 |
| 8 #include "core/animation/Animation.h" | 8 #include "core/animation/Animation.h" |
| 9 #include "core/animation/Interpolation.h" | 9 #include "core/animation/Interpolation.h" |
| 10 #include "core/animation/KeyframeEffect.h" | 10 #include "core/animation/KeyframeEffect.h" |
| 11 #include "core/animation/KeyframeEffectReadOnly.h" |
| 11 #include "wtf/Allocator.h" | 12 #include "wtf/Allocator.h" |
| 12 #include "wtf/Vector.h" | 13 #include "wtf/Vector.h" |
| 13 | 14 |
| 14 namespace blink { | 15 namespace blink { |
| 15 | 16 |
| 16 class SVGElement; | 17 class SVGElement; |
| 17 | 18 |
| 18 // Associates the results of sampling an EffectModel with metadata used for effe
ct ordering and managing composited animations. | 19 // Associates the results of sampling an EffectModel with metadata used for effe
ct ordering and managing composited animations. |
| 19 class SampledEffect : public GarbageCollectedFinalized<SampledEffect> { | 20 class SampledEffect : public GarbageCollectedFinalized<SampledEffect> { |
| 20 WTF_MAKE_NONCOPYABLE(SampledEffect); | 21 WTF_MAKE_NONCOPYABLE(SampledEffect); |
| 21 public: | 22 public: |
| 22 static SampledEffect* create(KeyframeEffect* animation) | 23 static SampledEffect* create(KeyframeEffect* animation) |
| 23 { | 24 { |
| 24 return new SampledEffect(animation); | 25 return new SampledEffect(animation); |
| 25 } | 26 } |
| 26 | 27 |
| 27 void clear(); | 28 void clear(); |
| 28 | 29 |
| 29 const Vector<RefPtr<Interpolation>>& interpolations() const { return m_inter
polations; } | 30 const Vector<RefPtr<Interpolation>>& interpolations() const { return m_inter
polations; } |
| 30 Vector<RefPtr<Interpolation>>& mutableInterpolations() { return m_interpolat
ions; } | 31 Vector<RefPtr<Interpolation>>& mutableInterpolations() { return m_interpolat
ions; } |
| 31 | 32 |
| 32 KeyframeEffect* effect() const { return m_effect; } | 33 KeyframeEffect* effect() const { return m_effect; } |
| 33 unsigned sequenceNumber() const { return m_sequenceNumber; } | 34 unsigned sequenceNumber() const { return m_sequenceNumber; } |
| 34 KeyframeEffect::Priority priority() const { return m_priority; } | 35 KeyframeEffectReadOnly::Priority priority() const { return m_priority; } |
| 35 bool willNeverChange() const; | 36 bool willNeverChange() const; |
| 36 void removeReplacedInterpolations(const HashSet<PropertyHandle>&); | 37 void removeReplacedInterpolations(const HashSet<PropertyHandle>&); |
| 37 void updateReplacedProperties(HashSet<PropertyHandle>&); | 38 void updateReplacedProperties(HashSet<PropertyHandle>&); |
| 38 | 39 |
| 39 DECLARE_TRACE(); | 40 DECLARE_TRACE(); |
| 40 | 41 |
| 41 private: | 42 private: |
| 42 SampledEffect(KeyframeEffect*); | 43 SampledEffect(KeyframeEffect*); |
| 43 | 44 |
| 44 WeakMember<KeyframeEffect> m_effect; | 45 WeakMember<KeyframeEffect> m_effect; |
| 45 Vector<RefPtr<Interpolation>> m_interpolations; | 46 Vector<RefPtr<Interpolation>> m_interpolations; |
| 46 const unsigned m_sequenceNumber; | 47 const unsigned m_sequenceNumber; |
| 47 KeyframeEffect::Priority m_priority; | 48 KeyframeEffectReadOnly::Priority m_priority; |
| 48 }; | 49 }; |
| 49 | 50 |
| 50 } // namespace blink | 51 } // namespace blink |
| 51 | 52 |
| 52 #endif // SampledEffect_h | 53 #endif // SampledEffect_h |
| OLD | NEW |