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

Unified Diff: Source/WebCore/dom/ScriptedAnimationController.cpp

Issue 10391049: Merge 116319 - Unreviewed, rolling out r115525. (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1132/
Patch Set: Created 8 years, 7 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/WebCore/dom/ScriptedAnimationController.h ('k') | Source/WebCore/page/FrameView.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/dom/ScriptedAnimationController.cpp
===================================================================
--- Source/WebCore/dom/ScriptedAnimationController.cpp (revision 116642)
+++ Source/WebCore/dom/ScriptedAnimationController.cpp (working copy)
@@ -29,7 +29,6 @@
#if ENABLE(REQUEST_ANIMATION_FRAME)
#include "Document.h"
-#include "DocumentLoader.h"
#include "FrameView.h"
#include "InspectorInstrumentation.h"
#include "RequestAnimationFrameCallback.h"
@@ -52,7 +51,7 @@
, m_suspendCount(0)
#if USE(REQUEST_ANIMATION_FRAME_TIMER)
, m_animationTimer(this, &ScriptedAnimationController::animationTimerFired)
- , m_lastAnimationFrameTimeMonotonic(0)
+ , m_lastAnimationFrameTime(0)
#if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR)
, m_useTimer(false)
#endif
@@ -107,13 +106,11 @@
}
}
-void ScriptedAnimationController::serviceScriptedAnimations(double monotonicTimeNow)
+void ScriptedAnimationController::serviceScriptedAnimations(DOMTimeStamp time)
{
if (!m_callbacks.size() || m_suspendCount)
return;
- double highResNowMs = 1000.0 * m_document->loader()->timing()->convertMonotonicTimeToZeroBasedDocumentTime(monotonicTimeNow);
-
// First, generate a list of callbacks to consider. Callbacks registered from this point
// on are considered only for the "next" frame, not this one.
CallbackList callbacks(m_callbacks);
@@ -127,7 +124,7 @@
if (!callback->m_firedOrCancelled) {
callback->m_firedOrCancelled = true;
InspectorInstrumentationCookie cookie = InspectorInstrumentation::willFireAnimationFrame(m_document, callback->m_id);
- callback->handleEvent(highResNowMs);
+ callback->handleEvent(time);
InspectorInstrumentation::didFireAnimationFrame(cookie);
}
}
@@ -143,14 +140,14 @@
if (m_callbacks.size())
scheduleAnimation();
}
-
+
void ScriptedAnimationController::windowScreenDidChange(PlatformDisplayID displayID)
{
#if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR)
DisplayRefreshMonitorManager::sharedManager()->windowScreenDidChange(displayID, this);
#else
UNUSED_PARAM(displayID);
-#endif
+#endif
}
void ScriptedAnimationController::scheduleAnimation()
@@ -163,14 +160,14 @@
if (!m_useTimer) {
if (DisplayRefreshMonitorManager::sharedManager()->scheduleAnimation(this))
return;
-
+
m_useTimer = true;
}
#endif
if (m_animationTimer.isActive())
return;
-
- double scheduleDelay = max<double>(MinimumAnimationInterval - (monotonicallyIncreasingTime() - m_lastAnimationFrameTimeMonotonic), 0);
+
+ double scheduleDelay = max<double>(MinimumAnimationInterval - (currentTime() - m_lastAnimationFrameTime), 0);
m_animationTimer.startOneShot(scheduleDelay);
#else
if (FrameView* frameView = m_document->view())
@@ -181,19 +178,12 @@
#if USE(REQUEST_ANIMATION_FRAME_TIMER)
void ScriptedAnimationController::animationTimerFired(Timer<ScriptedAnimationController>*)
{
- m_lastAnimationFrameTimeMonotonic = monotonicallyIncreasingTime();
- serviceScriptedAnimations(m_lastAnimationFrameTimeMonotonic);
+ m_lastAnimationFrameTime = currentTime();
+ serviceScriptedAnimations(convertSecondsToDOMTimeStamp(m_lastAnimationFrameTime));
}
-#if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR)
-void ScriptedAnimationController::displayRefreshFired(double monotonicTimeNow)
-{
- serviceScriptedAnimations(monotonicTimeNow);
-}
#endif
-#endif
-
-
}
#endif
+
« no previous file with comments | « Source/WebCore/dom/ScriptedAnimationController.h ('k') | Source/WebCore/page/FrameView.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698