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

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

Issue 1162253005: Animations: Add the effect clipping primitive to web animations (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 | « LayoutTests/web-animations-api/player-clip.html ('k') | Source/core/animation/Animation.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 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 #endif 126 #endif
127 127
128 double calculateStartTime(double currentTime) const; 128 double calculateStartTime(double currentTime) const;
129 bool hasStartTime() const { return !isNull(m_startTime); } 129 bool hasStartTime() const { return !isNull(m_startTime); }
130 double startTime(bool& isNull) const; 130 double startTime(bool& isNull) const;
131 double startTime() const; 131 double startTime() const;
132 double startTimeInternal() const { return m_startTime; } 132 double startTimeInternal() const { return m_startTime; }
133 void setStartTime(double); 133 void setStartTime(double);
134 void setStartTimeInternal(double); 134 void setStartTimeInternal(double);
135 135
136 double startClip() const { return startClipInternal() * 1000; }
137 double endClip() const { return endClipInternal() * 1000; }
138 void setStartClip(double t) { setStartClipInternal(t / 1000); }
139 void setEndClip(double t) { setEndClipInternal(t / 1000); }
140
136 const AnimationEffect* source() const { return m_content.get(); } 141 const AnimationEffect* source() const { return m_content.get(); }
137 AnimationEffect* source() { return m_content.get(); } 142 AnimationEffect* source() { return m_content.get(); }
138 void setSource(AnimationEffect*); 143 void setSource(AnimationEffect*);
139 144
140 // Pausing via this method is not reflected in the value returned by 145 // Pausing via this method is not reflected in the value returned by
141 // paused() and must never overlap with pausing via pause(). 146 // paused() and must never overlap with pausing via pause().
142 void pauseForTesting(double pauseTime); 147 void pauseForTesting(double pauseTime);
143 // This should only be used for CSS 148 // This should only be used for CSS
144 void unpause(); 149 void unpause();
145 150
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 void createCompositorPlayer(); 200 void createCompositorPlayer();
196 void destroyCompositorPlayer(); 201 void destroyCompositorPlayer();
197 void attachCompositorTimeline(); 202 void attachCompositorTimeline();
198 void detachCompositorTimeline(); 203 void detachCompositorTimeline();
199 void attachCompositedLayers(); 204 void attachCompositedLayers();
200 void detachCompositedLayers(); 205 void detachCompositedLayers();
201 // WebCompositorAnimationDelegate implementation. 206 // WebCompositorAnimationDelegate implementation.
202 void notifyAnimationStarted(double monotonicTime, int group) override; 207 void notifyAnimationStarted(double monotonicTime, int group) override;
203 void notifyAnimationFinished(double monotonicTime, int group) override { } 208 void notifyAnimationFinished(double monotonicTime, int group) override { }
204 209
210 double startClipInternal() const { return m_startClip; };
211 double endClipInternal() const { return m_endClip; };
212 void setStartClipInternal(double t) { m_startClip = t; }
213 void setEndClipInternal(double t) { m_endClip = t; }
214 bool clipped(double);
215 double clipTimeToEffectChange(double) const;
216
205 AnimationPlayState m_playState; 217 AnimationPlayState m_playState;
206 double m_playbackRate; 218 double m_playbackRate;
207 double m_startTime; 219 double m_startTime;
208 double m_holdTime; 220 double m_holdTime;
221 double m_startClip;
222 double m_endClip;
209 223
210 unsigned m_sequenceNumber; 224 unsigned m_sequenceNumber;
211 225
212 typedef ScriptPromiseProperty<RawPtrWillBeMember<Animation>, RawPtrWillBeMem ber<Animation>, Member<DOMException>> AnimationPromise; 226 typedef ScriptPromiseProperty<RawPtrWillBeMember<Animation>, RawPtrWillBeMem ber<Animation>, Member<DOMException>> AnimationPromise;
213 PersistentWillBeMember<AnimationPromise> m_finishedPromise; 227 PersistentWillBeMember<AnimationPromise> m_finishedPromise;
214 PersistentWillBeMember<AnimationPromise> m_readyPromise; 228 PersistentWillBeMember<AnimationPromise> m_readyPromise;
215 229
216 RefPtrWillBeMember<AnimationEffect> m_content; 230 RefPtrWillBeMember<AnimationEffect> m_content;
217 RawPtrWillBeMember<AnimationTimeline> m_timeline; 231 RawPtrWillBeMember<AnimationTimeline> m_timeline;
218 // Reflects all pausing, including via pauseForTesting(). 232 // Reflects all pausing, including via pauseForTesting().
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
279 293
280 OwnPtr<WebCompositorAnimationPlayer> m_compositorPlayer; 294 OwnPtr<WebCompositorAnimationPlayer> m_compositorPlayer;
281 295
282 bool m_currentTimePending; 296 bool m_currentTimePending;
283 bool m_stateIsBeingUpdated; 297 bool m_stateIsBeingUpdated;
284 }; 298 };
285 299
286 } // namespace blink 300 } // namespace blink
287 301
288 #endif // Animation_h 302 #endif // Animation_h
OLDNEW
« no previous file with comments | « LayoutTests/web-animations-api/player-clip.html ('k') | Source/core/animation/Animation.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698