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 THIRD_PARTY_BLINK_RENDERER_CORE_ANIMATION_SAMPLED_EFFECT_H_ 6 #define THIRD_PARTY_BLINK_RENDERER_CORE_ANIMATION_SAMPLED_EFFECT_H_ 7 8 #include "base/macros.h" 9 #include "third_party/blink/renderer/core/animation/animation.h" 10 #include "third_party/blink/renderer/core/animation/interpolation.h" 11 #include "third_party/blink/renderer/core/animation/keyframe_effect.h" 12 #include "third_party/blink/renderer/platform/wtf/allocator/allocator.h" 13 #include "third_party/blink/renderer/platform/wtf/vector.h" 14 15 namespace blink { 16 17 // Associates the results of sampling an EffectModel with metadata used for 18 // effect ordering and managing composited animations. 19 class SampledEffect final : public GarbageCollected<SampledEffect> { 20 public: 21 SampledEffect(KeyframeEffect*, unsigned sequence_number); 22 23 void Clear(); 24 Interpolations()25 const HeapVector<Member<Interpolation>>& Interpolations() const { 26 return interpolations_; 27 } MutableInterpolations()28 HeapVector<Member<Interpolation>>& MutableInterpolations() { 29 return interpolations_; 30 } 31 Effect()32 KeyframeEffect* Effect() const { return effect_; } SequenceNumber()33 unsigned SequenceNumber() const { return sequence_number_; } GetPriority()34 KeyframeEffect::Priority GetPriority() const { return priority_; } 35 bool WillNeverChange() const; 36 void RemoveReplacedInterpolations(const HashSet<PropertyHandle>&); 37 void UpdateReplacedProperties(HashSet<PropertyHandle>&); 38 39 void Trace(Visitor*) const; 40 41 private: 42 WeakMember<KeyframeEffect> effect_; 43 HeapVector<Member<Interpolation>> interpolations_; 44 const unsigned sequence_number_; 45 KeyframeEffect::Priority priority_; 46 DISALLOW_COPY_AND_ASSIGN(SampledEffect); 47 }; 48 49 } // namespace blink 50 51 #endif // THIRD_PARTY_BLINK_RENDERER_CORE_ANIMATION_SAMPLED_EFFECT_H_ 52