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

Unified Diff: cc/trees/layer_tree_host.cc

Issue 2654993004: Move GPU blacklist calculation to GPU proc (Closed)
Patch Set: fix win clang build Created 3 years, 10 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
« no previous file with comments | « cc/trees/layer_tree_host.h ('k') | cc/trees/layer_tree_host_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/layer_tree_host.cc
diff --git a/cc/trees/layer_tree_host.cc b/cc/trees/layer_tree_host.cc
index efc38ca7dd5920b6949169f4841ae2853f19557b..c0425180ad777b2a0bfe41e6dda4852e1f7b20a1 100644
--- a/cc/trees/layer_tree_host.cc
+++ b/cc/trees/layer_tree_host.cc
@@ -299,7 +299,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(device_viewport_size_);
sync_tree->SetDeviceScaleFactor(device_scale_factor_);
@@ -578,19 +578,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",
« no previous file with comments | « cc/trees/layer_tree_host.h ('k') | cc/trees/layer_tree_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698