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 40c9bddb6d2560ba6e40992dec8c3f4b73dbd421..94ecb174c14ba231f2878b3986533fa04bbc50a7 100644 |
--- a/cc/trees/layer_tree_host_impl_unittest.cc |
+++ b/cc/trees/layer_tree_host_impl_unittest.cc |
@@ -1921,12 +1921,6 @@ TEST_F(LayerTreeHostImplTest, PrepareToDrawSucceedsWithMissingTiles) { |
DidDrawCheckLayer* root = |
static_cast<DidDrawCheckLayer*>(host_impl_->active_tree()->root_layer()); |
- LayerTreeHostImpl::FrameData frame; |
- EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame)); |
- host_impl_->DrawLayers(&frame, gfx::FrameTime::Now()); |
- host_impl_->DidDrawAllLayers(frame); |
- host_impl_->SwapBuffers(frame); |
- |
bool tile_missing = true; |
bool had_incomplete_tile = false; |
bool is_animating = false; |
@@ -1937,10 +1931,10 @@ TEST_F(LayerTreeHostImplTest, PrepareToDrawSucceedsWithMissingTiles) { |
had_incomplete_tile, |
is_animating, |
host_impl_->resource_provider())); |
- LayerTreeHostImpl::FrameData frame2; |
- EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame2)); |
- host_impl_->DrawLayers(&frame2, gfx::FrameTime::Now()); |
- host_impl_->DidDrawAllLayers(frame2); |
+ LayerTreeHostImpl::FrameData frame; |
+ EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame)); |
+ host_impl_->DrawLayers(&frame, gfx::FrameTime::Now()); |
+ host_impl_->DidDrawAllLayers(frame); |
} |
TEST_F(LayerTreeHostImplTest, PrepareToDrawSucceedsWithIncompleteTile) { |
@@ -1949,12 +1943,6 @@ TEST_F(LayerTreeHostImplTest, PrepareToDrawSucceedsWithIncompleteTile) { |
DidDrawCheckLayer* root = |
static_cast<DidDrawCheckLayer*>(host_impl_->active_tree()->root_layer()); |
- LayerTreeHostImpl::FrameData frame; |
- EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame)); |
- host_impl_->DrawLayers(&frame, gfx::FrameTime::Now()); |
- host_impl_->DidDrawAllLayers(frame); |
- host_impl_->SwapBuffers(frame); |
- |
bool tile_missing = false; |
bool had_incomplete_tile = true; |
bool is_animating = false; |
@@ -1965,10 +1953,10 @@ TEST_F(LayerTreeHostImplTest, PrepareToDrawSucceedsWithIncompleteTile) { |
had_incomplete_tile, |
is_animating, |
host_impl_->resource_provider())); |
- LayerTreeHostImpl::FrameData frame2; |
- EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame2)); |
- host_impl_->DrawLayers(&frame2, gfx::FrameTime::Now()); |
- host_impl_->DidDrawAllLayers(frame2); |
+ LayerTreeHostImpl::FrameData frame; |
+ EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame)); |
+ host_impl_->DrawLayers(&frame, gfx::FrameTime::Now()); |
+ host_impl_->DidDrawAllLayers(frame); |
} |
TEST_F(LayerTreeHostImplTest, |
@@ -1977,13 +1965,6 @@ TEST_F(LayerTreeHostImplTest, |
DidDrawCheckLayer::Create(host_impl_->active_tree(), 5)); |
DidDrawCheckLayer* root = |
static_cast<DidDrawCheckLayer*>(host_impl_->active_tree()->root_layer()); |
- |
- LayerTreeHostImpl::FrameData frame; |
- EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame)); |
- host_impl_->DrawLayers(&frame, gfx::FrameTime::Now()); |
- host_impl_->DidDrawAllLayers(frame); |
- host_impl_->SwapBuffers(frame); |
- |
bool tile_missing = true; |
bool had_incomplete_tile = false; |
bool is_animating = true; |
@@ -1994,11 +1975,11 @@ TEST_F(LayerTreeHostImplTest, |
had_incomplete_tile, |
is_animating, |
host_impl_->resource_provider())); |
- LayerTreeHostImpl::FrameData frame2; |
+ LayerTreeHostImpl::FrameData frame; |
EXPECT_EQ(DRAW_ABORTED_CHECKERBOARD_ANIMATIONS, |
- host_impl_->PrepareToDraw(&frame2)); |
- host_impl_->DrawLayers(&frame2, gfx::FrameTime::Now()); |
- host_impl_->DidDrawAllLayers(frame2); |
+ host_impl_->PrepareToDraw(&frame)); |
+ host_impl_->DrawLayers(&frame, gfx::FrameTime::Now()); |
+ host_impl_->DidDrawAllLayers(frame); |
} |
TEST_F(LayerTreeHostImplTest, |
@@ -2007,13 +1988,6 @@ TEST_F(LayerTreeHostImplTest, |
DidDrawCheckLayer::Create(host_impl_->active_tree(), 5)); |
DidDrawCheckLayer* root = |
static_cast<DidDrawCheckLayer*>(host_impl_->active_tree()->root_layer()); |
- |
- LayerTreeHostImpl::FrameData frame; |
- EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame)); |
- host_impl_->DrawLayers(&frame, gfx::FrameTime::Now()); |
- host_impl_->DidDrawAllLayers(frame); |
- host_impl_->SwapBuffers(frame); |
- |
bool tile_missing = false; |
bool had_incomplete_tile = true; |
bool is_animating = true; |
@@ -2024,10 +1998,10 @@ TEST_F(LayerTreeHostImplTest, |
had_incomplete_tile, |
is_animating, |
host_impl_->resource_provider())); |
- LayerTreeHostImpl::FrameData frame2; |
- EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame2)); |
- host_impl_->DrawLayers(&frame2, gfx::FrameTime::Now()); |
- host_impl_->DidDrawAllLayers(frame2); |
+ LayerTreeHostImpl::FrameData frame; |
+ EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame)); |
+ host_impl_->DrawLayers(&frame, gfx::FrameTime::Now()); |
+ host_impl_->DidDrawAllLayers(frame); |
} |
TEST_F(LayerTreeHostImplTest, PrepareToDrawSucceedsWhenHighResRequired) { |
@@ -2035,13 +2009,6 @@ TEST_F(LayerTreeHostImplTest, PrepareToDrawSucceedsWhenHighResRequired) { |
DidDrawCheckLayer::Create(host_impl_->active_tree(), 7)); |
DidDrawCheckLayer* root = |
static_cast<DidDrawCheckLayer*>(host_impl_->active_tree()->root_layer()); |
- |
- LayerTreeHostImpl::FrameData frame; |
- EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame)); |
- host_impl_->DrawLayers(&frame, gfx::FrameTime::Now()); |
- host_impl_->DidDrawAllLayers(frame); |
- host_impl_->SwapBuffers(frame); |
- |
bool tile_missing = false; |
bool had_incomplete_tile = false; |
bool is_animating = false; |
@@ -2053,10 +2020,10 @@ TEST_F(LayerTreeHostImplTest, PrepareToDrawSucceedsWhenHighResRequired) { |
is_animating, |
host_impl_->resource_provider())); |
host_impl_->active_tree()->SetRequiresHighResToDraw(); |
- LayerTreeHostImpl::FrameData frame2; |
- EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame2)); |
- host_impl_->DrawLayers(&frame2, gfx::FrameTime::Now()); |
- host_impl_->DidDrawAllLayers(frame2); |
+ LayerTreeHostImpl::FrameData frame; |
+ EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame)); |
+ host_impl_->DrawLayers(&frame, gfx::FrameTime::Now()); |
+ host_impl_->DidDrawAllLayers(frame); |
} |
TEST_F(LayerTreeHostImplTest, |
@@ -2065,13 +2032,6 @@ TEST_F(LayerTreeHostImplTest, |
DidDrawCheckLayer::Create(host_impl_->active_tree(), 7)); |
DidDrawCheckLayer* root = |
static_cast<DidDrawCheckLayer*>(host_impl_->active_tree()->root_layer()); |
- |
- LayerTreeHostImpl::FrameData frame; |
- EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame)); |
- host_impl_->DrawLayers(&frame, gfx::FrameTime::Now()); |
- host_impl_->DidDrawAllLayers(frame); |
- host_impl_->SwapBuffers(frame); |
- |
bool tile_missing = false; |
bool had_incomplete_tile = true; |
bool is_animating = false; |
@@ -2083,11 +2043,11 @@ TEST_F(LayerTreeHostImplTest, |
is_animating, |
host_impl_->resource_provider())); |
host_impl_->active_tree()->SetRequiresHighResToDraw(); |
- LayerTreeHostImpl::FrameData frame2; |
+ LayerTreeHostImpl::FrameData frame; |
EXPECT_EQ(DRAW_ABORTED_MISSING_HIGH_RES_CONTENT, |
- host_impl_->PrepareToDraw(&frame2)); |
- host_impl_->DrawLayers(&frame2, gfx::FrameTime::Now()); |
- host_impl_->DidDrawAllLayers(frame2); |
+ host_impl_->PrepareToDraw(&frame)); |
+ host_impl_->DrawLayers(&frame, gfx::FrameTime::Now()); |
+ host_impl_->DidDrawAllLayers(frame); |
} |
TEST_F(LayerTreeHostImplTest, |
@@ -2096,13 +2056,6 @@ TEST_F(LayerTreeHostImplTest, |
DidDrawCheckLayer::Create(host_impl_->active_tree(), 7)); |
DidDrawCheckLayer* root = |
static_cast<DidDrawCheckLayer*>(host_impl_->active_tree()->root_layer()); |
- |
- LayerTreeHostImpl::FrameData frame; |
- EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame)); |
- host_impl_->DrawLayers(&frame, gfx::FrameTime::Now()); |
- host_impl_->DidDrawAllLayers(frame); |
- host_impl_->SwapBuffers(frame); |
- |
bool tile_missing = true; |
bool had_incomplete_tile = false; |
bool is_animating = false; |
@@ -2114,11 +2067,11 @@ TEST_F(LayerTreeHostImplTest, |
is_animating, |
host_impl_->resource_provider())); |
host_impl_->active_tree()->SetRequiresHighResToDraw(); |
- LayerTreeHostImpl::FrameData frame2; |
+ LayerTreeHostImpl::FrameData frame; |
EXPECT_EQ(DRAW_ABORTED_MISSING_HIGH_RES_CONTENT, |
- host_impl_->PrepareToDraw(&frame2)); |
- host_impl_->DrawLayers(&frame2, gfx::FrameTime::Now()); |
- host_impl_->DidDrawAllLayers(frame2); |
+ host_impl_->PrepareToDraw(&frame)); |
+ host_impl_->DrawLayers(&frame, gfx::FrameTime::Now()); |
+ host_impl_->DidDrawAllLayers(frame); |
} |
TEST_F(LayerTreeHostImplTest, ScrollRootIgnored) { |
@@ -5936,11 +5889,7 @@ TEST_F(LayerTreeHostImplTest, MemoryPolicy) { |
TEST_F(LayerTreeHostImplTest, RequireHighResWhenVisible) { |
ASSERT_TRUE(host_impl_->active_tree()); |
- // RequiresHighResToDraw is set when new output surface is used. |
- EXPECT_TRUE(host_impl_->active_tree()->RequiresHighResToDraw()); |
- |
- host_impl_->active_tree()->ResetRequiresHighResToDraw(); |
- |
+ EXPECT_FALSE(host_impl_->active_tree()->RequiresHighResToDraw()); |
host_impl_->SetVisible(false); |
EXPECT_FALSE(host_impl_->active_tree()->RequiresHighResToDraw()); |
host_impl_->SetVisible(true); |
@@ -5948,7 +5897,8 @@ TEST_F(LayerTreeHostImplTest, RequireHighResWhenVisible) { |
host_impl_->SetVisible(false); |
EXPECT_TRUE(host_impl_->active_tree()->RequiresHighResToDraw()); |
- host_impl_->active_tree()->ResetRequiresHighResToDraw(); |
+ host_impl_->CreatePendingTree(); |
+ host_impl_->ActivateSyncTree(); |
EXPECT_FALSE(host_impl_->active_tree()->RequiresHighResToDraw()); |
host_impl_->SetVisible(true); |
@@ -5959,11 +5909,7 @@ TEST_F(LayerTreeHostImplTest, RequireHighResAfterGpuRasterizationToggles) { |
ASSERT_TRUE(host_impl_->active_tree()); |
EXPECT_FALSE(host_impl_->use_gpu_rasterization()); |
- // RequiresHighResToDraw is set when new output surface is used. |
- EXPECT_TRUE(host_impl_->active_tree()->RequiresHighResToDraw()); |
- |
- host_impl_->active_tree()->ResetRequiresHighResToDraw(); |
- |
+ EXPECT_FALSE(host_impl_->active_tree()->RequiresHighResToDraw()); |
host_impl_->SetUseGpuRasterization(false); |
EXPECT_FALSE(host_impl_->active_tree()->RequiresHighResToDraw()); |
host_impl_->SetUseGpuRasterization(true); |
@@ -5971,7 +5917,8 @@ TEST_F(LayerTreeHostImplTest, RequireHighResAfterGpuRasterizationToggles) { |
host_impl_->SetUseGpuRasterization(false); |
EXPECT_TRUE(host_impl_->active_tree()->RequiresHighResToDraw()); |
- host_impl_->active_tree()->ResetRequiresHighResToDraw(); |
+ host_impl_->CreatePendingTree(); |
+ host_impl_->ActivateSyncTree(); |
EXPECT_FALSE(host_impl_->active_tree()->RequiresHighResToDraw()); |
host_impl_->SetUseGpuRasterization(true); |