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

Unified Diff: third_party/WebKit/Source/web/CompositorProxyClientImpl.cpp

Issue 2041193005: [compositorworker] compositor proxy mutation updates underlying layers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@compositor-worker-upstream-registration
Patch Set: Fix inlcudes Created 4 years, 6 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/web/CompositorProxyClientImpl.cpp
diff --git a/third_party/WebKit/Source/web/CompositorProxyClientImpl.cpp b/third_party/WebKit/Source/web/CompositorProxyClientImpl.cpp
index f477ca2bcabce6c21fc276dd52f500bc44077150..907e0f12bc5e52e262aa12bf51e45ec59157584d 100644
--- a/third_party/WebKit/Source/web/CompositorProxyClientImpl.cpp
+++ b/third_party/WebKit/Source/web/CompositorProxyClientImpl.cpp
@@ -7,6 +7,7 @@
#include "core/dom/CompositorProxy.h"
#include "modules/compositorworker/CompositorWorkerGlobalScope.h"
#include "platform/TraceEvent.h"
+#include "platform/graphics/CompositorMutableStateProvider.h"
#include "web/CompositorMutatorImpl.h"
#include "wtf/CurrentTime.h"
@@ -42,7 +43,7 @@ void CompositorProxyClientImpl::requestAnimationFrame()
m_mutator->setNeedsMutate();
}
-bool CompositorProxyClientImpl::mutate(double monotonicTimeNow)
+bool CompositorProxyClientImpl::mutate(double monotonicTimeNow, CompositorMutableStateProvider* stateProvider)
{
if (!m_globalScope)
return false;
@@ -51,7 +52,9 @@ bool CompositorProxyClientImpl::mutate(double monotonicTimeNow)
if (!m_requestedAnimationFrameCallbacks)
return false;
+ updateMutableStateForCompositorProxies(stateProvider);
jbroman 2016/06/13 19:45:17 Mind clarifying what's going on here? I think I ge
majidvp 2016/06/13 21:52:51 Yes. Proxies may only mutate the tree during rAF.
m_requestedAnimationFrameCallbacks = executeAnimationFrameCallbacks(monotonicTimeNow);
+ updateMutableStateForCompositorProxies(nullptr);
return m_requestedAnimationFrameCallbacks;
}
@@ -59,10 +62,16 @@ bool CompositorProxyClientImpl::mutate(double monotonicTimeNow)
bool CompositorProxyClientImpl::executeAnimationFrameCallbacks(double monotonicTimeNow)
{
TRACE_EVENT0("compositor-worker", "CompositorProxyClientImpl::executeAnimationFrameCallbacks");
+
// Convert to zero based document time in milliseconds consistent with requestAnimationFrame.
double highResTimeMs = 1000.0 * (monotonicTimeNow - m_globalScope->timeOrigin());
- const bool shouldReinvoke = m_globalScope->executeAnimationFrameCallbacks(highResTimeMs);
- return shouldReinvoke;
+ return m_globalScope->executeAnimationFrameCallbacks(highResTimeMs);
+}
+
+void CompositorProxyClientImpl::updateMutableStateForCompositorProxies(CompositorMutableStateProvider* stateProvider)
+{
+ for (CompositorProxy* proxy : m_proxies)
+ proxy->takeCompositorMutableState(stateProvider ? stateProvider->getMutableStateFor(proxy->elementId()) : nullptr);
}
void CompositorProxyClientImpl::registerCompositorProxy(CompositorProxy* proxy)

Powered by Google App Engine
This is Rietveld 408576698