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

Unified Diff: cc/trees/layer_tree_host_impl_unittest.cc

Issue 137993013: cc: disable pre-painting when using gpu rasterization. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 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
« cc/trees/layer_tree_host_impl.cc ('K') | « cc/trees/layer_tree_host_impl.cc ('k') | no next file » | 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 f8207b54a940a1215560879d13994ca954f66818..adc2377ef0fb8ba4851410cf396e2b86f208c0ba 100644
--- a/cc/trees/layer_tree_host_impl_unittest.cc
+++ b/cc/trees/layer_tree_host_impl_unittest.cc
@@ -5035,9 +5035,14 @@ TEST_F(LayerTreeHostImplTest, MemoryPolicy) {
456, gpu::MemoryAllocation::CUTOFF_ALLOW_EVERYTHING, 1000);
int everything_cutoff_value = ManagedMemoryPolicy::PriorityCutoffToValue(
gpu::MemoryAllocation::CUTOFF_ALLOW_EVERYTHING);
+ int required_only_cutoff_value = ManagedMemoryPolicy::PriorityCutoffToValue(
+ gpu::MemoryAllocation::CUTOFF_ALLOW_REQUIRED_ONLY);
int nothing_cutoff_value = ManagedMemoryPolicy::PriorityCutoffToValue(
gpu::MemoryAllocation::CUTOFF_ALLOW_NOTHING);
+ // GPU rasterization should be disabled by default.
+ EXPECT_EQ(host_impl_->settings().gpu_rasterization, false);
+
host_impl_->SetVisible(true);
host_impl_->SetMemoryPolicy(policy1);
EXPECT_EQ(policy1.bytes_limit_when_visible, current_limit_bytes_);
@@ -5050,6 +5055,22 @@ TEST_F(LayerTreeHostImplTest, MemoryPolicy) {
host_impl_->SetVisible(true);
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,
+ // when visible.
+ LayerTreeSettings settings;
+ settings.gpu_rasterization = true;
+ host_impl_ = LayerTreeHostImpl::Create(
+ settings, this, &proxy_, &stats_instrumentation_, NULL, 0);
+
+ host_impl_->SetVisible(true);
+ host_impl_->SetMemoryPolicy(policy1);
+ EXPECT_EQ(policy1.bytes_limit_when_visible, current_limit_bytes_);
+ EXPECT_EQ(required_only_cutoff_value, current_priority_cutoff_value_);
+
+ host_impl_->SetVisible(false);
+ EXPECT_EQ(0u, current_limit_bytes_);
+ EXPECT_EQ(nothing_cutoff_value, current_priority_cutoff_value_);
}
class LayerTreeHostImplTestManageTiles : public LayerTreeHostImplTest {
« cc/trees/layer_tree_host_impl.cc ('K') | « cc/trees/layer_tree_host_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698