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

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 LayerTreeHostClientTakeAwayOutputSurface test. Content provider is always destroyed on the clie… Created 5 years, 2 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
« no previous file with comments | « cc/trees/single_thread_proxy.h ('k') | cc/trees/thread_proxy.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 scoped_ptr<OutputSurface> SingleThreadProxy::ReleaseOutputSurface() { 152 void SingleThreadProxy::ReleaseOutputSurface() {
153 // |layer_tree_host_| should already be aware of this. 153 // |layer_tree_host_| should already be aware of this.
154 DCHECK(layer_tree_host_->output_surface_lost()); 154 DCHECK(layer_tree_host_->output_surface_lost());
155 155
156 if (scheduler_on_impl_thread_) 156 if (scheduler_on_impl_thread_)
157 scheduler_on_impl_thread_->DidLoseOutputSurface(); 157 scheduler_on_impl_thread_->DidLoseOutputSurface();
158 return layer_tree_host_impl_->ReleaseOutputSurface(); 158 return layer_tree_host_impl_->ReleaseOutputSurface();
159 } 159 }
160 160
161 void SingleThreadProxy::SetOutputSurface( 161 void SingleThreadProxy::SetOutputSurface(OutputSurface* output_surface) {
162 scoped_ptr<OutputSurface> output_surface) {
163 DCHECK(Proxy::IsMainThread()); 162 DCHECK(Proxy::IsMainThread());
164 DCHECK(layer_tree_host_->output_surface_lost()); 163 DCHECK(layer_tree_host_->output_surface_lost());
165 DCHECK(output_surface_creation_requested_); 164 DCHECK(output_surface_creation_requested_);
166 renderer_capabilities_for_main_thread_ = RendererCapabilities(); 165 renderer_capabilities_for_main_thread_ = RendererCapabilities();
167 166
168 bool success; 167 bool success;
169 { 168 {
170 DebugScopedSetMainThreadBlocked main_thread_blocked(this); 169 DebugScopedSetMainThreadBlocked main_thread_blocked(this);
171 DebugScopedSetImplThread impl(this); 170 DebugScopedSetImplThread impl(this);
172 success = layer_tree_host_impl_->InitializeRenderer(output_surface.Pass()); 171 success = layer_tree_host_impl_->InitializeRenderer(output_surface);
173 } 172 }
174 173
175 if (success) { 174 if (success) {
176 layer_tree_host_->DidInitializeOutputSurface(); 175 layer_tree_host_->DidInitializeOutputSurface();
177 if (scheduler_on_impl_thread_) 176 if (scheduler_on_impl_thread_)
178 scheduler_on_impl_thread_->DidCreateAndInitializeOutputSurface(); 177 scheduler_on_impl_thread_->DidCreateAndInitializeOutputSurface();
179 else if (!inside_synchronous_composite_) 178 else if (!inside_synchronous_composite_)
180 SetNeedsCommit(); 179 SetNeedsCommit();
181 output_surface_creation_requested_ = false; 180 output_surface_creation_requested_ = false;
182 } else { 181 } else {
(...skipping 718 matching lines...) Expand 10 before | Expand all | Expand 10 after
901 << "DidFinishImplFrame called while not inside an impl frame!"; 900 << "DidFinishImplFrame called while not inside an impl frame!";
902 inside_impl_frame_ = false; 901 inside_impl_frame_ = false;
903 #endif 902 #endif
904 } 903 }
905 904
906 void SingleThreadProxy::SendBeginFramesToChildren(const BeginFrameArgs& args) { 905 void SingleThreadProxy::SendBeginFramesToChildren(const BeginFrameArgs& args) {
907 layer_tree_host_->SendBeginFramesToChildren(args); 906 layer_tree_host_->SendBeginFramesToChildren(args);
908 } 907 }
909 908
910 } // namespace cc 909 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/single_thread_proxy.h ('k') | cc/trees/thread_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698