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

Unified Diff: cc/trees/single_thread_proxy.cc

Issue 478703002: Remove cc::LayerTreeHostImpl::IsContextLost (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ctx4
Patch Set: Include all changes. Prev patchset was second stage only Created 6 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
Index: cc/trees/single_thread_proxy.cc
diff --git a/cc/trees/single_thread_proxy.cc b/cc/trees/single_thread_proxy.cc
index f4007330011329151558931a8b3955779ab44ab3..1adb2706897e99d67ea81edd139531fc380b834f 100644
--- a/cc/trees/single_thread_proxy.cc
+++ b/cc/trees/single_thread_proxy.cc
@@ -316,6 +316,11 @@ void SingleThreadProxy::DidLoseOutputSurfaceOnImplThread() {
// Cause a commit so we can notice the lost context.
SetNeedsCommitOnImplThread();
danakj 2014/08/15 17:45:15 Should this move to STP::DidLoseOutputSurface (ie
dneto 2014/08/15 18:17:17 Actually we might just remove this, since LTH::Did
danakj 2014/08/15 18:18:10 Oh good SGTM
client_->DidAbortSwapBuffers();
+ // Tell the LayerTreeHost, but not right away.
+ Proxy::MainThreadTaskRunner()->PostTask(
+ FROM_HERE,
+ base::Bind(&LayerTreeHost::DidLoseOutputSurface,
danakj 2014/08/15 17:45:15 Can you add a SingleThreadProxy::DidLoseOutputSurf
dneto 2014/08/15 17:58:20 Good point. Yes, I can do this.
+ base::Unretained(layer_tree_host_)));
}
void SingleThreadProxy::DidSwapBuffersOnImplThread() {
@@ -433,12 +438,13 @@ bool SingleThreadProxy::DoComposite(base::TimeTicks frame_begin_time,
layer_tree_host_impl_->CurrentFrameTimeTicks());
UpdateBackgroundAnimateTicking();
- if (!layer_tree_host_impl_->IsContextLost()) {
- layer_tree_host_impl_->PrepareToDraw(frame);
+ DrawResult draw_result = layer_tree_host_impl_->PrepareToDraw(frame);
+ if (draw_result == DRAW_ABORTED_CONTEXT_LOST) {
+ lost_output_surface = true;
+ } else {
layer_tree_host_impl_->DrawLayers(frame, frame_begin_time);
layer_tree_host_impl_->DidDrawAllLayers(*frame);
}
- lost_output_surface = layer_tree_host_impl_->IsContextLost();
bool start_ready_animations = true;
layer_tree_host_impl_->UpdateAnimationState(start_ready_animations);
@@ -447,7 +453,6 @@ bool SingleThreadProxy::DoComposite(base::TimeTicks frame_begin_time,
}
if (lost_output_surface) {
- layer_tree_host_->DidLoseOutputSurface();
return false;
}

Powered by Google App Engine
This is Rietveld 408576698