Chromium Code Reviews| Index: cc/layers/picture_layer_impl_unittest.cc |
| diff --git a/cc/layers/picture_layer_impl_unittest.cc b/cc/layers/picture_layer_impl_unittest.cc |
| index d67ea46232570f3714228ae5e8967d6c1dd39217..0695ba1c28c4ce191ca11a818a616cd87576d421 100644 |
| --- a/cc/layers/picture_layer_impl_unittest.cc |
| +++ b/cc/layers/picture_layer_impl_unittest.cc |
| @@ -58,8 +58,6 @@ class PictureLayerImplTest : public testing::Test { |
| host_impl_.active_tree()->LayerById(id_)); |
| SetupPendingTree(pending_pile); |
| - pending_layer_ = static_cast<FakePictureLayerImpl*>( |
| - host_impl_.pending_tree()->LayerById(id_)); |
| pending_layer_->UpdateTwinLayer(); |
| } |
| @@ -86,6 +84,9 @@ class PictureLayerImplTest : public testing::Test { |
| FakePictureLayerImpl::CreateWithPile(pending_tree, id_, pile); |
| pending_layer->SetDrawsContent(true); |
| pending_tree->SetRootLayer(pending_layer.PassAs<LayerImpl>()); |
| + |
| + pending_layer_ = static_cast<FakePictureLayerImpl*>( |
| + host_impl_.pending_tree()->LayerById(id_)); |
| } |
| static void VerifyAllTilesExistAndHavePile( |
| @@ -806,5 +807,25 @@ TEST_F(PictureLayerImplTest, DisallowTileDrawQuads) { |
| EXPECT_EQ(DrawQuad::PICTURE_CONTENT, quad_culler.quad_list()[0]->material); |
| } |
| +TEST_F(PictureLayerImplTest, MarkRequiredNullTiles) { |
| + gfx::Size tile_size(100, 100); |
| + gfx::Size layer_bounds(1000, 1000); |
| + |
| + scoped_refptr<FakePicturePileImpl> pending_pile = |
| + FakePicturePileImpl::CreateEmptyPile(tile_size, layer_bounds); |
| + // Layers with entirely empty piles can't get tilings. |
| + pending_pile->AddRecordingAt(0, 0); |
|
danakj
2013/05/29 00:11:47
From holiday: do you need to add recording? Or cou
enne (OOO)
2013/05/29 00:14:29
Yes. CanHaveTilings() is false if the pile's reco
danakj
2013/05/29 10:39:34
I see. I guess its just nonobvious that there are
|
| + |
| + SetupPendingTree(pending_pile); |
| + |
| + ASSERT_TRUE(pending_layer_->CanHaveTilings()); |
| + pending_layer_->AddTiling(1.0f); |
| + pending_layer_->AddTiling(2.0f); |
| + |
| + // It should be safe to call this (and MarkVisibleResourcesAsRequired) |
|
danakj
2013/05/29 00:11:47
Can you verify that the tilings were not added? Nu
enne (OOO)
2013/05/29 00:14:29
The tilings are supposed to be there, it's that th
danakj
2013/05/29 10:39:34
Oh sorry, right.
|
| + // on a layer with no recordings. |
| + host_impl_.pending_tree()->UpdateDrawProperties(); |
| +} |
| + |
| } // namespace |
| } // namespace cc |