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

Unified Diff: cc/layers/picture_layer_impl_unittest.cc

Issue 2402583005: Split picture layer quads to allow removing more occluded area. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix test Created 3 years, 6 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/render_surface_impl_unittest.cc » ('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 6b326b8c96a9760207574dad21cdfd88ece48b34..894c4a45dcc820ed0153b0b3e07a184847c707c0 100644
--- a/cc/layers/picture_layer_impl_unittest.cc
+++ b/cc/layers/picture_layer_impl_unittest.cc
@@ -3102,12 +3102,27 @@ TEST_F(PictureLayerImplTest, Occlusion) {
impl.AppendQuadsWithOcclusion(active_layer(), occluded);
size_t partially_occluded_count = 0;
- LayerTestCommon::VerifyQuadsAreOccluded(
- impl.quad_list(), occluded, &partially_occluded_count);
+ LayerTestCommon::VerifyQuadsAreOccluded(impl.quad_list(), occluded, true,
+ &partially_occluded_count);
// The layer outputs one quad, which is partially occluded.
EXPECT_EQ(100u - 10u, impl.quad_list().size());
EXPECT_EQ(10u + 10u, partially_occluded_count);
}
+
+ {
+ SCOPED_TRACE("Central occlusion");
+ gfx::Rect occluded(150, 50, 200, 900);
+ impl.AppendQuadsWithOcclusion(active_layer(), occluded);
+
+ size_t partially_occluded_count = 0;
+ LayerTestCommon::VerifyQuadsAreOccluded(impl.quad_list(), occluded, true,
+ &partially_occluded_count);
+ // 8 quads in the middle are removed completely. 10 on the left and 10 on
+ // the right are occluded, as 1 on the top and 1 on the bottom. The four
+ // corners of the occluded region are each split into 2 quads.
+ EXPECT_EQ(100u - 8u + 4u, impl.quad_list().size());
+ EXPECT_EQ(10u + 10u + 4u + 2u, partially_occluded_count);
+ }
}
TEST_F(PictureLayerImplTest, RasterScaleChangeWithoutAnimation) {
« no previous file with comments | « cc/layers/picture_layer_impl.cc ('k') | cc/layers/render_surface_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698