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

Unified Diff: cc/trees/layer_tree_host_impl_unittest.cc

Issue 290573007: cc: Move gpu rasterization flag from tree-impl to tree-host-impl. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 7 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_impl.cc ('k') | cc/trees/layer_tree_host_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 {
« no previous file with comments | « cc/trees/layer_tree_host_impl.cc ('k') | cc/trees/layer_tree_host_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698