summaryrefslogtreecommitdiffstats
path: root/cc/trees
diff options
context:
space:
mode:
authorjbroman <jbroman@chromium.org>2015-04-30 14:52:04 -0700
committerCommit bot <commit-bot@chromium.org>2015-04-30 21:52:36 +0000
commit5f65e5307c895198f1e0ab1f0f51410b52618fda (patch)
tree469d6dd7f40cda6eec5d47526c482d31a03db737 /cc/trees
parent62d691384096dc0051f8f2e10dd3bcb787e079e8 (diff)
downloadchromium_src-5f65e5307c895198f1e0ab1f0f51410b52618fda.zip
chromium_src-5f65e5307c895198f1e0ab1f0f51410b52618fda.tar.gz
chromium_src-5f65e5307c895198f1e0ab1f0f51410b52618fda.tar.bz2
cc: Track SkPicture memory usage of the active tree using UMA.
This change adds the Compositing.PictureMemoryUsageKb histogram, which measures the approximate memory used by SkPicture content held by the active tree. BUG=471873 Review URL: https://codereview.chromium.org/1087063002 Cr-Commit-Position: refs/heads/master@{#327794}
Diffstat (limited to 'cc/trees')
-rw-r--r--cc/trees/layer_tree_host_impl.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc
index 1b1f6fc..c900876 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -971,6 +971,14 @@ DrawResult LayerTreeHostImpl::PrepareToDraw(FrameData* frame) {
UMA_HISTOGRAM_CUSTOM_COUNTS(
"Compositing.NumActiveLayers", active_tree_->NumLayers(), 1, 400, 20);
+ size_t total_picture_memory = 0;
+ for (const PictureLayerImpl* layer : active_tree()->picture_layers())
+ total_picture_memory += layer->GetRasterSource()->GetPictureMemoryUsage();
+ if (total_picture_memory != 0) {
+ UMA_HISTOGRAM_COUNTS("Compositing.PictureMemoryUsageKb",
+ total_picture_memory / 1024);
+ }
+
bool update_lcd_text = false;
bool ok = active_tree_->UpdateDrawProperties(update_lcd_text);
DCHECK(ok) << "UpdateDrawProperties failed during draw";