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