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

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

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 | « Source/core/animation/AnimationClock.h ('k') | Source/core/animation/AnimationClockTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/animation/AnimationClock.cpp
diff --git a/Source/core/svg/SVGAnimatedNumber.cpp b/Source/core/animation/AnimationClock.cpp
similarity index 77%
copy from Source/core/svg/SVGAnimatedNumber.cpp
copy to Source/core/animation/AnimationClock.cpp
index 9c1fc971a5258560fec9bd76b7e2576de468a062..649220690e67a27adf18592ac5d9a46d000c9ff2 100644
--- a/Source/core/svg/SVGAnimatedNumber.cpp
+++ b/Source/core/animation/AnimationClock.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2014 Google Inc. All rights reserved.
+ * Copyright (c) 2014, Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -29,21 +29,25 @@
*/
#include "config.h"
-
-#include "core/svg/SVGAnimatedNumber.h"
-#include "core/svg/SVGAnimatedNumberOptionalNumber.h"
+#include "core/animation/AnimationClock.h"
namespace WebCore {
-void SVGAnimatedNumber::synchronizeAttribute()
+void AnimationClock::updateTime(double time)
{
- ASSERT(needsSynchronizeAttribute());
- if (m_parentNumberOptionalNumber) {
- m_parentNumberOptionalNumber->synchronizeAttribute();
- return;
- }
+ if (time > m_time)
+ m_time = time;
+ m_frozen = true;
+}
- NewSVGAnimatedProperty<SVGNumber>::synchronizeAttribute();
+double AnimationClock::currentTime()
+{
+ if (!m_frozen) {
+ double newTime = m_monotonicallyIncreasingTime();
+ if (newTime >= m_time + minTimeBeforeUnsynchronizedAnimationClockTick)
+ m_time = newTime;
+ }
+ return m_time;
}
}
« no previous file with comments | « Source/core/animation/AnimationClock.h ('k') | Source/core/animation/AnimationClockTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698