Index: cc/surfaces/surface_aggregator_unittest.cc |
diff --git a/cc/surfaces/surface_aggregator_unittest.cc b/cc/surfaces/surface_aggregator_unittest.cc |
index 1dff7ec2c22bce2cecdf0d7631a35d12737fe0a2..cf54568cd6f9e0a58f67cf87af1719840416deb9 100644 |
--- a/cc/surfaces/surface_aggregator_unittest.cc |
+++ b/cc/surfaces/surface_aggregator_unittest.cc |
@@ -939,9 +939,13 @@ TEST_F(SurfaceAggregatorValidSurfaceTest, AggregateMultiplePassWithTransform) { |
} |
// Root surface. |
- test::Quad root_quads[] = {test::Quad::SolidColorQuad(1), |
- test::Quad::SurfaceQuad(middle_surface_id, 1.f)}; |
- test::Pass root_passes[] = {test::Pass(root_quads, arraysize(root_quads))}; |
+ test::Quad secondary_quads[] = { |
+ test::Quad::SolidColorQuad(1), |
+ test::Quad::SurfaceQuad(middle_surface_id, 1.f)}; |
+ test::Quad root_quads[] = {test::Quad::SolidColorQuad(1)}; |
+ test::Pass root_passes[] = { |
+ test::Pass(secondary_quads, arraysize(secondary_quads)), |
+ test::Pass(root_quads, arraysize(root_quads))}; |
RenderPassList root_pass_list; |
AddPasses(&root_pass_list, |
@@ -958,6 +962,8 @@ TEST_F(SurfaceAggregatorValidSurfaceTest, AggregateMultiplePassWithTransform) { |
root_pass_list.at(0)->quad_list.ElementAt(1)->visible_rect = |
gfx::Rect(0, 0, 8, 100); |
+ root_pass_list[0]->transform_to_root_target.Translate(10, 5); |
+ |
scoped_ptr<DelegatedFrameData> root_frame_data(new DelegatedFrameData); |
root_pass_list.swap(root_frame_data->render_pass_list); |
@@ -977,17 +983,19 @@ TEST_F(SurfaceAggregatorValidSurfaceTest, AggregateMultiplePassWithTransform) { |
const RenderPassList& aggregated_pass_list = frame_data->render_pass_list; |
- ASSERT_EQ(2u, aggregated_pass_list.size()); |
+ ASSERT_EQ(3u, aggregated_pass_list.size()); |
ASSERT_EQ(1u, aggregated_pass_list[0]->shared_quad_state_list.size()); |
// The first pass should have one shared quad state for the one solid color |
// quad. |
EXPECT_EQ(1u, aggregated_pass_list[0]->shared_quad_state_list.size()); |
- // The second (root) pass should have just two shared quad states. We'll |
+ // The second pass should have just two shared quad states. We'll |
// verify the properties through the quads. |
EXPECT_EQ(2u, aggregated_pass_list[1]->shared_quad_state_list.size()); |
+ EXPECT_EQ(1u, aggregated_pass_list[2]->shared_quad_state_list.size()); |
+ |
SharedQuadState* aggregated_first_pass_sqs = |
aggregated_pass_list[0]->shared_quad_state_list.front(); |
@@ -999,8 +1007,9 @@ TEST_F(SurfaceAggregatorValidSurfaceTest, AggregateMultiplePassWithTransform) { |
aggregated_first_pass_sqs->content_to_target_transform.ToString()); |
// The first pass's transform to the root target should include the aggregated |
- // transform. |
+ // transform, including the transform from the child pass to the root. |
gfx::Transform expected_first_pass_transform_to_root_target; |
+ expected_first_pass_transform_to_root_target.Translate(10, 5); |
expected_first_pass_transform_to_root_target.Translate(0, 10); |
expected_first_pass_transform_to_root_target.Scale(2, 3); |
expected_first_pass_transform_to_root_target.Translate(8, 0); |