Index: cc/trees/layer_tree_host.cc |
diff --git a/cc/trees/layer_tree_host.cc b/cc/trees/layer_tree_host.cc |
index 48604f7e9760172cf3d48f6f48ed22696201e318..f27b9afcfc9475ac96547f4737386520219ef7d6 100644 |
--- a/cc/trees/layer_tree_host.cc |
+++ b/cc/trees/layer_tree_host.cc |
@@ -388,7 +388,9 @@ void LayerTreeHost::SetOutputSurface(scoped_ptr<OutputSurface> surface) { |
DCHECK(output_surface_lost_); |
DCHECK(surface); |
- proxy_->SetOutputSurface(surface.Pass()); |
+ DCHECK(!new_output_surface_); |
+ new_output_surface_ = surface.Pass(); |
+ proxy_->SetOutputSurface(new_output_surface_.get()); |
} |
void LayerTreeHost::RequestNewOutputSurface() { |
@@ -396,12 +398,17 @@ void LayerTreeHost::RequestNewOutputSurface() { |
} |
void LayerTreeHost::DidInitializeOutputSurface() { |
+ DCHECK(new_output_surface_); |
output_surface_lost_ = false; |
client_->DidInitializeOutputSurface(); |
+ current_output_surface_ = new_output_surface_.Pass(); |
} |
void LayerTreeHost::DidFailToInitializeOutputSurface() { |
DCHECK(output_surface_lost_); |
+ DCHECK(new_output_surface_); |
+ new_output_surface_ = nullptr; |
+ current_output_surface_ = nullptr; |
danakj
2015/09/12 00:09:14
can you leave a comment that if initialize fails,
reveman
2015/09/12 12:49:57
Yes, thanks for pointing that out. Added a comment
|
client_->DidFailToInitializeOutputSurface(); |
} |