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

Unified Diff: cc/layers/picture_layer_impl_unittest.cc

Issue 675903002: cc: SolidColorLayerImpl::AppendSolidQuads takes the visible content rect (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed the correct visiblerect thing this time :) Created 6 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/layers/picture_layer_impl.cc ('k') | cc/layers/solid_color_layer_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « cc/layers/picture_layer_impl.cc ('k') | cc/layers/solid_color_layer_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698