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..57a01ad8dc9a00d7879dcd4bef982fcfa804c0e6 100644 |
--- a/cc/layers/picture_layer_impl_unittest.cc |
+++ b/cc/layers/picture_layer_impl_unittest.cc |
@@ -1431,6 +1431,33 @@ 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(1000000, 1000000); |
+ 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(); |
+ active_pile->set_is_solid_color(); |
+ |
+ SetupTrees(pending_pile, active_pile); |
+ |
+ 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/23 23:38:21
the visible_rect is not used at all except here. h
hendrikw
2014/10/23 23:53:48
My bad, I meant to remove the one below, and keep
|
+ } |
+} |
+ |
TEST_F(PictureLayerImplTest, MarkRequiredOffscreenTiles) { |
gfx::Size tile_size(100, 100); |
gfx::Size layer_bounds(200, 200); |
@@ -4400,6 +4427,7 @@ void PictureLayerImplTest::TestQuadsForSolidColor(bool test_for_solid) { |
scoped_ptr<RenderPass> render_pass = RenderPass::Create(); |
AppendQuadsData data; |
+ active_layer_->draw_properties().visible_content_rect = layer_rect; |
danakj
2014/10/23 23:38:21
why isn't this set by updatedrawproperties?
do yo
|
active_layer_->WillDraw(DRAW_MODE_SOFTWARE, nullptr); |
active_layer_->AppendQuads(render_pass.get(), Occlusion(), &data); |
active_layer_->DidDraw(nullptr); |