Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(269)

Side by Side Diff: third_party/WebKit/Source/web/CompositorWorkerProxyClientImpl.cpp

Issue 2765053002: Avoid exposing cc::Layer tree to CompositorProxy (Closed)
Patch Set: Rebase onto blink reformat Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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"
(...skipping 11 matching lines...) Expand all
22 22
23 public: 23 public:
24 ScopedCompositorMutableState( 24 ScopedCompositorMutableState(
25 CompositorProxyClientImpl* compositor_proxy_client, 25 CompositorProxyClientImpl* compositor_proxy_client,
26 CompositorMutableStateProvider* state_provider) 26 CompositorMutableStateProvider* state_provider)
27 : compositor_proxy_client_(compositor_proxy_client) { 27 : compositor_proxy_client_(compositor_proxy_client) {
28 DCHECK(!IsMainThread()); 28 DCHECK(!IsMainThread());
29 DCHECK(compositor_proxy_client_); 29 DCHECK(compositor_proxy_client_);
30 for (CompositorProxy* proxy : compositor_proxy_client_->Proxies()) { 30 for (CompositorProxy* proxy : compositor_proxy_client_->Proxies()) {
31 proxy->TakeCompositorMutableState( 31 proxy->TakeCompositorMutableState(
32 state_provider->GetMutableStateFor(proxy->ElementId())); 32 state_provider->GetMutableStateFor(proxy->ProxyId()));
33 } 33 }
34 } 34 }
35 ~ScopedCompositorMutableState() { 35 ~ScopedCompositorMutableState() {
36 for (CompositorProxy* proxy : compositor_proxy_client_->Proxies()) 36 for (CompositorProxy* proxy : compositor_proxy_client_->Proxies())
37 proxy->TakeCompositorMutableState(nullptr); 37 proxy->TakeCompositorMutableState(nullptr);
38 } 38 }
39 39
40 private: 40 private:
41 Member<CompositorProxyClientImpl> compositor_proxy_client_; 41 Member<CompositorProxyClientImpl> compositor_proxy_client_;
42 }; 42 };
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 113
114 DCHECK(global_scope_); 114 DCHECK(global_scope_);
115 // Convert to zero based document time in milliseconds consistent with 115 // Convert to zero based document time in milliseconds consistent with
116 // requestAnimationFrame. 116 // requestAnimationFrame.
117 double high_res_time_ms = 117 double high_res_time_ms =
118 1000.0 * (monotonic_time_now - global_scope_->TimeOrigin()); 118 1000.0 * (monotonic_time_now - global_scope_->TimeOrigin());
119 return global_scope_->ExecuteAnimationFrameCallbacks(high_res_time_ms); 119 return global_scope_->ExecuteAnimationFrameCallbacks(high_res_time_ms);
120 } 120 }
121 121
122 } // namespace blink 122 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698