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

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

Issue 871743002: cc: Fix multiple outstanding output surface requests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add comment Created 5 years, 11 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/debug/trace_event.h" 8 #include "base/debug/trace_event.h"
9 #include "cc/debug/benchmark_instrumentation.h" 9 #include "cc/debug/benchmark_instrumentation.h"
10 #include "cc/output/context_provider.h" 10 #include "cc/output/context_provider.h"
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 if (output_surface_creation_requested_) 128 if (output_surface_creation_requested_)
129 return; 129 return;
130 output_surface_creation_requested_ = true; 130 output_surface_creation_requested_ = true;
131 layer_tree_host_->RequestNewOutputSurface(); 131 layer_tree_host_->RequestNewOutputSurface();
132 } 132 }
133 133
134 void SingleThreadProxy::SetOutputSurface( 134 void SingleThreadProxy::SetOutputSurface(
135 scoped_ptr<OutputSurface> output_surface) { 135 scoped_ptr<OutputSurface> output_surface) {
136 DCHECK(Proxy::IsMainThread()); 136 DCHECK(Proxy::IsMainThread());
137 DCHECK(layer_tree_host_->output_surface_lost()); 137 DCHECK(layer_tree_host_->output_surface_lost());
138 output_surface_creation_requested_ = false; 138 DCHECK(output_surface_creation_requested_);
139 renderer_capabilities_for_main_thread_ = RendererCapabilities(); 139 renderer_capabilities_for_main_thread_ = RendererCapabilities();
140 140
141 bool success; 141 bool success;
142 { 142 {
143 DebugScopedSetMainThreadBlocked main_thread_blocked(this); 143 DebugScopedSetMainThreadBlocked main_thread_blocked(this);
144 DebugScopedSetImplThread impl(this); 144 DebugScopedSetImplThread impl(this);
145 layer_tree_host_->DeleteContentsTexturesOnImplThread( 145 layer_tree_host_->DeleteContentsTexturesOnImplThread(
146 layer_tree_host_impl_->resource_provider()); 146 layer_tree_host_impl_->resource_provider());
147 success = layer_tree_host_impl_->InitializeRenderer(output_surface.Pass()); 147 success = layer_tree_host_impl_->InitializeRenderer(output_surface.Pass());
148 } 148 }
149 149
150 if (success) { 150 if (success) {
151 layer_tree_host_->DidInitializeOutputSurface(); 151 layer_tree_host_->DidInitializeOutputSurface();
152 if (scheduler_on_impl_thread_) 152 if (scheduler_on_impl_thread_)
153 scheduler_on_impl_thread_->DidCreateAndInitializeOutputSurface(); 153 scheduler_on_impl_thread_->DidCreateAndInitializeOutputSurface();
154 else if (!inside_synchronous_composite_) 154 else if (!inside_synchronous_composite_)
155 SetNeedsCommit(); 155 SetNeedsCommit();
156 output_surface_creation_requested_ = false;
156 } else { 157 } else {
158 // DidFailToInitializeOutputSurface is treated as a RequestNewOutputSurface,
159 // and so output_surface_creation_requested remains true.
157 layer_tree_host_->DidFailToInitializeOutputSurface(); 160 layer_tree_host_->DidFailToInitializeOutputSurface();
158 } 161 }
159 } 162 }
160 163
161 const RendererCapabilities& SingleThreadProxy::GetRendererCapabilities() const { 164 const RendererCapabilities& SingleThreadProxy::GetRendererCapabilities() const {
162 DCHECK(Proxy::IsMainThread()); 165 DCHECK(Proxy::IsMainThread());
163 DCHECK(!layer_tree_host_->output_surface_lost()); 166 DCHECK(!layer_tree_host_->output_surface_lost());
164 return renderer_capabilities_for_main_thread_; 167 return renderer_capabilities_for_main_thread_;
165 } 168 }
166 169
(...skipping 644 matching lines...) Expand 10 before | Expand all | Expand 10 after
811 814
812 void SingleThreadProxy::DidBeginImplFrameDeadline() { 815 void SingleThreadProxy::DidBeginImplFrameDeadline() {
813 layer_tree_host_impl_->ResetCurrentBeginFrameArgsForNextFrame(); 816 layer_tree_host_impl_->ResetCurrentBeginFrameArgsForNextFrame();
814 } 817 }
815 818
816 void SingleThreadProxy::SendBeginFramesToChildren(const BeginFrameArgs& args) { 819 void SingleThreadProxy::SendBeginFramesToChildren(const BeginFrameArgs& args) {
817 layer_tree_host_->SendBeginFramesToChildren(args); 820 layer_tree_host_->SendBeginFramesToChildren(args);
818 } 821 }
819 822
820 } // namespace cc 823 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host_unittest_context.cc ('k') | content/renderer/gpu/compositor_dependencies.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698