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

Side by Side Diff: cc/trees/single_thread_proxy.cc

Issue 1336733002: Re-land: cc: Implement shared worker contexts. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix typo in last patch Created 5 years, 3 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 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 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 "cc/trees/single_thread_proxy.h" 5 #include "cc/trees/single_thread_proxy.h"
6 6
7 #include "base/auto_reset.h" 7 #include "base/auto_reset.h"
8 #include "base/profiler/scoped_tracker.h" 8 #include "base/profiler/scoped_tracker.h"
9 #include "base/trace_event/trace_event.h" 9 #include "base/trace_event/trace_event.h"
10 #include "cc/debug/benchmark_instrumentation.h" 10 #include "cc/debug/benchmark_instrumentation.h"
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 void SingleThreadProxy::RequestNewOutputSurface() { 142 void SingleThreadProxy::RequestNewOutputSurface() {
143 DCHECK(Proxy::IsMainThread()); 143 DCHECK(Proxy::IsMainThread());
144 DCHECK(layer_tree_host_->output_surface_lost()); 144 DCHECK(layer_tree_host_->output_surface_lost());
145 output_surface_creation_callback_.Cancel(); 145 output_surface_creation_callback_.Cancel();
146 if (output_surface_creation_requested_) 146 if (output_surface_creation_requested_)
147 return; 147 return;
148 output_surface_creation_requested_ = true; 148 output_surface_creation_requested_ = true;
149 layer_tree_host_->RequestNewOutputSurface(); 149 layer_tree_host_->RequestNewOutputSurface();
150 } 150 }
151 151
152 void SingleThreadProxy::SetOutputSurface( 152 void SingleThreadProxy::SetOutputSurface(OutputSurface* output_surface) {
153 scoped_ptr<OutputSurface> output_surface) {
154 DCHECK(Proxy::IsMainThread()); 153 DCHECK(Proxy::IsMainThread());
155 DCHECK(layer_tree_host_->output_surface_lost()); 154 DCHECK(layer_tree_host_->output_surface_lost());
156 DCHECK(output_surface_creation_requested_); 155 DCHECK(output_surface_creation_requested_);
157 renderer_capabilities_for_main_thread_ = RendererCapabilities(); 156 renderer_capabilities_for_main_thread_ = RendererCapabilities();
158 157
159 bool success; 158 bool success;
160 { 159 {
161 DebugScopedSetMainThreadBlocked main_thread_blocked(this); 160 DebugScopedSetMainThreadBlocked main_thread_blocked(this);
162 DebugScopedSetImplThread impl(this); 161 DebugScopedSetImplThread impl(this);
163 success = layer_tree_host_impl_->InitializeRenderer(output_surface.Pass()); 162 success = layer_tree_host_impl_->InitializeRenderer(output_surface);
164 } 163 }
165 164
166 if (success) { 165 if (success) {
167 layer_tree_host_->DidInitializeOutputSurface(); 166 layer_tree_host_->DidInitializeOutputSurface();
168 if (scheduler_on_impl_thread_) 167 if (scheduler_on_impl_thread_)
169 scheduler_on_impl_thread_->DidCreateAndInitializeOutputSurface(); 168 scheduler_on_impl_thread_->DidCreateAndInitializeOutputSurface();
170 else if (!inside_synchronous_composite_) 169 else if (!inside_synchronous_composite_)
171 SetNeedsCommit(); 170 SetNeedsCommit();
172 output_surface_creation_requested_ = false; 171 output_surface_creation_requested_ = false;
173 } else { 172 } else {
(...skipping 728 matching lines...) Expand 10 before | Expand all | Expand 10 after
902 << "DidFinishImplFrame called while not inside an impl frame!"; 901 << "DidFinishImplFrame called while not inside an impl frame!";
903 inside_impl_frame_ = false; 902 inside_impl_frame_ = false;
904 #endif 903 #endif
905 } 904 }
906 905
907 void SingleThreadProxy::SendBeginFramesToChildren(const BeginFrameArgs& args) { 906 void SingleThreadProxy::SendBeginFramesToChildren(const BeginFrameArgs& args) {
908 layer_tree_host_->SendBeginFramesToChildren(args); 907 layer_tree_host_->SendBeginFramesToChildren(args);
909 } 908 }
910 909
911 } // namespace cc 910 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698