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

Unified Diff: cc/trees/layer_tree_host.cc

Issue 774413002: Update from https://crrev.com/306724 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years 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.h » ('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 c2fce2a6230b4c277c9dad1bea78c3ea613f8355..6c7cfe0e915b2b8e445b81a1f5fc59b8feb42612 100644
--- a/cc/trees/layer_tree_host.cc
+++ b/cc/trees/layer_tree_host.cc
@@ -377,6 +377,7 @@ void LayerTreeHost::FinishCommitOnImplThread(LayerTreeHostImpl* host_impl) {
sync_tree->set_sent_top_controls_delta(0.f);
host_impl->SetUseGpuRasterization(UseGpuRasterization());
+ host_impl->set_gpu_rasterization_status(GetGpuRasterizationStatus());
RecordGpuRasterizationHistogram();
host_impl->SetViewportSize(device_viewport_size_);
@@ -636,6 +637,21 @@ bool LayerTreeHost::UseGpuRasterization() const {
}
}
+GpuRasterizationStatus LayerTreeHost::GetGpuRasterizationStatus() const {
+ if (settings_.gpu_rasterization_forced) {
+ return GpuRasterizationStatus::ON_FORCED;
+ } else if (settings_.gpu_rasterization_enabled) {
+ if (!has_gpu_rasterization_trigger_) {
+ return GpuRasterizationStatus::OFF_VIEWPORT;
+ } else if (!content_is_suitable_for_gpu_rasterization_) {
+ return GpuRasterizationStatus::OFF_CONTENT;
+ } else {
+ return GpuRasterizationStatus::ON;
+ }
+ }
+ return GpuRasterizationStatus::OFF_DEVICE;
+}
+
void LayerTreeHost::SetHasGpuRasterizationTrigger(bool has_trigger) {
if (has_trigger == has_gpu_rasterization_trigger_)
return;
« no previous file with comments | « cc/trees/layer_tree_host.h ('k') | cc/trees/layer_tree_host_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698