Chromium Code Reviews| OLD | NEW |
|---|---|
| 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/layer_tree_host.h" | 5 #include "cc/trees/layer_tree_host.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <stack> | 8 #include <stack> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 376 hud_layer_->RemoveFromParent(); | 376 hud_layer_->RemoveFromParent(); |
| 377 hud_layer_ = NULL; | 377 hud_layer_ = NULL; |
| 378 } | 378 } |
| 379 } | 379 } |
| 380 | 380 |
| 381 void LayerTreeHost::CommitComplete() { | 381 void LayerTreeHost::CommitComplete() { |
| 382 source_frame_number_++; | 382 source_frame_number_++; |
| 383 client_->DidCommit(); | 383 client_->DidCommit(); |
| 384 } | 384 } |
| 385 | 385 |
| 386 scoped_ptr<OutputSurface> LayerTreeHost::CreateOutputSurface() { | 386 void LayerTreeHost::SetOutputSurface(scoped_ptr<OutputSurface> surface) { |
| 387 return client_->CreateOutputSurface(num_failed_recreate_attempts_ >= 4); | 387 proxy_->SetOutputSurface(surface.Pass()); |
| 388 } | |
| 389 | |
| 390 void LayerTreeHost::RequestNewOutputSurface() { | |
| 391 client_->RequestNewOutputSurface(num_failed_recreate_attempts_ >= 4); | |
| 388 } | 392 } |
| 389 | 393 |
| 390 scoped_ptr<LayerTreeHostImpl> LayerTreeHost::CreateLayerTreeHostImpl( | 394 scoped_ptr<LayerTreeHostImpl> LayerTreeHost::CreateLayerTreeHostImpl( |
| 391 LayerTreeHostImplClient* client) { | 395 LayerTreeHostImplClient* client) { |
| 392 DCHECK(proxy_->IsImplThread()); | 396 DCHECK(proxy_->IsImplThread()); |
| 393 scoped_ptr<LayerTreeHostImpl> host_impl = | 397 scoped_ptr<LayerTreeHostImpl> host_impl = |
| 394 LayerTreeHostImpl::Create(settings_, | 398 LayerTreeHostImpl::Create(settings_, |
| 395 client, | 399 client, |
| 396 proxy_.get(), | 400 proxy_.get(), |
| 397 rendering_stats_instrumentation_.get(), | 401 rendering_stats_instrumentation_.get(), |
| (...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 671 | 675 |
| 672 void LayerTreeHost::NotifyInputThrottledUntilCommit() { | 676 void LayerTreeHost::NotifyInputThrottledUntilCommit() { |
| 673 proxy_->NotifyInputThrottledUntilCommit(); | 677 proxy_->NotifyInputThrottledUntilCommit(); |
| 674 } | 678 } |
| 675 | 679 |
| 676 void LayerTreeHost::Composite(base::TimeTicks frame_begin_time) { | 680 void LayerTreeHost::Composite(base::TimeTicks frame_begin_time) { |
| 677 DCHECK(!proxy_->HasImplThread()); | 681 DCHECK(!proxy_->HasImplThread()); |
| 678 SingleThreadProxy* proxy = static_cast<SingleThreadProxy*>(proxy_.get()); | 682 SingleThreadProxy* proxy = static_cast<SingleThreadProxy*>(proxy_.get()); |
| 679 | 683 |
| 680 SetLayerTreeHostClientReady(); | 684 SetLayerTreeHostClientReady(); |
| 681 | 685 if (output_surface_lost_) { |
| 682 if (output_surface_lost_) | 686 RequestNewOutputSurface(); |
| 683 proxy->CreateAndInitializeOutputSurface(); | |
| 684 if (output_surface_lost_) | |
| 685 return; | 687 return; |
| 688 } | |
|
danakj
2014/06/25 17:43:09
This is a change of behaviour where if they synchr
enne (OOO)
2014/06/25 21:25:05
I'll change that back and add a comment. It shoul
| |
| 686 | 689 |
| 687 proxy->CompositeImmediately(frame_begin_time); | 690 proxy->CompositeImmediately(frame_begin_time); |
| 688 } | 691 } |
| 689 | 692 |
| 690 bool LayerTreeHost::UpdateLayers(ResourceUpdateQueue* queue) { | 693 bool LayerTreeHost::UpdateLayers(ResourceUpdateQueue* queue) { |
| 691 DCHECK(!output_surface_lost_); | 694 DCHECK(!output_surface_lost_); |
| 692 | 695 |
| 693 if (!root_layer()) | 696 if (!root_layer()) |
| 694 return false; | 697 return false; |
| 695 | 698 |
| (...skipping 561 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1257 swap_promise_list_.push_back(swap_promise.Pass()); | 1260 swap_promise_list_.push_back(swap_promise.Pass()); |
| 1258 } | 1261 } |
| 1259 | 1262 |
| 1260 void LayerTreeHost::BreakSwapPromises(SwapPromise::DidNotSwapReason reason) { | 1263 void LayerTreeHost::BreakSwapPromises(SwapPromise::DidNotSwapReason reason) { |
| 1261 for (size_t i = 0; i < swap_promise_list_.size(); i++) | 1264 for (size_t i = 0; i < swap_promise_list_.size(); i++) |
| 1262 swap_promise_list_[i]->DidNotSwap(reason); | 1265 swap_promise_list_[i]->DidNotSwap(reason); |
| 1263 swap_promise_list_.clear(); | 1266 swap_promise_list_.clear(); |
| 1264 } | 1267 } |
| 1265 | 1268 |
| 1266 } // namespace cc | 1269 } // namespace cc |
| OLD | NEW |