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

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

Issue 375093002: Initial attempt at counting layers in the compositor thread. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use LayerTreeImpl::layer_id_map_.size() and fix histogram name Created 6 years, 5 months 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
« no previous file with comments | « no previous file | cc/trees/layer_tree_impl.h » ('j') | cc/trees/layer_tree_impl.h » ('J')
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 1083 matching lines...) Expand 10 before | Expand all | Expand 10 after
1094 "LayerTreeHostImpl::PrepareToDraw", 1094 "LayerTreeHostImpl::PrepareToDraw",
1095 "SourceFrameNumber", 1095 "SourceFrameNumber",
1096 active_tree_->source_frame_number()); 1096 active_tree_->source_frame_number());
1097 1097
1098 if (need_to_update_visible_tiles_before_draw_ && 1098 if (need_to_update_visible_tiles_before_draw_ &&
1099 tile_manager_ && tile_manager_->UpdateVisibleTiles()) { 1099 tile_manager_ && tile_manager_->UpdateVisibleTiles()) {
1100 DidInitializeVisibleTile(); 1100 DidInitializeVisibleTile();
1101 } 1101 }
1102 need_to_update_visible_tiles_before_draw_ = true; 1102 need_to_update_visible_tiles_before_draw_ = true;
1103 1103
1104 // Use a bucket width of 10 (i.e. 1000/100) to better
danakj 2014/07/10 21:27:44 I'm not sure what this comment is saying? That you
dneto 2014/07/11 15:23:30 The 1 is min, the 1000 is max, and 10 is the numbe
danakj 2014/07/11 15:27:20 Ok how about 1, 400, 20? And we can drop the comme
1105 // capture the expected case where there are few layers.
1106 UMA_HISTOGRAM_CUSTOM_COUNTS(
1107 "Compositing.NumActiveLayers", active_tree_->NumLayers(), 1, 1000, 100);
dneto 2014/07/10 21:20:11 This is the corrected name for the UMA, matching t
1108
1104 bool ok = active_tree_->UpdateDrawProperties(); 1109 bool ok = active_tree_->UpdateDrawProperties();
1105 DCHECK(ok) << "UpdateDrawProperties failed during draw"; 1110 DCHECK(ok) << "UpdateDrawProperties failed during draw";
1106 1111
1107 frame->render_surface_layer_list = &active_tree_->RenderSurfaceLayerList(); 1112 frame->render_surface_layer_list = &active_tree_->RenderSurfaceLayerList();
1108 frame->render_passes.clear(); 1113 frame->render_passes.clear();
1109 frame->render_passes_by_id.clear(); 1114 frame->render_passes_by_id.clear();
1110 frame->will_draw_layers.clear(); 1115 frame->will_draw_layers.clear();
1111 frame->contains_incomplete_tile = false; 1116 frame->contains_incomplete_tile = false;
1112 frame->has_no_damage = false; 1117 frame->has_no_damage = false;
1113 1118
(...skipping 2128 matching lines...) Expand 10 before | Expand all | Expand 10 after
3242 } 3247 }
3243 3248
3244 void LayerTreeHostImpl::UnregisterPictureLayerImpl(PictureLayerImpl* layer) { 3249 void LayerTreeHostImpl::UnregisterPictureLayerImpl(PictureLayerImpl* layer) {
3245 std::vector<PictureLayerImpl*>::iterator it = 3250 std::vector<PictureLayerImpl*>::iterator it =
3246 std::find(picture_layers_.begin(), picture_layers_.end(), layer); 3251 std::find(picture_layers_.begin(), picture_layers_.end(), layer);
3247 DCHECK(it != picture_layers_.end()); 3252 DCHECK(it != picture_layers_.end());
3248 picture_layers_.erase(it); 3253 picture_layers_.erase(it);
3249 } 3254 }
3250 3255
3251 } // namespace cc 3256 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/trees/layer_tree_impl.h » ('j') | cc/trees/layer_tree_impl.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698