| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CompositorMutatorImpl_h | 5 #ifndef CompositorMutatorImpl_h |
| 6 #define CompositorMutatorImpl_h | 6 #define CompositorMutatorImpl_h |
| 7 | 7 |
| 8 #include "core/animation/CustomCompositorAnimationManager.h" | 8 #include "core/animation/CustomCompositorAnimationManager.h" |
| 9 #include "platform/graphics/CompositorMutator.h" | 9 #include "platform/graphics/CompositorMutator.h" |
| 10 #include "platform/heap/Handle.h" | 10 #include "platform/heap/Handle.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 // animation frames are received from ProxyClients and sent to the compositor to | 24 // animation frames are received from ProxyClients and sent to the compositor to |
| 25 // generate a new compositor frame. | 25 // generate a new compositor frame. |
| 26 // | 26 // |
| 27 // Should be accessed only on the compositor thread. | 27 // Should be accessed only on the compositor thread. |
| 28 class CompositorMutatorImpl final : public CompositorMutator { | 28 class CompositorMutatorImpl final : public CompositorMutator { |
| 29 WTF_MAKE_NONCOPYABLE(CompositorMutatorImpl); | 29 WTF_MAKE_NONCOPYABLE(CompositorMutatorImpl); |
| 30 public: | 30 public: |
| 31 static std::unique_ptr<CompositorMutatorClient> createClient(); | 31 static std::unique_ptr<CompositorMutatorClient> createClient(); |
| 32 static CompositorMutatorImpl* create(); | 32 static CompositorMutatorImpl* create(); |
| 33 | 33 |
| 34 DEFINE_INLINE_TRACE() | |
| 35 { | |
| 36 CompositorMutator::trace(visitor); | |
| 37 visitor->trace(m_proxyClients); | |
| 38 } | |
| 39 | |
| 40 // CompositorMutator implementation. | 34 // CompositorMutator implementation. |
| 41 bool mutate(double monotonicTimeNow, CompositorMutableStateProvider*) overri
de; | 35 bool mutate(double monotonicTimeNow, CompositorMutableStateProvider*) overri
de; |
| 42 | 36 |
| 43 void registerProxyClient(CompositorProxyClientImpl*); | 37 void registerProxyClient(CompositorProxyClientImpl*); |
| 44 | 38 |
| 45 void setNeedsMutate(); | 39 void setNeedsMutate(); |
| 46 | 40 |
| 47 void setClient(CompositorMutatorClient* client) { m_client = client; } | 41 void setClient(CompositorMutatorClient* client) { m_client = client; } |
| 48 CustomCompositorAnimationManager* animationManager() { return m_animationMan
ager.get(); } | 42 CustomCompositorAnimationManager* animationManager() { return m_animationMan
ager.get(); } |
| 49 | 43 |
| 50 private: | 44 private: |
| 51 CompositorMutatorImpl(); | 45 CompositorMutatorImpl(); |
| 52 | 46 |
| 53 using ProxyClients = HeapHashSet<WeakMember<CompositorProxyClientImpl>>; | 47 using ProxyClients = Vector<CrossThreadWeakPersistent<CompositorProxyClientI
mpl>>; |
| 54 ProxyClients m_proxyClients; | 48 ProxyClients m_proxyClients; |
| 55 | 49 |
| 56 std::unique_ptr<CustomCompositorAnimationManager> m_animationManager; | 50 std::unique_ptr<CustomCompositorAnimationManager> m_animationManager; |
| 57 CompositorMutatorClient* m_client; | 51 CompositorMutatorClient* m_client; |
| 58 }; | 52 }; |
| 59 | 53 |
| 60 } // namespace blink | 54 } // namespace blink |
| 61 | 55 |
| 62 #endif // CompositorMutatorImpl_h | 56 #endif // CompositorMutatorImpl_h |
| OLD | NEW |