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); |
} |