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/CompositorWorkerProxyClientImpl.h" | 5 #include "web/CompositorWorkerProxyClientImpl.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/graphics/CompositorMutableStateProvider.h" | 9 #include "platform/graphics/CompositorMutableStateProvider.h" |
10 #include "platform/instrumentation/tracing/TraceEvent.h" | 10 #include "platform/instrumentation/tracing/TraceEvent.h" |
| 11 #include "platform/wtf/CurrentTime.h" |
11 #include "web/CompositorMutatorImpl.h" | 12 #include "web/CompositorMutatorImpl.h" |
12 #include "wtf/CurrentTime.h" | |
13 | 13 |
14 namespace blink { | 14 namespace blink { |
15 | 15 |
16 // A helper class that updates proxies mutable state on creation and reset it | 16 // A helper class that updates proxies mutable state on creation and reset it |
17 // on destruction. This can be used with rAF callback to ensure no mutation is | 17 // on destruction. This can be used with rAF callback to ensure no mutation is |
18 // allowed outside rAF. | 18 // allowed outside rAF. |
19 class ScopedCompositorMutableState final { | 19 class ScopedCompositorMutableState final { |
20 WTF_MAKE_NONCOPYABLE(ScopedCompositorMutableState); | 20 WTF_MAKE_NONCOPYABLE(ScopedCompositorMutableState); |
21 STACK_ALLOCATED(); | 21 STACK_ALLOCATED(); |
22 | 22 |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 | 112 |
113 DCHECK(m_globalScope); | 113 DCHECK(m_globalScope); |
114 // Convert to zero based document time in milliseconds consistent with | 114 // Convert to zero based document time in milliseconds consistent with |
115 // requestAnimationFrame. | 115 // requestAnimationFrame. |
116 double highResTimeMs = | 116 double highResTimeMs = |
117 1000.0 * (monotonicTimeNow - m_globalScope->timeOrigin()); | 117 1000.0 * (monotonicTimeNow - m_globalScope->timeOrigin()); |
118 return m_globalScope->executeAnimationFrameCallbacks(highResTimeMs); | 118 return m_globalScope->executeAnimationFrameCallbacks(highResTimeMs); |
119 } | 119 } |
120 | 120 |
121 } // namespace blink | 121 } // namespace blink |
OLD | NEW |