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

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: Update comment in histograms.xml to say the stat is collected once per frame, before the frame is d… 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') | 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 1084 matching lines...) Expand 10 before | Expand all | Expand 10 after
1095 "LayerTreeHostImpl::PrepareToDraw", 1095 "LayerTreeHostImpl::PrepareToDraw",
1096 "SourceFrameNumber", 1096 "SourceFrameNumber",
1097 active_tree_->source_frame_number()); 1097 active_tree_->source_frame_number());
1098 1098
1099 if (need_to_update_visible_tiles_before_draw_ && 1099 if (need_to_update_visible_tiles_before_draw_ &&
1100 tile_manager_ && tile_manager_->UpdateVisibleTiles()) { 1100 tile_manager_ && tile_manager_->UpdateVisibleTiles()) {
1101 DidInitializeVisibleTile(); 1101 DidInitializeVisibleTile();
1102 } 1102 }
1103 need_to_update_visible_tiles_before_draw_ = true; 1103 need_to_update_visible_tiles_before_draw_ = true;
1104 1104
1105 UMA_HISTOGRAM_CUSTOM_COUNTS(
1106 "Compositing.NumActiveLayers", active_tree_->NumLayers(), 1, 400, 20);
1107
1105 bool ok = active_tree_->UpdateDrawProperties(); 1108 bool ok = active_tree_->UpdateDrawProperties();
1106 DCHECK(ok) << "UpdateDrawProperties failed during draw"; 1109 DCHECK(ok) << "UpdateDrawProperties failed during draw";
1107 1110
1108 frame->render_surface_layer_list = &active_tree_->RenderSurfaceLayerList(); 1111 frame->render_surface_layer_list = &active_tree_->RenderSurfaceLayerList();
1109 frame->render_passes.clear(); 1112 frame->render_passes.clear();
1110 frame->render_passes_by_id.clear(); 1113 frame->render_passes_by_id.clear();
1111 frame->will_draw_layers.clear(); 1114 frame->will_draw_layers.clear();
1112 frame->contains_incomplete_tile = false; 1115 frame->contains_incomplete_tile = false;
1113 frame->has_no_damage = false; 1116 frame->has_no_damage = false;
1114 1117
(...skipping 2131 matching lines...) Expand 10 before | Expand all | Expand 10 after
3246 } 3249 }
3247 3250
3248 void LayerTreeHostImpl::UnregisterPictureLayerImpl(PictureLayerImpl* layer) { 3251 void LayerTreeHostImpl::UnregisterPictureLayerImpl(PictureLayerImpl* layer) {
3249 std::vector<PictureLayerImpl*>::iterator it = 3252 std::vector<PictureLayerImpl*>::iterator it =
3250 std::find(picture_layers_.begin(), picture_layers_.end(), layer); 3253 std::find(picture_layers_.begin(), picture_layers_.end(), layer);
3251 DCHECK(it != picture_layers_.end()); 3254 DCHECK(it != picture_layers_.end());
3252 picture_layers_.erase(it); 3255 picture_layers_.erase(it);
3253 } 3256 }
3254 3257
3255 } // namespace cc 3258 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/trees/layer_tree_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698