summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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_;