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

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

Issue 2515363002: Introduce AnimationWorkletProxyClient and necessary plumbing to get it in worklet messaging proxy. (Closed)
Patch Set: address feedback Created 4 years, 1 month 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/CompositorMutatorImpl.cpp
diff --git a/third_party/WebKit/Source/web/CompositorMutatorImpl.cpp b/third_party/WebKit/Source/web/CompositorMutatorImpl.cpp
index 2c9ce6ba238929eb4f97f0fe78a3bdd2af0d7ee0..85c407670d7c94aeaf224c982548b736a92cde76 100644
--- a/third_party/WebKit/Source/web/CompositorMutatorImpl.cpp
+++ b/third_party/WebKit/Source/web/CompositorMutatorImpl.cpp
@@ -8,12 +8,12 @@
#include "core/dom/CompositorProxy.h"
#include "platform/CrossThreadFunctional.h"
#include "platform/WaitableEvent.h"
+#include "platform/graphics/CompositorAnimator.h"
#include "platform/graphics/CompositorMutationsTarget.h"
#include "platform/graphics/CompositorMutatorClient.h"
#include "platform/heap/Handle.h"
#include "platform/tracing/TraceEvent.h"
#include "public/platform/Platform.h"
-#include "web/CompositorProxyClientImpl.h"
#include "wtf/PtrUtil.h"
namespace blink {
@@ -47,7 +47,7 @@ std::unique_ptr<CompositorMutatorClient> CompositorMutatorImpl::createClient() {
createCompositorMutatorClient(&mutatorClient, &doneEvent);
}
// TODO(flackr): Instead of waiting for this event, we may be able to just set
- // the mutator on the CompositorProxyClient directly from the compositor
+ // the mutator on the CompositorWorkerProxyClient directly from the compositor
// thread before it gets used there. We still need to make sure we only
// create one mutator though.
doneEvent.wait();
@@ -66,26 +66,27 @@ bool CompositorMutatorImpl::mutate(
// TODO(vollick): we should avoid executing the animation frame
// callbacks if none of the proxies in the global scope are affected by
// m_mutations.
- for (CompositorProxyClientImpl* client : m_proxyClients) {
- if (client->mutate(monotonicTimeNow, stateProvider))
+ for (CompositorAnimator* animator : m_animators) {
+ if (animator->mutate(monotonicTimeNow, stateProvider))
needToReinvoke = true;
}
return needToReinvoke;
}
-void CompositorMutatorImpl::registerProxyClient(
- CompositorProxyClientImpl* client) {
- TRACE_EVENT0("compositor-worker", "CompositorMutatorImpl::registerClient");
- DCHECK(!m_proxyClients.contains(client));
- m_proxyClients.add(client);
+void CompositorMutatorImpl::registerCompositorAnimator(
+ CompositorAnimator* animator) {
+ TRACE_EVENT0("compositor-worker",
+ "CompositorMutatorImpl::registerCompositorAnimator");
+ DCHECK(!m_animators.contains(animator));
+ m_animators.add(animator);
setNeedsMutate();
}
-void CompositorMutatorImpl::unregisterProxyClient(
- CompositorProxyClientImpl* client) {
- DCHECK(m_proxyClients.contains(client));
- m_proxyClients.remove(client);
+void CompositorMutatorImpl::unregisterCompositorAnimator(
+ CompositorAnimator* animator) {
+ DCHECK(m_animators.contains(animator));
+ m_animators.remove(animator);
}
void CompositorMutatorImpl::setNeedsMutate() {

Powered by Google App Engine
This is Rietveld 408576698