Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(809)

Side by Side Diff: cc/trees/layer_tree_host_impl.cc

Issue 67563002: cc: Plumbing for impl thread micro benchmarks (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: speculative fix Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « cc/trees/layer_tree_host_impl.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_impl.h" 5 #include "cc/trees/layer_tree_host_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 last_sent_memory_visible_and_nearby_bytes_(0), 228 last_sent_memory_visible_and_nearby_bytes_(0),
229 last_sent_memory_use_bytes_(0), 229 last_sent_memory_use_bytes_(0),
230 zero_budget_(false), 230 zero_budget_(false),
231 device_scale_factor_(1.f), 231 device_scale_factor_(1.f),
232 overhang_ui_resource_id_(0), 232 overhang_ui_resource_id_(0),
233 overdraw_bottom_height_(0.f), 233 overdraw_bottom_height_(0.f),
234 device_viewport_valid_for_tile_management_(true), 234 device_viewport_valid_for_tile_management_(true),
235 external_stencil_test_enabled_(false), 235 external_stencil_test_enabled_(false),
236 animation_registrar_(AnimationRegistrar::Create()), 236 animation_registrar_(AnimationRegistrar::Create()),
237 rendering_stats_instrumentation_(rendering_stats_instrumentation), 237 rendering_stats_instrumentation_(rendering_stats_instrumentation),
238 micro_benchmark_controller_(this),
238 need_to_update_visible_tiles_before_draw_(false), 239 need_to_update_visible_tiles_before_draw_(false),
239 shared_bitmap_manager_(manager) { 240 shared_bitmap_manager_(manager) {
240 DCHECK(proxy_->IsImplThread()); 241 DCHECK(proxy_->IsImplThread());
241 DidVisibilityChange(this, visible_); 242 DidVisibilityChange(this, visible_);
242 243
243 SetDebugState(settings.initial_debug_state); 244 SetDebugState(settings.initial_debug_state);
244 245
245 if (settings.calculate_top_controls_position) { 246 if (settings.calculate_top_controls_position) {
246 top_controls_manager_ = 247 top_controls_manager_ =
247 TopControlsManager::Create(this, 248 TopControlsManager::Create(this,
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 NotifyReadyToActivate(); 295 NotifyReadyToActivate();
295 else 296 else
296 ManageTiles(); 297 ManageTiles();
297 } else { 298 } else {
298 active_tree_->set_needs_update_draw_properties(); 299 active_tree_->set_needs_update_draw_properties();
299 if (time_source_client_adapter_ && time_source_client_adapter_->Active()) 300 if (time_source_client_adapter_ && time_source_client_adapter_->Active())
300 DCHECK(active_tree_->root_layer()); 301 DCHECK(active_tree_->root_layer());
301 } 302 }
302 303
303 client_->SendManagedMemoryStats(); 304 client_->SendManagedMemoryStats();
305
306 micro_benchmark_controller_.DidCompleteCommit();
304 } 307 }
305 308
306 bool LayerTreeHostImpl::CanDraw() const { 309 bool LayerTreeHostImpl::CanDraw() const {
307 // Note: If you are changing this function or any other function that might 310 // Note: If you are changing this function or any other function that might
308 // affect the result of CanDraw, make sure to call 311 // affect the result of CanDraw, make sure to call
309 // client_->OnCanDrawStateChanged in the proper places and update the 312 // client_->OnCanDrawStateChanged in the proper places and update the
310 // NotifyIfCanDrawChanged test. 313 // NotifyIfCanDrawChanged test.
311 314
312 if (!renderer_) { 315 if (!renderer_) {
313 TRACE_EVENT_INSTANT0("cc", "LayerTreeHostImpl::CanDraw no renderer", 316 TRACE_EVENT_INSTANT0("cc", "LayerTreeHostImpl::CanDraw no renderer",
(...skipping 2522 matching lines...) Expand 10 before | Expand all | Expand 10 after
2836 void LayerTreeHostImpl::MarkUIResourceNotEvicted(UIResourceId uid) { 2839 void LayerTreeHostImpl::MarkUIResourceNotEvicted(UIResourceId uid) {
2837 std::set<UIResourceId>::iterator found_in_evicted = 2840 std::set<UIResourceId>::iterator found_in_evicted =
2838 evicted_ui_resources_.find(uid); 2841 evicted_ui_resources_.find(uid);
2839 if (found_in_evicted == evicted_ui_resources_.end()) 2842 if (found_in_evicted == evicted_ui_resources_.end())
2840 return; 2843 return;
2841 evicted_ui_resources_.erase(found_in_evicted); 2844 evicted_ui_resources_.erase(found_in_evicted);
2842 if (evicted_ui_resources_.empty()) 2845 if (evicted_ui_resources_.empty())
2843 client_->OnCanDrawStateChanged(CanDraw()); 2846 client_->OnCanDrawStateChanged(CanDraw());
2844 } 2847 }
2845 2848
2849 void LayerTreeHostImpl::ScheduleMicroBenchmark(
2850 scoped_ptr<MicroBenchmarkImpl> benchmark) {
2851 micro_benchmark_controller_.ScheduleRun(benchmark.Pass());
2852 }
2853
2846 } // namespace cc 2854 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698