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

Unified Diff: cc/trees/single_thread_proxy.cc

Issue 2270573002: cc: Get rid of LayerTreeHost::output_surface_lost_ state. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@renderer-caps
Patch Set: lth-outputsurface-lost: android-build-and-earlyout-sooner Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/trees/single_thread_proxy.h ('k') | content/browser/renderer_host/compositor_impl_android.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/single_thread_proxy.cc
diff --git a/cc/trees/single_thread_proxy.cc b/cc/trees/single_thread_proxy.cc
index 2a53ef6d0628899ba3bfd37d73595a9262f9f54a..81f09c5a9957acbf9fbc56a8b5ff8194a5da930f 100644
--- a/cc/trees/single_thread_proxy.cc
+++ b/cc/trees/single_thread_proxy.cc
@@ -50,6 +50,7 @@ SingleThreadProxy::SingleThreadProxy(LayerTreeHost* layer_tree_host,
commit_requested_(false),
inside_synchronous_composite_(false),
output_surface_creation_requested_(false),
+ output_surface_lost_(true),
weak_factory_(this) {
TRACE_EVENT0("cc", "SingleThreadProxy::SingleThreadProxy");
DCHECK(task_runner_provider_);
@@ -131,7 +132,6 @@ void SingleThreadProxy::SetVisible(bool visible) {
void SingleThreadProxy::RequestNewOutputSurface() {
DCHECK(task_runner_provider_->IsMainThread());
- DCHECK(layer_tree_host_->output_surface_lost());
output_surface_creation_callback_.Cancel();
if (output_surface_creation_requested_)
return;
@@ -140,9 +140,7 @@ void SingleThreadProxy::RequestNewOutputSurface() {
}
void SingleThreadProxy::ReleaseOutputSurface() {
- // |layer_tree_host_| should already be aware of this.
- DCHECK(layer_tree_host_->output_surface_lost());
-
+ output_surface_lost_ = true;
if (scheduler_on_impl_thread_)
scheduler_on_impl_thread_->DidLoseOutputSurface();
return layer_tree_host_impl_->ReleaseOutputSurface();
@@ -150,7 +148,6 @@ void SingleThreadProxy::ReleaseOutputSurface() {
void SingleThreadProxy::SetOutputSurface(OutputSurface* output_surface) {
DCHECK(task_runner_provider_->IsMainThread());
- DCHECK(layer_tree_host_->output_surface_lost());
DCHECK(output_surface_creation_requested_);
bool success;
@@ -167,6 +164,7 @@ void SingleThreadProxy::SetOutputSurface(OutputSurface* output_surface) {
else if (!inside_synchronous_composite_)
SetNeedsCommit();
output_surface_creation_requested_ = false;
+ output_surface_lost_ = false;
} else {
// DidFailToInitializeOutputSurface is treated as a RequestNewOutputSurface,
// and so output_surface_creation_requested remains true.
@@ -461,6 +459,7 @@ void SingleThreadProxy::DidLoseOutputSurfaceOnImplThread() {
client_->DidAbortSwapBuffers();
if (scheduler_on_impl_thread_)
scheduler_on_impl_thread_->DidLoseOutputSurface();
+ output_surface_lost_ = true;
}
void SingleThreadProxy::CommitVSyncParameters(base::TimeTicks timebase,
@@ -505,11 +504,11 @@ void SingleThreadProxy::CompositeImmediately(base::TimeTicks frame_begin_time) {
#endif
base::AutoReset<bool> inside_composite(&inside_synchronous_composite_, true);
- if (layer_tree_host_->output_surface_lost()) {
+ if (output_surface_lost_) {
RequestNewOutputSurface();
// RequestNewOutputSurface could have synchronously created an output
// surface, so check again before returning.
- if (layer_tree_host_->output_surface_lost())
+ if (output_surface_lost_)
return;
}
@@ -581,7 +580,6 @@ void SingleThreadProxy::ScheduleRequestNewOutputSurface() {
DrawResult SingleThreadProxy::DoComposite(LayerTreeHostImpl::FrameData* frame) {
TRACE_EVENT0("cc", "SingleThreadProxy::DoComposite");
- DCHECK(!layer_tree_host_->output_surface_lost());
DrawResult draw_result;
bool draw_frame;
@@ -685,8 +683,6 @@ void SingleThreadProxy::DidCommitAndDrawFrame() {
}
bool SingleThreadProxy::MainFrameWillHappenForTesting() {
- if (layer_tree_host_->output_surface_lost())
- return false;
if (!scheduler_on_impl_thread_)
return false;
return scheduler_on_impl_thread_->MainFrameForTestingWillHappen();
@@ -754,14 +750,6 @@ void SingleThreadProxy::BeginMainFrame(const BeginFrameArgs& begin_frame_args) {
return;
}
- if (layer_tree_host_->output_surface_lost()) {
- TRACE_EVENT_INSTANT0("cc", "EarlyOut_OutputSurfaceLost",
- TRACE_EVENT_SCOPE_THREAD);
- BeginMainFrameAbortedOnImplThread(
- CommitEarlyOutReason::ABORTED_OUTPUT_SURFACE_LOST);
- return;
- }
-
// Prevent new commits from being requested inside DoBeginMainFrame.
// Note: We do not want to prevent SetNeedsAnimate from requesting
// a commit here.
« no previous file with comments | « cc/trees/single_thread_proxy.h ('k') | content/browser/renderer_host/compositor_impl_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698