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

Unified Diff: cc/trees/layer_tree_host.cc

Issue 2654993004: Move GPU blacklist calculation to GPU proc (Closed)
Patch Set: Feedback + add rest of logic back in Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: cc/trees/layer_tree_host.cc
diff --git a/cc/trees/layer_tree_host.cc b/cc/trees/layer_tree_host.cc
index b849f50303e13ecae4e79ede5c534238c74bc4ab..afb38d964d8d399b84db8c046d00697de94d4c1a 100644
--- a/cc/trees/layer_tree_host.cc
+++ b/cc/trees/layer_tree_host.cc
@@ -309,7 +309,7 @@ void LayerTreeHost::FinishCommitOnImplThread(
host_impl->SetHasGpuRasterizationTrigger(has_gpu_rasterization_trigger_);
host_impl->SetContentIsSuitableForGpuRasterization(
content_is_suitable_for_gpu_rasterization_);
- RecordGpuRasterizationHistogram();
+ RecordGpuRasterizationHistogram(host_impl);
host_impl->SetViewportSize(layer_tree_->device_viewport_size());
sync_tree->SetDeviceScaleFactor(layer_tree_->device_scale_factor());
@@ -588,19 +588,30 @@ void LayerTreeHost::DidCompletePageScaleAnimation() {
did_complete_scale_animation_ = true;
}
-void LayerTreeHost::RecordGpuRasterizationHistogram() {
+void LayerTreeHost::RecordGpuRasterizationHistogram(
+ const LayerTreeHostImpl* host_impl) {
// Gpu rasterization is only supported for Renderer compositors.
// Checking for IsSingleThreaded() to exclude Browser compositors.
if (gpu_rasterization_histogram_recorded_ || IsSingleThreaded())
return;
+ bool gpu_rasterization_enabled = false;
+ if (host_impl->compositor_frame_sink()) {
+ ContextProvider* compositor_context_provider =
+ host_impl->compositor_frame_sink()->context_provider();
+ if (compositor_context_provider) {
+ gpu_rasterization_enabled =
+ compositor_context_provider->ContextCapabilities().gpu_rasterization;
+ }
+ }
+
// 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) {
+ gpu_rasterization_enabled);
+ if (gpu_rasterization_enabled) {
UMA_HISTOGRAM_BOOLEAN("Renderer4.GpuRasterizationTriggered",
has_gpu_rasterization_trigger_);
UMA_HISTOGRAM_BOOLEAN("Renderer4.GpuRasterizationSuitableContent",

Powered by Google App Engine
This is Rietveld 408576698