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

Unified Diff: cc/trees/layer_tree_host_unittest.cc

Issue 53633003: Do not give GPU memory to backgrounded compositors. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove test Created 7 years, 2 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_pixeltest_on_demand_raster.cc ('k') | cc/trees/layer_tree_host_unittest_damage.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/layer_tree_host_unittest.cc
diff --git a/cc/trees/layer_tree_host_unittest.cc b/cc/trees/layer_tree_host_unittest.cc
index 13467cbb32dca05a33891d239a96ce973a7aa52e..c0e40c64d95f7570c14ec377fa1256901f3b18a1 100644
--- a/cc/trees/layer_tree_host_unittest.cc
+++ b/cc/trees/layer_tree_host_unittest.cc
@@ -1903,7 +1903,6 @@ class LayerTreeHostTestSurfaceNotAllocatedForLayersOutsideMemoryLimit
// surface. This prevents any contents drawing into surfaces
// from being allocated.
host_impl->SetMemoryPolicy(ManagedMemoryPolicy(100 * 100 * 4 * 2));
- host_impl->SetDiscardBackBufferWhenNotVisible(true);
break;
case 1:
EXPECT_FALSE(renderer->HasAllocatedResourcesForTesting(
@@ -2431,9 +2430,17 @@ class LayerTreeHostTestShutdownWithOnlySomeResourcesEvicted
virtual void DidSetVisibleOnImplTree(LayerTreeHostImpl* host_impl,
bool visible) OVERRIDE {
- // One backing should remain unevicted.
- EXPECT_EQ(100u * 100u * 4u * 1u,
- layer_tree_host()->contents_texture_manager()->MemoryUseBytes());
+ if (visible) {
+ // One backing should remain unevicted.
+ EXPECT_EQ(
+ 100u * 100u * 4u * 1u,
+ layer_tree_host()->contents_texture_manager()->MemoryUseBytes());
+ } else {
+ EXPECT_EQ(
+ 0u,
+ layer_tree_host()->contents_texture_manager()->MemoryUseBytes());
+ }
+
// Make sure that contents textures are marked as having been
// purged.
EXPECT_TRUE(host_impl->active_tree()->ContentsTexturesPurged());
@@ -2454,10 +2461,7 @@ class LayerTreeHostTestShutdownWithOnlySomeResourcesEvicted
host_impl->SetMemoryPolicy(
ManagedMemoryPolicy(100 * 100 * 4 * 2,
gpu::MemoryAllocation::CUTOFF_ALLOW_EVERYTHING,
- 100 * 100 * 4 * 1,
- gpu::MemoryAllocation::CUTOFF_ALLOW_EVERYTHING,
1000));
- host_impl->SetDiscardBackBufferWhenNotVisible(true);
break;
case 2:
// Only two backings should have memory.
@@ -4978,8 +4982,6 @@ class LayerTreeHostTestMemoryLimits : public LayerTreeHostTest {
impl->SetMemoryPolicy(ManagedMemoryPolicy(
16u*1024u*1024u,
gpu::MemoryAllocation::CUTOFF_ALLOW_NICE_TO_HAVE,
- 0,
- gpu::MemoryAllocation::CUTOFF_ALLOW_NOTHING,
1000));
break;
case 2:
@@ -4988,8 +4990,6 @@ class LayerTreeHostTestMemoryLimits : public LayerTreeHostTest {
impl->SetMemoryPolicy(ManagedMemoryPolicy(
32u*1024u*1024u,
gpu::MemoryAllocation::CUTOFF_ALLOW_NICE_TO_HAVE,
- 0,
- gpu::MemoryAllocation::CUTOFF_ALLOW_NOTHING,
1000));
break;
case 3:
@@ -5142,8 +5142,6 @@ class LayerTreeHostTestSetMemoryPolicyOnLostOutputSurface
second_output_surface_memory_limit_ :
first_output_surface_memory_limit_,
gpu::MemoryAllocation::CUTOFF_ALLOW_NICE_TO_HAVE,
- 0,
- gpu::MemoryAllocation::CUTOFF_ALLOW_NOTHING,
ManagedMemoryPolicy::kDefaultNumResourcesLimit)));
return output_surface.PassAs<OutputSurface>();
}
« no previous file with comments | « cc/trees/layer_tree_host_pixeltest_on_demand_raster.cc ('k') | cc/trees/layer_tree_host_unittest_damage.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698