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 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
385 | 385 |
386 if (!settings_.impl_side_painting) { | 386 if (!settings_.impl_side_painting) { |
387 // If we're not in impl-side painting, the tree is immediately | 387 // If we're not in impl-side painting, the tree is immediately |
388 // considered active. | 388 // considered active. |
389 sync_tree->DidBecomeActive(); | 389 sync_tree->DidBecomeActive(); |
390 host_impl->ActivateAnimations(); | 390 host_impl->ActivateAnimations(); |
391 devtools_instrumentation::DidActivateLayerTree(id_, source_frame_number_); | 391 devtools_instrumentation::DidActivateLayerTree(id_, source_frame_number_); |
392 } | 392 } |
393 | 393 |
394 micro_benchmark_controller_.ScheduleImplBenchmarks(host_impl); | 394 micro_benchmark_controller_.ScheduleImplBenchmarks(host_impl); |
395 | |
396 source_frame_number_++; | |
397 } | 395 } |
398 | 396 |
399 void LayerTreeHost::WillCommit() { | 397 void LayerTreeHost::WillCommit() { |
400 client_->WillCommit(); | 398 client_->WillCommit(); |
401 } | 399 } |
402 | 400 |
403 void LayerTreeHost::UpdateHudLayer() { | 401 void LayerTreeHost::UpdateHudLayer() { |
404 if (debug_state_.ShowHudInfo()) { | 402 if (debug_state_.ShowHudInfo()) { |
405 if (!hud_layer_.get()) | 403 if (!hud_layer_.get()) |
406 hud_layer_ = HeadsUpDisplayLayer::Create(); | 404 hud_layer_ = HeadsUpDisplayLayer::Create(); |
407 | 405 |
408 if (root_layer_.get() && !hud_layer_->parent()) | 406 if (root_layer_.get() && !hud_layer_->parent()) |
409 root_layer_->AddChild(hud_layer_); | 407 root_layer_->AddChild(hud_layer_); |
410 } else if (hud_layer_.get()) { | 408 } else if (hud_layer_.get()) { |
411 hud_layer_->RemoveFromParent(); | 409 hud_layer_->RemoveFromParent(); |
412 hud_layer_ = NULL; | 410 hud_layer_ = NULL; |
413 } | 411 } |
414 } | 412 } |
415 | 413 |
416 void LayerTreeHost::CommitComplete() { | 414 void LayerTreeHost::CommitComplete() { |
415 source_frame_number_++; | |
enne (OOO)
2014/05/29 19:29:58
This is in line with test assumptions, that when D
| |
417 client_->DidCommit(); | 416 client_->DidCommit(); |
418 } | 417 } |
419 | 418 |
420 scoped_ptr<OutputSurface> LayerTreeHost::CreateOutputSurface() { | 419 scoped_ptr<OutputSurface> LayerTreeHost::CreateOutputSurface() { |
421 return client_->CreateOutputSurface(num_failed_recreate_attempts_ >= 4); | 420 return client_->CreateOutputSurface(num_failed_recreate_attempts_ >= 4); |
422 } | 421 } |
423 | 422 |
424 scoped_ptr<LayerTreeHostImpl> LayerTreeHost::CreateLayerTreeHostImpl( | 423 scoped_ptr<LayerTreeHostImpl> LayerTreeHost::CreateLayerTreeHostImpl( |
425 LayerTreeHostImplClient* client) { | 424 LayerTreeHostImplClient* client) { |
426 DCHECK(proxy_->IsImplThread()); | 425 DCHECK(proxy_->IsImplThread()); |
(...skipping 819 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1246 swap_promise_list_.push_back(swap_promise.Pass()); | 1245 swap_promise_list_.push_back(swap_promise.Pass()); |
1247 } | 1246 } |
1248 | 1247 |
1249 void LayerTreeHost::BreakSwapPromises(SwapPromise::DidNotSwapReason reason) { | 1248 void LayerTreeHost::BreakSwapPromises(SwapPromise::DidNotSwapReason reason) { |
1250 for (size_t i = 0; i < swap_promise_list_.size(); i++) | 1249 for (size_t i = 0; i < swap_promise_list_.size(); i++) |
1251 swap_promise_list_[i]->DidNotSwap(reason); | 1250 swap_promise_list_[i]->DidNotSwap(reason); |
1252 swap_promise_list_.clear(); | 1251 swap_promise_list_.clear(); |
1253 } | 1252 } |
1254 | 1253 |
1255 } // namespace cc | 1254 } // namespace cc |
OLD | NEW |