summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoralokp@chromium.org <alokp@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-05-29 20:01:16 +0000
committeralokp@chromium.org <alokp@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-05-29 20:01:16 +0000
commitdd85d3925c0b9a3123526117f217ee5f8bac9e3b (patch)
tree3a90273b0023f34bbf09943c50189b7d0d7e9b9c
parentc135920270f3e88b9a455eeafd3f4a2d66114673 (diff)
downloadchromium_src-dd85d3925c0b9a3123526117f217ee5f8bac9e3b.zip
chromium_src-dd85d3925c0b9a3123526117f217ee5f8bac9e3b.tar.gz
chromium_src-dd85d3925c0b9a3123526117f217ee5f8bac9e3b.tar.bz2
cc: Add UMA histogram for gpu rasterization.
BUG=376811 Review URL: https://codereview.chromium.org/300003013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@273559 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--cc/trees/layer_tree_host.cc29
-rw-r--r--cc/trees/layer_tree_host.h2
2 files changed, 31 insertions, 0 deletions
diff --git a/cc/trees/layer_tree_host.cc b/cc/trees/layer_tree_host.cc
index 82a49b5..d1843f5 100644
--- a/cc/trees/layer_tree_host.cc
+++ b/cc/trees/layer_tree_host.cc
@@ -108,6 +108,7 @@ LayerTreeHost::LayerTreeHost(LayerTreeHostClient* client,
max_page_scale_factor_(1.f),
has_gpu_rasterization_trigger_(false),
content_is_suitable_for_gpu_rasterization_(true),
+ gpu_rasterization_histogram_recorded_(false),
background_color_(SK_ColorWHITE),
has_transparent_background_(false),
partial_texture_update_requests_(0),
@@ -349,6 +350,8 @@ void LayerTreeHost::FinishCommitOnImplThread(LayerTreeHostImpl* host_impl) {
sync_tree->PassSwapPromises(&swap_promise_list_);
host_impl->SetUseGpuRasterization(UseGpuRasterization());
+ RecordGpuRasterizationHistogram();
+
host_impl->SetViewportSize(device_viewport_size_);
host_impl->SetOverdrawBottomHeight(overdraw_bottom_height_);
host_impl->SetDeviceScaleFactor(device_scale_factor_);
@@ -584,6 +587,7 @@ void LayerTreeHost::SetRootLayer(scoped_refptr<Layer> root_layer) {
// Reset gpu rasterization flag.
// This flag is sticky until a new tree comes along.
content_is_suitable_for_gpu_rasterization_ = true;
+ gpu_rasterization_histogram_recorded_ = false;
SetNeedsFullTreeSync();
}
@@ -737,6 +741,31 @@ static Layer* FindFirstScrollableLayer(Layer* layer) {
return NULL;
}
+void LayerTreeHost::RecordGpuRasterizationHistogram() {
+ // Gpu rasterization is only supported when impl-side painting is enabled.
+ if (gpu_rasterization_histogram_recorded_ || !settings_.impl_side_painting)
+ return;
+
+ // Record how widely gpu rasterization is enabled.
+ // This number takes device/gpu whitelisting/backlisting into account.
+ // Note that we do not consider the forced gpu rasterization mode, which is
+ // mostly used for debugging purposes.
+ UMA_HISTOGRAM_BOOLEAN("Renderer4.GpuRasterizationEnabled",
+ settings_.gpu_rasterization_enabled);
+ if (settings_.gpu_rasterization_enabled) {
+ UMA_HISTOGRAM_BOOLEAN("Renderer4.GpuRasterizationTriggered",
+ has_gpu_rasterization_trigger_);
+ UMA_HISTOGRAM_BOOLEAN("Renderer4.GpuRasterizationSuitableContent",
+ content_is_suitable_for_gpu_rasterization_);
+ // Record how many pages actually get gpu rasterization when enabled.
+ UMA_HISTOGRAM_BOOLEAN("Renderer4.GpuRasterizationUsed",
+ (has_gpu_rasterization_trigger_ &&
+ content_is_suitable_for_gpu_rasterization_));
+ }
+
+ gpu_rasterization_histogram_recorded_ = true;
+}
+
void LayerTreeHost::CalculateLCDTextMetricsCallback(Layer* layer) {
if (!layer->SupportsLCDText())
return;
diff --git a/cc/trees/layer_tree_host.h b/cc/trees/layer_tree_host.h
index 793cd69..ef1782a 100644
--- a/cc/trees/layer_tree_host.h
+++ b/cc/trees/layer_tree_host.h
@@ -347,6 +347,7 @@ class CC_EXPORT LayerTreeHost {
typedef std::list<UIResourceRequest> UIResourceRequestQueue;
UIResourceRequestQueue ui_resource_request_queue_;
+ void RecordGpuRasterizationHistogram();
void CalculateLCDTextMetricsCallback(Layer* layer);
void NotifySwapPromiseMonitorsOfSetNeedsCommit();
@@ -392,6 +393,7 @@ class CC_EXPORT LayerTreeHost {
bool trigger_idle_updates_;
bool has_gpu_rasterization_trigger_;
bool content_is_suitable_for_gpu_rasterization_;
+ bool gpu_rasterization_histogram_recorded_;
SkColor background_color_;
bool has_transparent_background_;