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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 | 93 |
94 return m_requestedAnimationFrameCallbacks; | 94 return m_requestedAnimationFrameCallbacks; |
95 } | 95 } |
96 | 96 |
97 bool CompositorProxyClientImpl::executeAnimationFrameCallbacks( | 97 bool CompositorProxyClientImpl::executeAnimationFrameCallbacks( |
98 double monotonicTimeNow) { | 98 double monotonicTimeNow) { |
99 TRACE_EVENT0("compositor-worker", | 99 TRACE_EVENT0("compositor-worker", |
100 "CompositorProxyClientImpl::executeAnimationFrameCallbacks"); | 100 "CompositorProxyClientImpl::executeAnimationFrameCallbacks"); |
101 | 101 |
102 DCHECK(m_globalScope); | 102 DCHECK(m_globalScope); |
103 // Convert to zero based document time in milliseconds consistent with request
AnimationFrame. | 103 // Convert to zero based document time in milliseconds consistent with |
| 104 // requestAnimationFrame. |
104 double highResTimeMs = | 105 double highResTimeMs = |
105 1000.0 * (monotonicTimeNow - m_globalScope->timeOrigin()); | 106 1000.0 * (monotonicTimeNow - m_globalScope->timeOrigin()); |
106 return m_globalScope->executeAnimationFrameCallbacks(highResTimeMs); | 107 return m_globalScope->executeAnimationFrameCallbacks(highResTimeMs); |
107 } | 108 } |
108 | 109 |
109 void CompositorProxyClientImpl::registerCompositorProxy( | 110 void CompositorProxyClientImpl::registerCompositorProxy( |
110 CompositorProxy* proxy) { | 111 CompositorProxy* proxy) { |
111 m_proxies.add(proxy); | 112 m_proxies.add(proxy); |
112 } | 113 } |
113 | 114 |
114 void CompositorProxyClientImpl::unregisterCompositorProxy( | 115 void CompositorProxyClientImpl::unregisterCompositorProxy( |
115 CompositorProxy* proxy) { | 116 CompositorProxy* proxy) { |
116 m_proxies.remove(proxy); | 117 m_proxies.remove(proxy); |
117 } | 118 } |
118 | 119 |
119 } // namespace blink | 120 } // namespace blink |
OLD | NEW |