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

Unified Diff: cc/layers/solid_color_layer_impl_unittest.cc

Issue 201153021: cc: Apply occlusion before creating quads in TextureLayerImpl. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: append-texture: year Created 6 years, 9 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/io_surface_layer_impl_unittest.cc ('k') | cc/layers/texture_layer_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/solid_color_layer_impl_unittest.cc
diff --git a/cc/layers/solid_color_layer_impl_unittest.cc b/cc/layers/solid_color_layer_impl_unittest.cc
index 6045d6bb0efff46a7a4fbf1b2b405eda83ce30e0..713e8fba06826061edfc91d3b88073b3e14a8bd5 100644
--- a/cc/layers/solid_color_layer_impl_unittest.cc
+++ b/cc/layers/solid_color_layer_impl_unittest.cc
@@ -170,8 +170,6 @@ TEST(SolidColorLayerImplTest, Occlusion) {
gfx::Size viewport_size(1000, 1000);
LayerTestCommon::LayerImplTest impl;
- MockQuadCuller quad_culler;
- AppendQuadsData data;
SolidColorLayerImpl* solid_color_layer_impl =
impl.AddChildToRoot<SolidColorLayerImpl>();
@@ -183,45 +181,38 @@ TEST(SolidColorLayerImplTest, Occlusion) {
impl.CalcDrawProps(viewport_size);
- // No occlusion.
{
+ SCOPED_TRACE("No occlusion");
gfx::Rect occluded;
- quad_culler.clear_lists();
- quad_culler.set_occluded_content_rect(occluded);
- solid_color_layer_impl->AppendQuads(&quad_culler, &data);
+ impl.AppendQuadsWithOcclusion(solid_color_layer_impl, occluded);
- LayerTestCommon::VerifyQuadsExactlyCoverRect(quad_culler.quad_list(),
- gfx::Rect(viewport_size));
- EXPECT_EQ(16u, quad_culler.quad_list().size());
+ LayerTestCommon::VerifyQuadsExactlyCoverRect(impl.quad_list(),
+ gfx::Rect(layer_size));
+ EXPECT_EQ(16u, impl.quad_list().size());
}
- // Full occlusion.
{
- gfx::Rect occluded = solid_color_layer_impl->visible_content_rect();
- quad_culler.clear_lists();
- quad_culler.set_occluded_content_rect(occluded);
- solid_color_layer_impl->AppendQuads(&quad_culler, &data);
-
- LayerTestCommon::VerifyQuadsExactlyCoverRect(quad_culler.quad_list(),
- gfx::Rect());
- EXPECT_EQ(quad_culler.quad_list().size(), 0u);
+ SCOPED_TRACE("Full occlusion");
+ gfx::Rect occluded(solid_color_layer_impl->visible_content_rect());
+ impl.AppendQuadsWithOcclusion(solid_color_layer_impl, occluded);
+
+ LayerTestCommon::VerifyQuadsExactlyCoverRect(impl.quad_list(), gfx::Rect());
+ EXPECT_EQ(impl.quad_list().size(), 0u);
}
- // Partial occlusion.
{
+ SCOPED_TRACE("Partial occlusion");
gfx::Rect occluded(200, 200, 256 * 3, 256 * 3);
- quad_culler.clear_lists();
- quad_culler.set_occluded_content_rect(occluded);
- solid_color_layer_impl->AppendQuads(&quad_culler, &data);
+ impl.AppendQuadsWithOcclusion(solid_color_layer_impl, occluded);
size_t partially_occluded_count = 0;
LayerTestCommon::VerifyQuadsCoverRectWithOcclusion(
- quad_culler.quad_list(),
- gfx::Rect(viewport_size),
+ impl.quad_list(),
+ gfx::Rect(layer_size),
occluded,
&partially_occluded_count);
// 4 quads are completely occluded, 8 are partially occluded.
- EXPECT_EQ(16u - 4u, quad_culler.quad_list().size());
+ EXPECT_EQ(16u - 4u, impl.quad_list().size());
EXPECT_EQ(8u, partially_occluded_count);
}
}
« no previous file with comments | « cc/layers/io_surface_layer_impl_unittest.cc ('k') | cc/layers/texture_layer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698