Index: third_party/WebKit/Source/web/CompositorMutatorImpl.h |
diff --git a/third_party/WebKit/Source/web/CompositorMutatorImpl.h b/third_party/WebKit/Source/web/CompositorMutatorImpl.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..d0a660984ae312d5ec5ec81477358780a8840b02 |
--- /dev/null |
+++ b/third_party/WebKit/Source/web/CompositorMutatorImpl.h |
@@ -0,0 +1,63 @@ |
+// Copyright 2016 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef CompositorMutatorImpl_h |
+#define CompositorMutatorImpl_h |
+ |
+#include "core/animation/CustomCompositorAnimationManager.h" |
+#include "platform/graphics/CompositorMutator.h" |
+#include "platform/heap/Handle.h" |
+#include "platform/heap/HeapAllocator.h" |
+#include "wtf/Noncopyable.h" |
+#include "wtf/OwnPtr.h" |
+#include "wtf/PassOwnPtr.h" |
+ |
+namespace blink { |
+ |
+class CompositorProxy; |
+class CompositorProxyClientImpl; |
+class CompositorWorkerGlobalScope; |
+class CompositorMutatorClient; |
+ |
+// Fans out requests from the compositor to all of the registered ProxyClients which |
+// can then mutate layers through their CompositorProxy interfaces. Requests for |
+// animation frames are received from ProxyClients and sent to the compositor to |
+// generate a new compositor frame. |
+// |
+// Should be accessed only on the compositor thread. |
+class CompositorMutatorImpl final : public CompositorMutator { |
+ WTF_MAKE_NONCOPYABLE(CompositorMutatorImpl); |
+public: |
+ static std::unique_ptr<CompositorMutatorClient> createClient(); |
+ static CompositorMutatorImpl* create(); |
+ |
+ DEFINE_INLINE_TRACE() |
+ { |
+ CompositorMutator::trace(visitor); |
+ visitor->trace(m_proxyClients); |
+ } |
+ |
+ // CompositorMutator implementation. |
+ bool mutate(double monotonicTimeNow) override; |
+ |
+ void registerProxyClient(CompositorProxyClientImpl*); |
+ |
+ void setNeedsMutate(); |
+ |
+ void setClient(CompositorMutatorClient* client) { m_client = client; } |
+ CustomCompositorAnimationManager* animationManager() { return m_animationManager.get(); } |
+ |
+private: |
+ CompositorMutatorImpl(); |
+ |
+ using ProxyClients = HeapHashSet<WeakMember<CompositorProxyClientImpl>>; |
+ ProxyClients m_proxyClients; |
+ |
+ OwnPtr<CustomCompositorAnimationManager> m_animationManager; |
+ CompositorMutatorClient* m_client; |
+}; |
+ |
+} // namespace blink |
+ |
+#endif // CompositorMutatorImpl_h |