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

Unified Diff: Source/core/animation/AnimationClock.h

Issue 135693003: Defer starting of animations until after compositing update (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Reland after fixing flaky tests. Created 6 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « LayoutTests/transitions/webkit-clip-path-equality.html ('k') | Source/core/animation/AnimationClock.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/animation/AnimationClock.h
diff --git a/Source/core/animation/AnimationClock.h b/Source/core/animation/AnimationClock.h
index f6a2cdb84991f6777818a1f67bf251d269e1b757..540dfbeb2ebd126188b648a079d5a337dfb46ee1 100644
--- a/Source/core/animation/AnimationClock.h
+++ b/Source/core/animation/AnimationClock.h
@@ -36,6 +36,13 @@
namespace WebCore {
+// FIXME: This value is used to suppress updates when time is required outside of a frame.
+// The purpose of allowing the clock to update during such periods is to allow animations
+// to have an appropriate start time and for getComputedStyle to attempt to catch-up to a
+// compositor animation. However a more accurate system might be to attempt to phase-lock
+// with the frame clock.
+const double minTimeBeforeUnsynchronizedAnimationClockTick = 0.005;
+
class AnimationClock {
public:
static PassOwnPtr<AnimationClock> create(WTF::TimeFunction monotonicallyIncreasingTime = WTF::monotonicallyIncreasingTime)
@@ -43,22 +50,9 @@ public:
return adoptPtr(new AnimationClock(monotonicallyIncreasingTime));
}
- void updateTime(double time)
- {
- if (time > m_time)
- m_time = time;
- m_frozen = true;
- }
-
- double currentTime()
- {
- if (!m_frozen)
- updateTime(m_monotonicallyIncreasingTime());
- return m_time;
- }
-
+ void updateTime(double time);
+ double currentTime();
void unfreeze() { m_frozen = false; }
-
void resetTimeForTesting() { m_time = 0; m_frozen = true; }
private:
« no previous file with comments | « LayoutTests/transitions/webkit-clip-path-equality.html ('k') | Source/core/animation/AnimationClock.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698