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

Unified Diff: cc/layers/delegated_renderer_layer_impl_unittest.cc

Issue 447193005: Add missing transform into DelegatedRendererLayerImpl::AppendRenderPassQuads. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: avoid matrix mult when possible Created 6 years, 4 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/delegated_renderer_layer_impl.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/delegated_renderer_layer_impl_unittest.cc
diff --git a/cc/layers/delegated_renderer_layer_impl_unittest.cc b/cc/layers/delegated_renderer_layer_impl_unittest.cc
index 33082cc6d2b70345e96c1f70922ea01caa6cd28a..193b7e607bfe933f696b9ac4932c1c0aa10433d3 100644
--- a/cc/layers/delegated_renderer_layer_impl_unittest.cc
+++ b/cc/layers/delegated_renderer_layer_impl_unittest.cc
@@ -1507,6 +1507,33 @@ TEST_F(DelegatedRendererLayerImplTest, Occlusion) {
impl.quad_list()[0]->visible_rect.ToString());
}
}
+ {
+ gfx::Rect occluded(0, 0, 500, 1000);
+ // Move the occlusion to where it is in the contributing surface.
+ occluded -= quad_rect.OffsetFromOrigin() + gfx::Vector2d(11, 0);
+
+ SCOPED_TRACE("Contributing render pass with transformed root");
+
+ delegated_renderer_layer_impl->SetTransform(transform);
+ impl.CalcDrawProps(viewport_size);
+
+ impl.AppendQuadsForPassWithOcclusion(
+ delegated_renderer_layer_impl, pass2_id, occluded);
+ size_t partially_occluded_count = 0;
+ LayerTestCommon::VerifyQuadsCoverRectWithOcclusion(
+ impl.quad_list(),
+ gfx::Rect(quad_rect.size()),
+ occluded,
+ &partially_occluded_count);
+ // The layer outputs one quad, which is partially occluded.
+ EXPECT_EQ(1u, impl.quad_list().size());
+ EXPECT_EQ(1u, partially_occluded_count);
+ // The quad in the contributing surface is at (222,300) in the transformed
+ // root. The occlusion extends to 500 in the x-axis, pushing the left of the
+ // visible part of the quad to 500 - 222 = 300 - 22 inside the quad.
+ EXPECT_EQ(gfx::Rect(300 - 22, 0, 100 + 22, 500).ToString(),
+ impl.quad_list()[0]->visible_rect.ToString());
+ }
}
TEST_F(DelegatedRendererLayerImplTest, PushPropertiesTo) {
« no previous file with comments | « cc/layers/delegated_renderer_layer_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698