| 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 #include "web/AnimationWorkletProxyClientImpl.h" | 5 #include "web/AnimationWorkletProxyClientImpl.h" |
| 6 | 6 |
| 7 #include "core/dom/CompositorProxy.h" | 7 #include "core/dom/CompositorProxy.h" |
| 8 #include "platform/graphics/CompositorMutableStateProvider.h" | 8 #include "platform/graphics/CompositorMutableStateProvider.h" |
| 9 #include "web/CompositorMutatorImpl.h" | 9 #include "web/CompositorMutatorImpl.h" |
| 10 | 10 |
| 11 namespace blink { | 11 namespace blink { |
| 12 | 12 |
| 13 AnimationWorkletProxyClientImpl::AnimationWorkletProxyClientImpl( | 13 AnimationWorkletProxyClientImpl::AnimationWorkletProxyClientImpl( |
| 14 CompositorMutatorImpl* mutator) | 14 CompositorMutatorImpl* mutator) |
| 15 : m_mutator(mutator) { | 15 : m_mutator(mutator) { |
| 16 DCHECK(isMainThread()); | 16 DCHECK(isMainThread()); |
| 17 } | 17 } |
| 18 | 18 |
| 19 DEFINE_TRACE(AnimationWorkletProxyClientImpl) { | 19 DEFINE_TRACE(AnimationWorkletProxyClientImpl) { |
| 20 visitor->trace(m_proxies); | |
| 21 AnimationWorkletProxyClient::trace(visitor); | 20 AnimationWorkletProxyClient::trace(visitor); |
| 22 CompositorAnimator::trace(visitor); | 21 CompositorAnimator::trace(visitor); |
| 23 } | 22 } |
| 24 | 23 |
| 25 bool AnimationWorkletProxyClientImpl::mutate( | 24 bool AnimationWorkletProxyClientImpl::mutate( |
| 26 double monotonicTimeNow, | 25 double monotonicTimeNow, |
| 27 CompositorMutableStateProvider* provider) { | 26 CompositorMutableStateProvider* provider) { |
| 28 DCHECK(!isMainThread()); | 27 DCHECK(!isMainThread()); |
| 29 // TODO(majidvp): actually call JS |animate| callbacks. | 28 // TODO(majidvp): actually call JS |animate| callbacks. |
| 30 | 29 |
| 31 // Always request another rAF for now. | 30 // Always request another rAF for now. |
| 32 return true; | 31 return true; |
| 33 } | 32 } |
| 34 | 33 |
| 35 void AnimationWorkletProxyClientImpl::registerCompositorProxy( | |
| 36 CompositorProxy* proxy) { | |
| 37 DCHECK(!isMainThread()); | |
| 38 m_proxies.insert(proxy); | |
| 39 } | |
| 40 | |
| 41 void AnimationWorkletProxyClientImpl::unregisterCompositorProxy( | |
| 42 CompositorProxy* proxy) { | |
| 43 DCHECK(!isMainThread()); | |
| 44 m_proxies.erase(proxy); | |
| 45 } | |
| 46 | |
| 47 } // namespace blink | 34 } // namespace blink |
| OLD | NEW |