| OLD | NEW |
| (Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef AnimationWorkletProxyClientImpl_h |
| 6 #define AnimationWorkletProxyClientImpl_h |
| 7 |
| 8 #include "core/dom/AnimationWorkletProxyClient.h" |
| 9 #include "platform/heap/Handle.h" |
| 10 #include "web/CompositorAnimator.h" |
| 11 #include "wtf/Noncopyable.h" |
| 12 |
| 13 namespace blink { |
| 14 |
| 15 class CompositorMutatorImpl; |
| 16 |
| 17 // Mediates between one Animator and the associated CompositorMutatorImpl. There |
| 18 // is one AnimationWorkletProxyClientImpl per Animator but there may be multiple |
| 19 // for a given mutator and animatorWorklet. |
| 20 // |
| 21 // This is constructed on the main thread but it is used in the worklet backing |
| 22 // thread i.e., compositor thread. |
| 23 class AnimationWorkletProxyClientImpl final |
| 24 : public AnimationWorkletProxyClient, |
| 25 public CompositorAnimator { |
| 26 WTF_MAKE_NONCOPYABLE(AnimationWorkletProxyClientImpl); |
| 27 USING_GARBAGE_COLLECTED_MIXIN(AnimationWorkletProxyClientImpl); |
| 28 |
| 29 public: |
| 30 explicit AnimationWorkletProxyClientImpl(CompositorMutatorImpl*); |
| 31 DECLARE_VIRTUAL_TRACE(); |
| 32 |
| 33 // CompositorAnimator: |
| 34 // This method is invoked in compositor thread |
| 35 bool mutate(double monotonicTimeNow, |
| 36 CompositorMutableStateProvider*) override; |
| 37 |
| 38 // CompositorProxyClient: |
| 39 void registerCompositorProxy(CompositorProxy*) override; |
| 40 void unregisterCompositorProxy(CompositorProxy*) override; |
| 41 |
| 42 private: |
| 43 CrossThreadPersistent<CompositorMutatorImpl> m_mutator; |
| 44 HeapHashSet<WeakMember<CompositorProxy>> m_proxies; |
| 45 }; |
| 46 |
| 47 } // namespace blink |
| 48 |
| 49 #endif // AnimationWorkletProxyClientImpl_h |
| OLD | NEW |