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 73906afdb61812a840c2ef39d88e69967bc6679e..07550414183f0f7178480fdf92b6d4cbc12e2d5d 100644 |
| --- a/cc/layers/picture_layer_impl_unittest.cc |
| +++ b/cc/layers/picture_layer_impl_unittest.cc |
| @@ -1431,6 +1431,35 @@ TEST_F(PictureLayerImplTest, DisallowTileDrawQuads) { |
| render_pass->quad_list.front()->material); |
| } |
| +TEST_F(PictureLayerImplTest, SolidColorLayerImplOnlyDrawsVisibleQuads) { |
| + scoped_ptr<RenderPass> render_pass = RenderPass::Create(); |
| + |
| + gfx::Size tile_size(1000, 1000); |
| + gfx::Size layer_bounds(1500, 1500); |
| + gfx::Rect visible_rect(1000, 1000); |
| + |
| + scoped_refptr<FakePicturePileImpl> pending_pile = |
| + FakePicturePileImpl::CreateEmptyPile(tile_size, layer_bounds); |
| + scoped_refptr<FakePicturePileImpl> active_pile = |
| + FakePicturePileImpl::CreateEmptyPile(tile_size, layer_bounds); |
| + |
| + pending_pile->set_is_solid_color(true); |
| + active_pile->set_is_solid_color(true); |
| + |
| + SetupTrees(pending_pile, active_pile); |
| + |
| + active_layer_->draw_properties().visible_content_rect = visible_rect; |
| + |
| + AppendQuadsData data; |
| + active_layer_->WillDraw(DRAW_MODE_SOFTWARE, nullptr); |
| + active_layer_->AppendQuads(render_pass.get(), Occlusion(), &data); |
| + active_layer_->DidDraw(nullptr); |
| + |
| + for (auto& quad : render_pass->quad_list) { |
| + EXPECT_TRUE(visible_rect.Contains(quad.rect)); |
|
danakj
2014/10/24 14:58:39
I think you mean Intersects here. How did you get
hendrikw
2014/10/24 15:32:15
No, I meant to use Contains, we go from left to ri
|
| + } |
| +} |
| + |
| TEST_F(PictureLayerImplTest, MarkRequiredOffscreenTiles) { |
| gfx::Size tile_size(100, 100); |
| gfx::Size layer_bounds(200, 200); |