| Index: cc/trees/layer_tree_host.cc
|
| diff --git a/cc/trees/layer_tree_host.cc b/cc/trees/layer_tree_host.cc
|
| index eed1e5a7e151e74942e0b78d54b96f38a2f2874d..78373c769b6058d8bf647b1e8f5579ff81e33225 100644
|
| --- a/cc/trees/layer_tree_host.cc
|
| +++ b/cc/trees/layer_tree_host.cc
|
| @@ -413,8 +413,12 @@ void LayerTreeHost::CommitComplete() {
|
| client_->DidCommit();
|
| }
|
|
|
| -scoped_ptr<OutputSurface> LayerTreeHost::CreateOutputSurface() {
|
| - return client_->CreateOutputSurface(num_failed_recreate_attempts_ >= 4);
|
| +void LayerTreeHost::SetOutputSurface(scoped_ptr<OutputSurface> surface) {
|
| + proxy_->SetOutputSurface(surface.Pass());
|
| +}
|
| +
|
| +void LayerTreeHost::RequestNewOutputSurface() {
|
| + client_->RequestNewOutputSurface(num_failed_recreate_attempts_ >= 4);
|
| }
|
|
|
| scoped_ptr<LayerTreeHostImpl> LayerTreeHost::CreateLayerTreeHostImpl(
|
| @@ -718,11 +722,13 @@ void LayerTreeHost::Composite(base::TimeTicks frame_begin_time) {
|
| SingleThreadProxy* proxy = static_cast<SingleThreadProxy*>(proxy_.get());
|
|
|
| SetLayerTreeHostClientReady();
|
| -
|
| - if (output_surface_lost_)
|
| - proxy->CreateAndInitializeOutputSurface();
|
| - if (output_surface_lost_)
|
| - return;
|
| + if (output_surface_lost_) {
|
| + RequestNewOutputSurface();
|
| + // RequestNewOutputSurface could have synchronously created an output
|
| + // surface, so check again before returning.
|
| + if (output_surface_lost_)
|
| + return;
|
| + }
|
|
|
| proxy->CompositeImmediately(frame_begin_time);
|
| }
|
|
|