diff options
-rw-r--r-- | cc/trees/layer_tree_host_impl.cc | 8 | ||||
-rw-r--r-- | cc/trees/layer_tree_host_impl_unittest.cc | 12 |
2 files changed, 10 insertions, 10 deletions
diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc index 1cd0d05..171880e 100644 --- a/cc/trees/layer_tree_host_impl.cc +++ b/cc/trees/layer_tree_host_impl.cc @@ -1770,13 +1770,13 @@ void LayerTreeHostImpl::SetNeedsRedraw() { ManagedMemoryPolicy LayerTreeHostImpl::ActualManagedMemoryPolicy() const { ManagedMemoryPolicy actual = cached_managed_memory_policy_; - // TODO(ernstm): NICE_TO_HAVE is currently triggered for forced GPU - // rasterization only. Change the trigger to LTHI::UseGpuRasterization, once - // that is implemented. + bool any_tree_use_gpu_rasterization = + (active_tree_ && active_tree_->use_gpu_rasterization()) || + (pending_tree_ && pending_tree_->use_gpu_rasterization()); if (debug_state_.rasterize_only_visible_content) { actual.priority_cutoff_when_visible = gpu::MemoryAllocation::CUTOFF_ALLOW_REQUIRED_ONLY; - } else if (settings_.gpu_rasterization_forced) { + } else if (any_tree_use_gpu_rasterization) { actual.priority_cutoff_when_visible = gpu::MemoryAllocation::CUTOFF_ALLOW_NICE_TO_HAVE; } diff --git a/cc/trees/layer_tree_host_impl_unittest.cc b/cc/trees/layer_tree_host_impl_unittest.cc index 02f383f..3181410 100644 --- a/cc/trees/layer_tree_host_impl_unittest.cc +++ b/cc/trees/layer_tree_host_impl_unittest.cc @@ -5767,9 +5767,9 @@ TEST_F(LayerTreeHostImplTest, MemoryPolicy) { int nothing_cutoff_value = ManagedMemoryPolicy::PriorityCutoffToValue( gpu::MemoryAllocation::CUTOFF_ALLOW_NOTHING); - // GPU rasterization should be disabled by default. - EXPECT_FALSE(host_impl_->settings().gpu_rasterization_enabled); - EXPECT_FALSE(host_impl_->settings().gpu_rasterization_forced); + // GPU rasterization should be disabled by default on the tree(s) + EXPECT_FALSE(host_impl_->active_tree()->use_gpu_rasterization()); + EXPECT_TRUE(host_impl_->pending_tree() == NULL); host_impl_->SetVisible(true); host_impl_->SetMemoryPolicy(policy1); @@ -5784,13 +5784,13 @@ TEST_F(LayerTreeHostImplTest, MemoryPolicy) { EXPECT_EQ(policy1.bytes_limit_when_visible, current_limit_bytes_); EXPECT_EQ(everything_cutoff_value, current_priority_cutoff_value_); - // Now enable GPU rasterization and test if we get required only cutoff, + // Now enable GPU rasterization and test if we get nice to have cutoff, // when visible. LayerTreeSettings settings; - settings.gpu_rasterization_forced = true; + settings.gpu_rasterization_enabled = true; host_impl_ = LayerTreeHostImpl::Create( settings, this, &proxy_, &stats_instrumentation_, NULL, 0); - + host_impl_->active_tree()->SetUseGpuRasterization(true); host_impl_->SetVisible(true); host_impl_->SetMemoryPolicy(policy1); EXPECT_EQ(policy1.bytes_limit_when_visible, current_limit_bytes_); |