Index: cc/trees/layer_tree_host_impl_unittest.cc |
diff --git a/cc/trees/layer_tree_host_impl_unittest.cc b/cc/trees/layer_tree_host_impl_unittest.cc |
index e96bda652331beec3aa3db7bcc2743f494624039..802b854ca792b6224641e81ee99a9361ab458436 100644 |
--- a/cc/trees/layer_tree_host_impl_unittest.cc |
+++ b/cc/trees/layer_tree_host_impl_unittest.cc |
@@ -5731,7 +5731,7 @@ TEST_F(LayerTreeHostImplTest, MemoryPolicy) { |
settings.gpu_rasterization_enabled = true; |
host_impl_ = LayerTreeHostImpl::Create( |
settings, this, &proxy_, &stats_instrumentation_, NULL, 0); |
- host_impl_->active_tree()->SetUseGpuRasterization(true); |
+ host_impl_->SetUseGpuRasterization(true); |
host_impl_->SetVisible(true); |
host_impl_->SetMemoryPolicy(policy1); |
EXPECT_EQ(policy1.bytes_limit_when_visible, current_limit_bytes_); |
@@ -5761,6 +5761,26 @@ TEST_F(LayerTreeHostImplTest, RequireHighResWhenVisible) { |
EXPECT_TRUE(host_impl_->active_tree()->RequiresHighResToDraw()); |
} |
+TEST_F(LayerTreeHostImplTest, RequireHighResAfterGpuRasterizationToggles) { |
+ ASSERT_TRUE(host_impl_->active_tree()); |
+ EXPECT_FALSE(host_impl_->use_gpu_rasterization()); |
+ |
+ EXPECT_FALSE(host_impl_->active_tree()->RequiresHighResToDraw()); |
+ host_impl_->SetUseGpuRasterization(false); |
+ EXPECT_FALSE(host_impl_->active_tree()->RequiresHighResToDraw()); |
+ host_impl_->SetUseGpuRasterization(true); |
+ EXPECT_TRUE(host_impl_->active_tree()->RequiresHighResToDraw()); |
+ host_impl_->SetUseGpuRasterization(false); |
+ EXPECT_TRUE(host_impl_->active_tree()->RequiresHighResToDraw()); |
+ |
+ host_impl_->CreatePendingTree(); |
+ host_impl_->ActivatePendingTree(); |
+ |
+ EXPECT_FALSE(host_impl_->active_tree()->RequiresHighResToDraw()); |
+ host_impl_->SetUseGpuRasterization(true); |
+ EXPECT_TRUE(host_impl_->active_tree()->RequiresHighResToDraw()); |
+} |
+ |
class LayerTreeHostImplTestManageTiles : public LayerTreeHostImplTest { |
public: |
virtual void SetUp() OVERRIDE { |