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

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

Issue 851693007: Prepare for responsive CSS animations. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Compositor restarts after style change Created 5 years, 11 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 InterpolationEffect_h 5 #ifndef InterpolationEffect_h
6 #define InterpolationEffect_h 6 #define InterpolationEffect_h
7 7
8 #include "core/animation/DeferredLegacyStyleInterpolation.h"
8 #include "core/animation/Interpolation.h" 9 #include "core/animation/Interpolation.h"
9 #include "core/animation/Keyframe.h" 10 #include "core/animation/Keyframe.h"
11 #include "core/animation/StyleInterpolation.h"
10 #include "platform/RuntimeEnabledFeatures.h" 12 #include "platform/RuntimeEnabledFeatures.h"
11 #include "platform/animation/TimingFunction.h" 13 #include "platform/animation/TimingFunction.h"
12 #include "wtf/PassOwnPtr.h" 14 #include "wtf/PassOwnPtr.h"
13 #include "wtf/RefCounted.h" 15 #include "wtf/RefCounted.h"
14 16
15 namespace blink { 17 namespace blink {
16 18
17 class InterpolationEffect : public RefCountedWillBeGarbageCollected<Interpolatio nEffect> { 19 class InterpolationEffect : public RefCountedWillBeGarbageCollected<Interpolatio nEffect> {
18 public: 20 public:
19 static PassRefPtrWillBeRawPtr<InterpolationEffect> create() 21 static PassRefPtrWillBeRawPtr<InterpolationEffect> create()
20 { 22 {
21 return adoptRefWillBeNoop(new InterpolationEffect()); 23 return adoptRefWillBeNoop(new InterpolationEffect());
22 } 24 }
23 25
24 void getActiveInterpolations(double fraction, double iterationDuration, OwnP trWillBeRawPtr<WillBeHeapVector<RefPtrWillBeMember<Interpolation>>>&) const; 26 void getActiveInterpolations(double fraction, double iterationDuration, OwnP trWillBeRawPtr<WillBeHeapVector<RefPtrWillBeMember<Interpolation>>>&) const;
25 27
26 void addInterpolation(PassRefPtrWillBeRawPtr<Interpolation> interpolation, P assRefPtr<TimingFunction> easing, double start, double end, double applyFrom, do uble applyTo) 28 void addInterpolation(PassRefPtrWillBeRawPtr<Interpolation> interpolation, P assRefPtr<TimingFunction> easing, double start, double end, double applyFrom, do uble applyTo)
27 { 29 {
28 m_interpolations.append(InterpolationRecord::create(interpolation, easin g, start, end, applyFrom, applyTo)); 30 m_interpolations.append(InterpolationRecord::create(interpolation, easin g, start, end, applyFrom, applyTo));
29 } 31 }
30 32
31 void addInterpolationsFromKeyframes(CSSPropertyID, Element*, Keyframe::Prope rtySpecificKeyframe& keyframeA, Keyframe::PropertySpecificKeyframe& keyframeB, d ouble applyFrom, double applyTo); 33 void addInterpolationsFromKeyframes(CSSPropertyID, Element*, Keyframe::Prope rtySpecificKeyframe& keyframeA, Keyframe::PropertySpecificKeyframe& keyframeB, d ouble applyFrom, double applyTo);
32 34
35 void setDeferredInterpolationsOutdated()
36 {
37 for (auto& record : m_interpolations) {
38 if (record->m_interpolation->isStyleInterpolation() && toStyleInterp olation(record->m_interpolation.get())->isDeferredLegacyStyleInterpolation())
39 toDeferredLegacyStyleInterpolation(toStyleInterpolation(record-> m_interpolation.get()))->setOutdated();
40 }
41 }
42
33 void trace(Visitor*); 43 void trace(Visitor*);
34 44
35 private: 45 private:
36 InterpolationEffect() 46 InterpolationEffect()
37 { 47 {
38 } 48 }
39 49
40 class InterpolationRecord : public NoBaseWillBeGarbageCollectedFinalized<Int erpolationRecord> { 50 class InterpolationRecord : public NoBaseWillBeGarbageCollectedFinalized<Int erpolationRecord> {
41 public: 51 public:
42 RefPtrWillBeMember<Interpolation> m_interpolation; 52 RefPtrWillBeMember<Interpolation> m_interpolation;
(...skipping 21 matching lines...) Expand all
64 { 74 {
65 } 75 }
66 }; 76 };
67 77
68 WillBeHeapVector<OwnPtrWillBeMember<InterpolationRecord> > m_interpolations; 78 WillBeHeapVector<OwnPtrWillBeMember<InterpolationRecord> > m_interpolations;
69 }; 79 };
70 80
71 } // namespace blink 81 } // namespace blink
72 82
73 #endif // InterpolationEffect_h 83 #endif // InterpolationEffect_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698