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

Unified Diff: Source/web/WebViewImpl.cpp

Issue 516103003: scheduler: Tell the scheduler about frame timing (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Still need to keep animate() around. Created 6 years, 3 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/web/WebViewImpl.h ('k') | public/web/WebBeginFrameArgs.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/WebViewImpl.cpp
diff --git a/Source/web/WebViewImpl.cpp b/Source/web/WebViewImpl.cpp
index a22d0eb4051eef44d6c7a23bc0bd0afc94f0597e..a170b30c711d430597a550f8a410233e7b41e766 100644
--- a/Source/web/WebViewImpl.cpp
+++ b/Source/web/WebViewImpl.cpp
@@ -110,6 +110,7 @@
#include "platform/graphics/Color.h"
#include "platform/graphics/Image.h"
#include "platform/graphics/ImageBuffer.h"
+#include "platform/scheduler/Scheduler.h"
#include "platform/scroll/ScrollbarTheme.h"
#include "platform/weborigin/SchemeRegistry.h"
#include "public/platform/Platform.h"
@@ -1733,13 +1734,15 @@ void WebViewImpl::beginFrame(const WebBeginFrameArgs& frameTime)
{
TRACE_EVENT0("blink", "WebViewImpl::beginFrame");
- double monotonicFrameBeginTime = frameTime.lastFrameTimeMonotonic;
- if (!monotonicFrameBeginTime)
- monotonicFrameBeginTime = monotonicallyIncreasingTime();
+ WebBeginFrameArgs validFrameTime(frameTime);
+ if (!validFrameTime.lastFrameTimeMonotonic)
+ validFrameTime.lastFrameTimeMonotonic = monotonicallyIncreasingTime();
+
+ Scheduler::shared()->willBeginFrame(validFrameTime);
// Create synthetic wheel events as necessary for fling.
if (m_gestureAnimation) {
- if (m_gestureAnimation->animate(monotonicFrameBeginTime))
+ if (m_gestureAnimation->animate(validFrameTime.lastFrameTimeMonotonic))
scheduleAnimation();
else {
endActiveFlingAnimation();
@@ -1757,7 +1760,7 @@ void WebViewImpl::beginFrame(const WebBeginFrameArgs& frameTime)
if (!m_page)
return;
- PageWidgetDelegate::animate(m_page.get(), monotonicFrameBeginTime);
+ PageWidgetDelegate::animate(m_page.get(), validFrameTime.lastFrameTimeMonotonic);
if (m_continuousPaintingEnabled) {
ContinuousPainter::setNeedsDisplayRecursive(m_rootGraphicsLayer, m_pageOverlays.get());
@@ -1765,6 +1768,11 @@ void WebViewImpl::beginFrame(const WebBeginFrameArgs& frameTime)
}
}
+void WebViewImpl::didCommitFrameToCompositor()
+{
+ Scheduler::shared()->didCommitFrameToCompositor();
+}
+
void WebViewImpl::layout()
{
TRACE_EVENT0("blink", "WebViewImpl::layout");
« no previous file with comments | « Source/web/WebViewImpl.h ('k') | public/web/WebBeginFrameArgs.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698