| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/CompositorProxyClientImpl.h" | 5 #include "web/CompositorProxyClientImpl.h" |
| 6 | 6 |
| 7 #include "core/dom/CompositorProxy.h" | 7 #include "core/dom/CompositorProxy.h" |
| 8 #include "modules/compositorworker/CompositorWorkerGlobalScope.h" | 8 #include "modules/compositorworker/CompositorWorkerGlobalScope.h" |
| 9 #include "platform/TraceEvent.h" | 9 #include "platform/TraceEvent.h" |
| 10 #include "platform/graphics/CompositorMutableStateProvider.h" | 10 #include "platform/graphics/CompositorMutableStateProvider.h" |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 { | 46 { |
| 47 CompositorProxyClient::trace(visitor); | 47 CompositorProxyClient::trace(visitor); |
| 48 visitor->trace(m_mutator); | 48 visitor->trace(m_mutator); |
| 49 visitor->trace(m_globalScope); | 49 visitor->trace(m_globalScope); |
| 50 visitor->trace(m_proxies); | 50 visitor->trace(m_proxies); |
| 51 } | 51 } |
| 52 | 52 |
| 53 void CompositorProxyClientImpl::setGlobalScope(WorkerGlobalScope* scope) | 53 void CompositorProxyClientImpl::setGlobalScope(WorkerGlobalScope* scope) |
| 54 { | 54 { |
| 55 TRACE_EVENT0("compositor-worker", "CompositorProxyClientImpl::setGlobalScope
"); | 55 TRACE_EVENT0("compositor-worker", "CompositorProxyClientImpl::setGlobalScope
"); |
| 56 DCHECK(!m_globalScope); | 56 DCHECK(!m_globalScope || !scope); |
| 57 DCHECK(scope); | |
| 58 m_globalScope = static_cast<CompositorWorkerGlobalScope*>(scope); | 57 m_globalScope = static_cast<CompositorWorkerGlobalScope*>(scope); |
| 59 m_mutator->registerProxyClient(this); | 58 if (m_globalScope) |
| 59 m_mutator->registerProxyClient(this); |
| 60 } | 60 } |
| 61 | 61 |
| 62 void CompositorProxyClientImpl::requestAnimationFrame() | 62 void CompositorProxyClientImpl::requestAnimationFrame() |
| 63 { | 63 { |
| 64 TRACE_EVENT0("compositor-worker", "CompositorProxyClientImpl::requestAnimati
onFrame"); | 64 TRACE_EVENT0("compositor-worker", "CompositorProxyClientImpl::requestAnimati
onFrame"); |
| 65 m_requestedAnimationFrameCallbacks = true; | 65 m_requestedAnimationFrameCallbacks = true; |
| 66 m_mutator->setNeedsMutate(); | 66 m_mutator->setNeedsMutate(); |
| 67 } | 67 } |
| 68 | 68 |
| 69 bool CompositorProxyClientImpl::mutate(double monotonicTimeNow, CompositorMutabl
eStateProvider* stateProvider) | 69 bool CompositorProxyClientImpl::mutate(double monotonicTimeNow, CompositorMutabl
eStateProvider* stateProvider) |
| (...skipping 26 matching lines...) Expand all Loading... |
| 96 { | 96 { |
| 97 m_proxies.add(proxy); | 97 m_proxies.add(proxy); |
| 98 } | 98 } |
| 99 | 99 |
| 100 void CompositorProxyClientImpl::unregisterCompositorProxy(CompositorProxy* proxy
) | 100 void CompositorProxyClientImpl::unregisterCompositorProxy(CompositorProxy* proxy
) |
| 101 { | 101 { |
| 102 m_proxies.remove(proxy); | 102 m_proxies.remove(proxy); |
| 103 } | 103 } |
| 104 | 104 |
| 105 } // namespace blink | 105 } // namespace blink |
| OLD | NEW |