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

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

Issue 1196023003: Web Animations: Avoid iteration when checking for outdated animations on timeline (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/animation/Animation.cpp ('k') | Source/core/animation/AnimationTimeline.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 double currentTime(bool& isNull); 86 double currentTime(bool& isNull);
87 double currentTime(); 87 double currentTime();
88 double currentTimeInternal(bool& isNull); 88 double currentTimeInternal(bool& isNull);
89 double currentTimeInternal(); 89 double currentTimeInternal();
90 void setCurrentTime(double); 90 void setCurrentTime(double);
91 void setCurrentTimeInternal(double); 91 void setCurrentTimeInternal(double);
92 double effectiveTime(); 92 double effectiveTime();
93 void pauseAnimationsForTesting(double); 93 void pauseAnimationsForTesting(double);
94 94
95 void setOutdatedAnimation(Animation*); 95 void setOutdatedAnimation(Animation*);
96 bool hasOutdatedAnimation() const; 96 void clearOutdatedAnimation(Animation*);
97 bool hasOutdatedAnimation() const { return m_outdatedAnimationCount > 0; }
97 bool needsAnimationTimingUpdate(); 98 bool needsAnimationTimingUpdate();
98 99
99 void setPlaybackRate(double); 100 void setPlaybackRate(double);
100 double playbackRate() const; 101 double playbackRate() const;
101 102
102 WebCompositorAnimationTimeline* compositorTimeline() const { return m_compos itorTimeline.get(); } 103 WebCompositorAnimationTimeline* compositorTimeline() const { return m_compos itorTimeline.get(); }
103 104
104 Document* document() { return m_document.get(); } 105 Document* document() { return m_document.get(); }
105 #if !ENABLE(OILPAN) 106 #if !ENABLE(OILPAN)
106 void detachFromDocument(); 107 void detachFromDocument();
107 #endif 108 #endif
108 void wake(); 109 void wake();
109 110
110 DECLARE_TRACE(); 111 DECLARE_TRACE();
111 112
112 protected: 113 protected:
113 AnimationTimeline(Document*, PassOwnPtrWillBeRawPtr<PlatformTiming>); 114 AnimationTimeline(Document*, PassOwnPtrWillBeRawPtr<PlatformTiming>);
114 115
115 private: 116 private:
116 RawPtrWillBeMember<Document> m_document; 117 RawPtrWillBeMember<Document> m_document;
117 double m_zeroTime; 118 double m_zeroTime;
118 bool m_zeroTimeInitialized; 119 bool m_zeroTimeInitialized;
120 unsigned m_outdatedAnimationCount;
119 // Animations which will be updated on the next frame 121 // Animations which will be updated on the next frame
120 // i.e. current, in effect, or had timing changed 122 // i.e. current, in effect, or had timing changed
121 WillBeHeapHashSet<RefPtrWillBeMember<Animation>> m_animationsNeedingUpdate; 123 WillBeHeapHashSet<RefPtrWillBeMember<Animation>> m_animationsNeedingUpdate;
122 WillBeHeapHashSet<RawPtrWillBeWeakMember<Animation>> m_animations; 124 WillBeHeapHashSet<RawPtrWillBeWeakMember<Animation>> m_animations;
123 125
124 double m_playbackRate; 126 double m_playbackRate;
125 127
126 friend class SMILTimeContainer; 128 friend class SMILTimeContainer;
127 static const double s_minimumDelay; 129 static const double s_minimumDelay;
128 130
(...skipping 23 matching lines...) Expand all
152 RawPtrWillBeMember<AnimationTimeline> m_timeline; 154 RawPtrWillBeMember<AnimationTimeline> m_timeline;
153 Timer<AnimationTimelineTiming> m_timer; 155 Timer<AnimationTimelineTiming> m_timer;
154 }; 156 };
155 157
156 friend class AnimationAnimationTimelineTest; 158 friend class AnimationAnimationTimelineTest;
157 }; 159 };
158 160
159 } // namespace blink 161 } // namespace blink
160 162
161 #endif 163 #endif
OLDNEW
« no previous file with comments | « Source/core/animation/Animation.cpp ('k') | Source/core/animation/AnimationTimeline.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698