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

Unified Diff: third_party/WebKit/Source/modules/compositorworker/CompositorWorkerGlobalScope.cpp

Issue 1895873006: compositor-worker: Initialize CW machinery plumbing to compositor and fire CW rAF callbacks. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Include WebCompositorMutatorClient from WebLayerTreeView to allow unique_ptr usage. Created 4 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
Index: third_party/WebKit/Source/modules/compositorworker/CompositorWorkerGlobalScope.cpp
diff --git a/third_party/WebKit/Source/modules/compositorworker/CompositorWorkerGlobalScope.cpp b/third_party/WebKit/Source/modules/compositorworker/CompositorWorkerGlobalScope.cpp
index ea923d77bb426586ba6f66796cb53c03810fd1c0..4e04afc26eb181303b5ef89c0863f7f5304de831 100644
--- a/third_party/WebKit/Source/modules/compositorworker/CompositorWorkerGlobalScope.cpp
+++ b/third_party/WebKit/Source/modules/compositorworker/CompositorWorkerGlobalScope.cpp
@@ -56,12 +56,9 @@ void CompositorWorkerGlobalScope::postMessage(ExecutionContext* executionContext
int CompositorWorkerGlobalScope::requestAnimationFrame(FrameRequestCallback* callback)
{
- // For now, just post a task to call mutate on the compositor proxy client.
- // TODO(flackr): Remove this as soon as CompositorProxyClient can request a
- // compositor frame from the CompositorMutatorImpl.
- thread()->postTask(BLINK_FROM_HERE, createSameThreadTask(&CompositorProxyClient::runAnimationFrameCallbacks,
- CompositorProxyClient::from(clients())));
- // TODO(flackr): Signal the compositor to call mutate on the next compositor frame.
+ const bool shouldSignal = !m_executingAnimationFrameCallbacks && m_callbackCollection.isEmpty();
+ if (shouldSignal)
+ CompositorProxyClient::from(clients())->requestAnimationFrame();
return m_callbackCollection.registerCallback(callback);
}

Powered by Google App Engine
This is Rietveld 408576698