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

Unified Diff: cc/trees/layer_tree_host_unittest_damage.cc

Issue 53633003: Do not give GPU memory to backgrounded compositors. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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
Index: cc/trees/layer_tree_host_unittest_damage.cc
diff --git a/cc/trees/layer_tree_host_unittest_damage.cc b/cc/trees/layer_tree_host_unittest_damage.cc
index 402a56a8986f0185bc96a1b64c3b577ae661067e..4c28738a9c3d9d9d2062a74a05ff9c2f038e0dee 100644
--- a/cc/trees/layer_tree_host_unittest_damage.cc
+++ b/cc/trees/layer_tree_host_unittest_damage.cc
@@ -54,15 +54,6 @@ class LayerTreeHostDamageTestSetVisibleDoesNotDraw
case 0:
// The first frame has full damage.
EXPECT_EQ(gfx::RectF(10.f, 10.f).ToString(), root_damage.ToString());
-
- // No evictions when we become not-visible.
- impl->SetMemoryPolicy(ManagedMemoryPolicy(
- 1000 * 1000 * 1000,
- gpu::MemoryAllocation::CUTOFF_ALLOW_EVERYTHING,
- 1000 * 1000 * 1000,
- gpu::MemoryAllocation::CUTOFF_ALLOW_EVERYTHING,
- ManagedMemoryPolicy::kDefaultNumResourcesLimit));
-
PostSetVisibleToMainThread(false);
break;
case 1:
@@ -74,12 +65,24 @@ class LayerTreeHostDamageTestSetVisibleDoesNotDraw
case 2:
// The compositor has been set visible again.
EXPECT_TRUE(impl->visible());
- // But it still does not draw.
- NOTREACHED();
+ if (!impl->settings().impl_side_painting) {
+ // Evicting resources for non-impl-side painting will trigger a full
+ // redraw.
+ EXPECT_EQ(gfx::RectF(10.f, 10.f).ToString(), root_damage.ToString());
+ } else {
+ // Otherwise there will be no redraw.
+ NOTREACHED();
+ }
break;
case 3:
- // Finally we force a draw, but it will have no damage.
- EXPECT_EQ(gfx::RectF().ToString(), root_damage.ToString());
+ if (impl->settings().impl_side_painting && !delegating_renderer()) {
+ // The forced draw will have full damage with a direct impl-side
+ // painting renderer.
+ EXPECT_EQ(gfx::RectF(10.f, 10.f).ToString(), root_damage.ToString());
+ } else {
+ // Finally we force a draw, but it will have no damage.
+ EXPECT_EQ(gfx::RectF().ToString(), root_damage.ToString());
+ }
EndTest();
break;
case 4:

Powered by Google App Engine
This is Rietveld 408576698