| 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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 if (!layer_tree_host->InitializeSingleThreaded(single_thread_client)) | 93 if (!layer_tree_host->InitializeSingleThreaded(single_thread_client)) |
| 94 return scoped_ptr<LayerTreeHost>(); | 94 return scoped_ptr<LayerTreeHost>(); |
| 95 return layer_tree_host.Pass(); | 95 return layer_tree_host.Pass(); |
| 96 } | 96 } |
| 97 | 97 |
| 98 | 98 |
| 99 LayerTreeHost::LayerTreeHost( | 99 LayerTreeHost::LayerTreeHost( |
| 100 LayerTreeHostClient* client, | 100 LayerTreeHostClient* client, |
| 101 SharedBitmapManager* manager, | 101 SharedBitmapManager* manager, |
| 102 const LayerTreeSettings& settings) | 102 const LayerTreeSettings& settings) |
| 103 : next_ui_resource_id_(1), | 103 : micro_benchmark_controller_(this), |
| 104 next_ui_resource_id_(1), |
| 104 animating_(false), | 105 animating_(false), |
| 105 needs_full_tree_sync_(true), | 106 needs_full_tree_sync_(true), |
| 106 needs_filter_context_(false), | 107 needs_filter_context_(false), |
| 107 client_(client), | 108 client_(client), |
| 108 source_frame_number_(0), | 109 source_frame_number_(0), |
| 109 rendering_stats_instrumentation_(RenderingStatsInstrumentation::Create()), | 110 rendering_stats_instrumentation_(RenderingStatsInstrumentation::Create()), |
| 110 micro_benchmark_controller_(this), | |
| 111 output_surface_can_be_initialized_(true), | 111 output_surface_can_be_initialized_(true), |
| 112 output_surface_lost_(true), | 112 output_surface_lost_(true), |
| 113 num_failed_recreate_attempts_(0), | 113 num_failed_recreate_attempts_(0), |
| 114 settings_(settings), | 114 settings_(settings), |
| 115 debug_state_(settings.initial_debug_state), | 115 debug_state_(settings.initial_debug_state), |
| 116 overdraw_bottom_height_(0.f), | 116 overdraw_bottom_height_(0.f), |
| 117 device_scale_factor_(1.f), | 117 device_scale_factor_(1.f), |
| 118 visible_(true), | 118 visible_(true), |
| 119 page_scale_factor_(1.f), | 119 page_scale_factor_(1.f), |
| 120 min_page_scale_factor_(1.f), | 120 min_page_scale_factor_(1.f), |
| (...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 418 if (sync_tree->ContentsTexturesPurged()) | 418 if (sync_tree->ContentsTexturesPurged()) |
| 419 sync_tree->ResetContentsTexturesPurged(); | 419 sync_tree->ResetContentsTexturesPurged(); |
| 420 } | 420 } |
| 421 | 421 |
| 422 if (!settings_.impl_side_painting) { | 422 if (!settings_.impl_side_painting) { |
| 423 // If we're not in impl-side painting, the tree is immediately | 423 // If we're not in impl-side painting, the tree is immediately |
| 424 // considered active. | 424 // considered active. |
| 425 sync_tree->DidBecomeActive(); | 425 sync_tree->DidBecomeActive(); |
| 426 } | 426 } |
| 427 | 427 |
| 428 micro_benchmark_controller_.ScheduleImplBenchmarks(host_impl); |
| 429 |
| 428 source_frame_number_++; | 430 source_frame_number_++; |
| 429 } | 431 } |
| 430 | 432 |
| 431 void LayerTreeHost::WillCommit() { | 433 void LayerTreeHost::WillCommit() { |
| 432 client_->WillCommit(); | 434 client_->WillCommit(); |
| 433 } | 435 } |
| 434 | 436 |
| 435 void LayerTreeHost::UpdateHudLayer() { | 437 void LayerTreeHost::UpdateHudLayer() { |
| 436 if (debug_state_.ShowHudInfo()) { | 438 if (debug_state_.ShowHudInfo()) { |
| 437 if (!hud_layer_.get()) | 439 if (!hud_layer_.get()) |
| (...skipping 820 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1258 | 1260 |
| 1259 bool LayerTreeHost::ScheduleMicroBenchmark( | 1261 bool LayerTreeHost::ScheduleMicroBenchmark( |
| 1260 const std::string& benchmark_name, | 1262 const std::string& benchmark_name, |
| 1261 scoped_ptr<base::Value> value, | 1263 scoped_ptr<base::Value> value, |
| 1262 const MicroBenchmark::DoneCallback& callback) { | 1264 const MicroBenchmark::DoneCallback& callback) { |
| 1263 return micro_benchmark_controller_.ScheduleRun( | 1265 return micro_benchmark_controller_.ScheduleRun( |
| 1264 benchmark_name, value.Pass(), callback); | 1266 benchmark_name, value.Pass(), callback); |
| 1265 } | 1267 } |
| 1266 | 1268 |
| 1267 } // namespace cc | 1269 } // namespace cc |
| OLD | NEW |