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

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: 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_unittest.cc ('k') | content/common/gpu/client/context_provider_command_buffer.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_damage.cc
diff --git a/cc/trees/layer_tree_host_unittest_damage.cc b/cc/trees/layer_tree_host_unittest_damage.cc
index 402a56a8986f0185bc96a1b64c3b577ae661067e..58644e63b50e1c077d8f794ff39e2b54ac9645cd 100644
--- a/cc/trees/layer_tree_host_unittest_damage.cc
+++ b/cc/trees/layer_tree_host_unittest_damage.cc
@@ -23,103 +23,6 @@ namespace {
// These tests deal with damage tracking.
class LayerTreeHostDamageTest : public LayerTreeTest {};
-// Changing visibility alone does not cause drawing.
-class LayerTreeHostDamageTestSetVisibleDoesNotDraw
- : public LayerTreeHostDamageTest {
- virtual void BeginTest() OVERRIDE {
- step_ = 0;
- PostSetNeedsCommitToMainThread();
- }
-
- virtual void SetupTree() OVERRIDE {
- // Viewport is 10x10.
- scoped_refptr<FakeContentLayer> root = FakeContentLayer::Create(&client_);
- root->SetBounds(gfx::Size(10, 10));
-
- layer_tree_host()->SetRootLayer(root);
- LayerTreeHostDamageTest::SetupTree();
- }
-
- virtual bool PrepareToDrawOnThread(LayerTreeHostImpl* impl,
- LayerTreeHostImpl::FrameData* frame_data,
- bool result) OVERRIDE {
- EXPECT_TRUE(result);
-
- RenderSurfaceImpl* root_surface =
- impl->active_tree()->root_layer()->render_surface();
- gfx::RectF root_damage =
- root_surface->damage_tracker()->current_damage_rect();
-
- switch (step_) {
- 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:
- // The compositor has been set not-visible.
- EXPECT_FALSE(impl->visible());
- // This frame not visible, so not drawn.
- NOTREACHED();
- break;
- case 2:
- // The compositor has been set visible again.
- EXPECT_TRUE(impl->visible());
- // But it still does not draw.
- NOTREACHED();
- break;
- case 3:
- // Finally we force a draw, but it will have no damage.
- EXPECT_EQ(gfx::RectF().ToString(), root_damage.ToString());
- EndTest();
- break;
- case 4:
- NOTREACHED();
- }
- return result;
- }
-
- virtual void DidSetVisibleOnImplTree(LayerTreeHostImpl* impl,
- bool visible) OVERRIDE {
- if (!visible) {
- EXPECT_EQ(0, step_);
- PostSetVisibleToMainThread(true);
- } else {
- EXPECT_EQ(1, step_);
-
- base::MessageLoopProxy::current()->PostDelayedTask(
- FROM_HERE,
- base::Bind(&LayerTreeHostDamageTestSetVisibleDoesNotDraw::Redraw,
- base::Unretained(this),
- impl),
- base::TimeDelta::FromMilliseconds(10));
- }
- ++step_;
- }
-
- void Redraw(LayerTreeHostImpl* impl) {
- EXPECT_EQ(2, step_);
- impl->SetNeedsRedraw();
- ++step_;
- }
-
- virtual void AfterTest() OVERRIDE {}
-
- int step_;
- FakeContentLayerClient client_;
-};
-
-SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostDamageTestSetVisibleDoesNotDraw);
-
// LayerTreeHost::SetNeedsRedraw should damage the whole viewport.
class LayerTreeHostDamageTestSetNeedsRedraw
: public LayerTreeHostDamageTest {
« no previous file with comments | « cc/trees/layer_tree_host_unittest.cc ('k') | content/common/gpu/client/context_provider_command_buffer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698