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

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

Issue 1906523002: cc: Add UMA histogram for the number of render surfaces (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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.cc » ('j') | tools/metrics/histograms/histograms.xml » ('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 <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 1036 matching lines...) Expand 10 before | Expand all | Expand 10 after
1047 } 1047 }
1048 1048
1049 DrawResult LayerTreeHostImpl::PrepareToDraw(FrameData* frame) { 1049 DrawResult LayerTreeHostImpl::PrepareToDraw(FrameData* frame) {
1050 TRACE_EVENT1("cc", 1050 TRACE_EVENT1("cc",
1051 "LayerTreeHostImpl::PrepareToDraw", 1051 "LayerTreeHostImpl::PrepareToDraw",
1052 "SourceFrameNumber", 1052 "SourceFrameNumber",
1053 active_tree_->source_frame_number()); 1053 active_tree_->source_frame_number());
1054 if (input_handler_client_) 1054 if (input_handler_client_)
1055 input_handler_client_->ReconcileElasticOverscrollAndRootScroll(); 1055 input_handler_client_->ReconcileElasticOverscrollAndRootScroll();
1056 1056
1057 UMA_HISTOGRAM_CUSTOM_COUNTS(
1058 "Compositing.NumActiveLayers",
1059 base::saturated_cast<int>(active_tree_->NumLayers()), 1, 400, 20);
1060
1061 if (const char* client_name = GetClientNameForMetrics()) { 1057 if (const char* client_name = GetClientNameForMetrics()) {
1062 size_t total_picture_memory = 0; 1058 size_t total_picture_memory = 0;
1063 for (const PictureLayerImpl* layer : active_tree()->picture_layers()) 1059 for (const PictureLayerImpl* layer : active_tree()->picture_layers())
1064 total_picture_memory += layer->GetRasterSource()->GetPictureMemoryUsage(); 1060 total_picture_memory += layer->GetRasterSource()->GetPictureMemoryUsage();
1065 if (total_picture_memory != 0) { 1061 if (total_picture_memory != 0) {
1066 // GetClientNameForMetrics only returns one non-null value over the 1062 // GetClientNameForMetrics only returns one non-null value over the
1067 // lifetime of the process, so this histogram name is runtime constant. 1063 // lifetime of the process, so this histogram name is runtime constant.
1068 UMA_HISTOGRAM_COUNTS( 1064 UMA_HISTOGRAM_COUNTS(
1069 base::StringPrintf("Compositing.%s.PictureMemoryUsageKb", 1065 base::StringPrintf("Compositing.%s.PictureMemoryUsageKb",
1070 client_name), 1066 client_name),
1071 base::saturated_cast<int>(total_picture_memory / 1024)); 1067 base::saturated_cast<int>(total_picture_memory / 1024));
1072 } 1068 }
1069 UMA_HISTOGRAM_CUSTOM_COUNTS(
Alexei Svitkine (slow) 2016/04/20 15:40:30 Please add the same comment above this block as th
ajuma 2016/04/20 15:52:10 Done.
1070 base::StringPrintf("Compositing.%s.NumActiveLayers", client_name),
1071 base::saturated_cast<int>(active_tree_->NumLayers()), 1, 400, 20);
1073 } 1072 }
1074 1073
1075 bool update_lcd_text = false; 1074 bool update_lcd_text = false;
1076 bool ok = active_tree_->UpdateDrawProperties(update_lcd_text); 1075 bool ok = active_tree_->UpdateDrawProperties(update_lcd_text);
1077 DCHECK(ok) << "UpdateDrawProperties failed during draw"; 1076 DCHECK(ok) << "UpdateDrawProperties failed during draw";
1078 1077
1079 // This will cause NotifyTileStateChanged() to be called for any tiles that 1078 // This will cause NotifyTileStateChanged() to be called for any tiles that
1080 // completed, which will add damage for visible tiles to the frame for them so 1079 // completed, which will add damage for visible tiles to the frame for them so
1081 // they appear as part of the current frame being drawn. 1080 // they appear as part of the current frame being drawn.
1082 tile_manager_->Flush(); 1081 tile_manager_->Flush();
(...skipping 2860 matching lines...) Expand 10 before | Expand all | Expand 10 after
3943 return task_runner_provider_->HasImplThread(); 3942 return task_runner_provider_->HasImplThread();
3944 } 3943 }
3945 3944
3946 bool LayerTreeHostImpl::CommitToActiveTree() const { 3945 bool LayerTreeHostImpl::CommitToActiveTree() const {
3947 // In single threaded mode we skip the pending tree and commit directly to the 3946 // In single threaded mode we skip the pending tree and commit directly to the
3948 // active tree. 3947 // active tree.
3949 return !task_runner_provider_->HasImplThread(); 3948 return !task_runner_provider_->HasImplThread();
3950 } 3949 }
3951 3950
3952 } // namespace cc 3951 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/trees/layer_tree_impl.cc » ('j') | tools/metrics/histograms/histograms.xml » ('J')

Powered by Google App Engine
This is Rietveld 408576698