diff options
author | awoloszyn <awoloszyn@chromium.org> | 2014-12-22 07:40:00 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-12-22 15:40:46 +0000 |
commit | e83f28ca816694be553baed069f784eb286d8170 (patch) | |
tree | d574779de5f809f7760ceb9d90bd86496469fe29 /cc/trees/layer_tree_impl_unittest.cc | |
parent | 73b32fca8ed133af29af871d2108f9ea5de7f0bf (diff) | |
download | chromium_src-e83f28ca816694be553baed069f784eb286d8170.zip chromium_src-e83f28ca816694be553baed069f784eb286d8170.tar.gz chromium_src-e83f28ca816694be553baed069f784eb286d8170.tar.bz2 |
Move RenderSurface creation outside of CalcDrawProps
BUG=386788
Review URL: https://codereview.chromium.org/465853004
Cr-Commit-Position: refs/heads/master@{#309428}
Diffstat (limited to 'cc/trees/layer_tree_impl_unittest.cc')
-rw-r--r-- | cc/trees/layer_tree_impl_unittest.cc | 578 |
1 files changed, 153 insertions, 425 deletions
diff --git a/cc/trees/layer_tree_impl_unittest.cc b/cc/trees/layer_tree_impl_unittest.cc index 78d72de..2c5dd05 100644 --- a/cc/trees/layer_tree_impl_unittest.cc +++ b/cc/trees/layer_tree_impl_unittest.cc @@ -50,13 +50,8 @@ TEST_F(LayerTreeImplTest, HitTestingForSingleLayer) { gfx::Point3F transform_origin; gfx::PointF position; gfx::Size bounds(100, 100); - SetLayerPropertiesForTesting(root.get(), - identity_matrix, - transform_origin, - position, - bounds, - true, - false); + SetLayerPropertiesForTesting(root.get(), identity_matrix, transform_origin, + position, bounds, true, false, true); root->SetDrawsContent(true); host_impl().SetViewportSize(root->bounds()); @@ -102,24 +97,14 @@ TEST_F(LayerTreeImplTest, HitTestingForSingleLayerAndHud) { gfx::Point3F transform_origin; gfx::PointF position; gfx::Size bounds(100, 100); - SetLayerPropertiesForTesting(root.get(), - identity_matrix, - transform_origin, - position, - bounds, - true, - false); + SetLayerPropertiesForTesting(root.get(), identity_matrix, transform_origin, + position, bounds, true, false, true); root->SetDrawsContent(true); // Create hud and add it as a child of root. gfx::Size hud_bounds(200, 200); - SetLayerPropertiesForTesting(hud.get(), - identity_matrix, - transform_origin, - position, - hud_bounds, - true, - false); + SetLayerPropertiesForTesting(hud.get(), identity_matrix, transform_origin, + position, hud_bounds, true, false, false); hud->SetDrawsContent(true); host_impl().active_tree()->set_hud_layer(hud.get()); @@ -174,13 +159,9 @@ TEST_F(LayerTreeImplTest, HitTestingForUninvertibleTransform) { gfx::Point3F transform_origin; gfx::PointF position; gfx::Size bounds(100, 100); - SetLayerPropertiesForTesting(root.get(), - uninvertible_transform, - transform_origin, - position, - bounds, - true, - false); + SetLayerPropertiesForTesting(root.get(), uninvertible_transform, + transform_origin, position, bounds, true, false, + true); root->SetDrawsContent(true); host_impl().SetViewportSize(root->bounds()); @@ -240,13 +221,8 @@ TEST_F(LayerTreeImplTest, HitTestingForSinglePositionedLayer) { // layer is located. gfx::PointF position(50.f, 50.f); gfx::Size bounds(100, 100); - SetLayerPropertiesForTesting(root.get(), - identity_matrix, - transform_origin, - position, - bounds, - true, - false); + SetLayerPropertiesForTesting(root.get(), identity_matrix, transform_origin, + position, bounds, true, false, true); root->SetDrawsContent(true); host_impl().SetViewportSize(root->bounds()); @@ -296,13 +272,9 @@ TEST_F(LayerTreeImplTest, HitTestingForSingleRotatedLayer) { gfx::Point3F transform_origin; gfx::PointF position; gfx::Size bounds(100, 100); - SetLayerPropertiesForTesting(root.get(), - rotation45_degrees_about_center, - transform_origin, - position, - bounds, - true, - false); + SetLayerPropertiesForTesting(root.get(), rotation45_degrees_about_center, + transform_origin, position, bounds, true, false, + true); root->SetDrawsContent(true); host_impl().SetViewportSize(root->bounds()); @@ -365,13 +337,8 @@ TEST_F(LayerTreeImplTest, HitTestingForSinglePerspectiveLayer) { gfx::PointF position; gfx::Size bounds(100, 100); SetLayerPropertiesForTesting( - root.get(), - perspective_projection_about_center * translation_by_z, - transform_origin, - position, - bounds, - true, - false); + root.get(), perspective_projection_about_center * translation_by_z, + transform_origin, position, bounds, true, false, true); root->SetDrawsContent(true); host_impl().SetViewportSize(root->bounds()); @@ -426,25 +393,17 @@ TEST_F(LayerTreeImplTest, HitTestingForSingleLayerWithScaledContents) { gfx::Transform identity_matrix; gfx::Point3F transform_origin; - SetLayerPropertiesForTesting(root.get(), - identity_matrix, - transform_origin, - gfx::PointF(), - gfx::Size(100, 100), - true, - false); + SetLayerPropertiesForTesting(root.get(), identity_matrix, transform_origin, + gfx::PointF(), gfx::Size(100, 100), true, false, + true); { gfx::PointF position(25.f, 25.f); gfx::Size bounds(50, 50); scoped_ptr<LayerImpl> test_layer = LayerImpl::Create(host_impl().active_tree(), 12345); - SetLayerPropertiesForTesting(test_layer.get(), - identity_matrix, - transform_origin, - position, - bounds, - true, - false); + SetLayerPropertiesForTesting(test_layer.get(), identity_matrix, + transform_origin, position, bounds, true, + false, false); // override content bounds and contents scale test_layer->SetContentBounds(gfx::Size(100, 100)); @@ -506,13 +465,9 @@ TEST_F(LayerTreeImplTest, HitTestingForSimpleClippedLayer) { gfx::Point3F transform_origin; scoped_ptr<LayerImpl> root = LayerImpl::Create(host_impl().active_tree(), 1); - SetLayerPropertiesForTesting(root.get(), - identity_matrix, - transform_origin, - gfx::PointF(), - gfx::Size(100, 100), - true, - false); + SetLayerPropertiesForTesting(root.get(), identity_matrix, transform_origin, + gfx::PointF(), gfx::Size(100, 100), true, false, + true); { scoped_ptr<LayerImpl> clipping_layer = LayerImpl::Create(host_impl().active_tree(), 123); @@ -520,26 +475,17 @@ TEST_F(LayerTreeImplTest, HitTestingForSimpleClippedLayer) { // layer is located. gfx::PointF position(25.f, 25.f); gfx::Size bounds(50, 50); - SetLayerPropertiesForTesting(clipping_layer.get(), - identity_matrix, - transform_origin, - position, - bounds, - true, - false); + SetLayerPropertiesForTesting(clipping_layer.get(), identity_matrix, + transform_origin, position, bounds, true, + false, false); clipping_layer->SetMasksToBounds(true); scoped_ptr<LayerImpl> child = LayerImpl::Create(host_impl().active_tree(), 456); position = gfx::PointF(-50.f, -50.f); bounds = gfx::Size(300, 300); - SetLayerPropertiesForTesting(child.get(), - identity_matrix, - transform_origin, - position, - bounds, - true, - false); + SetLayerPropertiesForTesting(child.get(), identity_matrix, transform_origin, + position, bounds, true, false, false); child->SetDrawsContent(true); clipping_layer->AddChild(child.Pass()); root->AddChild(clipping_layer.Pass()); @@ -601,13 +547,8 @@ TEST_F(LayerTreeImplTest, HitTestingForMultiClippedRotatedLayer) { gfx::Point3F transform_origin; gfx::PointF position; gfx::Size bounds(100, 100); - SetLayerPropertiesForTesting(root.get(), - identity_matrix, - transform_origin, - position, - bounds, - true, - false); + SetLayerPropertiesForTesting(root.get(), identity_matrix, transform_origin, + position, bounds, true, false, true); root->SetMasksToBounds(true); { scoped_ptr<LayerImpl> child = @@ -619,13 +560,8 @@ TEST_F(LayerTreeImplTest, HitTestingForMultiClippedRotatedLayer) { position = gfx::PointF(10.f, 10.f); bounds = gfx::Size(80, 80); - SetLayerPropertiesForTesting(child.get(), - identity_matrix, - transform_origin, - position, - bounds, - true, - false); + SetLayerPropertiesForTesting(child.get(), identity_matrix, transform_origin, + position, bounds, true, false, false); child->SetMasksToBounds(true); gfx::Transform rotation45_degrees_about_corner; @@ -636,13 +572,9 @@ TEST_F(LayerTreeImplTest, HitTestingForMultiClippedRotatedLayer) { position = gfx::PointF(); bounds = gfx::Size(200, 200); // to ensure it covers at least sqrt(2) * 100. - SetLayerPropertiesForTesting(grand_child.get(), - rotation45_degrees_about_corner, - transform_origin, - position, - bounds, - true, - false); + SetLayerPropertiesForTesting( + grand_child.get(), rotation45_degrees_about_corner, transform_origin, + position, bounds, true, false, false); grand_child->SetMasksToBounds(true); // Rotates about the center of the layer @@ -656,13 +588,9 @@ TEST_F(LayerTreeImplTest, HitTestingForMultiClippedRotatedLayer) { rotated_leaf_transform.Translate(-50.0, -50.0); position = gfx::PointF(); bounds = gfx::Size(100, 100); - SetLayerPropertiesForTesting(rotated_leaf.get(), - rotated_leaf_transform, - transform_origin, - position, - bounds, - true, - false); + SetLayerPropertiesForTesting(rotated_leaf.get(), rotated_leaf_transform, + transform_origin, position, bounds, true, + false, false); rotated_leaf->SetDrawsContent(true); grand_child->AddChild(rotated_leaf.Pass()); @@ -674,27 +602,6 @@ TEST_F(LayerTreeImplTest, HitTestingForMultiClippedRotatedLayer) { host_impl().active_tree()->SetRootLayer(root.Pass()); host_impl().UpdateNumChildrenAndDrawPropertiesForActiveTree(); - // Sanity check the scenario we just created. - // The grand_child is expected to create a render surface because it - // MasksToBounds and is not axis aligned. - ASSERT_EQ(2u, RenderSurfaceLayerList().size()); - ASSERT_EQ( - 1u, - RenderSurfaceLayerList().at(0)->render_surface()->layer_list().size()); - ASSERT_EQ(789, - RenderSurfaceLayerList() - .at(0) - ->render_surface() - ->layer_list() - .at(0) - ->id()); // grand_child's surface. - ASSERT_EQ( - 1u, - RenderSurfaceLayerList().at(1)->render_surface()->layer_list().size()); - ASSERT_EQ( - 2468, - RenderSurfaceLayerList()[1]->render_surface()->layer_list().at(0)->id()); - // (11, 89) is close to the the bottom left corner within the clip, but it is // not inside the layer. gfx::Point test_point(11, 89); @@ -749,13 +656,9 @@ TEST_F(LayerTreeImplTest, HitTestingForNonClippingIntermediateLayer) { gfx::Point3F transform_origin; scoped_ptr<LayerImpl> root = LayerImpl::Create(host_impl().active_tree(), 1); - SetLayerPropertiesForTesting(root.get(), - identity_matrix, - transform_origin, - gfx::PointF(), - gfx::Size(100, 100), - true, - false); + SetLayerPropertiesForTesting(root.get(), identity_matrix, transform_origin, + gfx::PointF(), gfx::Size(100, 100), true, false, + true); { scoped_ptr<LayerImpl> intermediate_layer = LayerImpl::Create(host_impl().active_tree(), 123); @@ -763,13 +666,9 @@ TEST_F(LayerTreeImplTest, HitTestingForNonClippingIntermediateLayer) { // layer is located. gfx::PointF position(10.f, 10.f); gfx::Size bounds(50, 50); - SetLayerPropertiesForTesting(intermediate_layer.get(), - identity_matrix, - transform_origin, - position, - bounds, - true, - false); + SetLayerPropertiesForTesting(intermediate_layer.get(), identity_matrix, + transform_origin, position, bounds, true, + false, false); // Sanity check the intermediate layer should not clip. ASSERT_FALSE(intermediate_layer->masks_to_bounds()); ASSERT_FALSE(intermediate_layer->mask_layer()); @@ -781,13 +680,8 @@ TEST_F(LayerTreeImplTest, HitTestingForNonClippingIntermediateLayer) { LayerImpl::Create(host_impl().active_tree(), 456); position = gfx::PointF(60.f, 60.f); // 70, 70 in screen space bounds = gfx::Size(20, 20); - SetLayerPropertiesForTesting(child.get(), - identity_matrix, - transform_origin, - position, - bounds, - true, - false); + SetLayerPropertiesForTesting(child.get(), identity_matrix, transform_origin, + position, bounds, true, false, false); child->SetDrawsContent(true); intermediate_layer->AddChild(child.Pass()); root->AddChild(intermediate_layer.Pass()); @@ -834,13 +728,8 @@ TEST_F(LayerTreeImplTest, HitTestingForMultipleLayers) { gfx::Point3F transform_origin; gfx::PointF position; gfx::Size bounds(100, 100); - SetLayerPropertiesForTesting(root.get(), - identity_matrix, - transform_origin, - position, - bounds, - true, - false); + SetLayerPropertiesForTesting(root.get(), identity_matrix, transform_origin, + position, bounds, true, false, true); root->SetDrawsContent(true); { // child 1 and child2 are initialized to overlap between x=50 and x=60. @@ -858,24 +747,16 @@ TEST_F(LayerTreeImplTest, HitTestingForMultipleLayers) { position = gfx::PointF(10.f, 10.f); bounds = gfx::Size(50, 50); - SetLayerPropertiesForTesting(child1.get(), - identity_matrix, - transform_origin, - position, - bounds, - true, - false); + SetLayerPropertiesForTesting(child1.get(), identity_matrix, + transform_origin, position, bounds, true, + false, false); child1->SetDrawsContent(true); position = gfx::PointF(50.f, 10.f); bounds = gfx::Size(50, 50); - SetLayerPropertiesForTesting(child2.get(), - identity_matrix, - transform_origin, - position, - bounds, - true, - false); + SetLayerPropertiesForTesting(child2.get(), identity_matrix, + transform_origin, position, bounds, true, + false, false); child2->SetDrawsContent(true); // Remember that grand_child is positioned with respect to its parent (i.e. @@ -883,13 +764,9 @@ TEST_F(LayerTreeImplTest, HitTestingForMultipleLayers) { // 100 x 50. position = gfx::PointF(0.f, 40.f); bounds = gfx::Size(100, 50); - SetLayerPropertiesForTesting(grand_child1.get(), - identity_matrix, - transform_origin, - position, - bounds, - true, - false); + SetLayerPropertiesForTesting(grand_child1.get(), identity_matrix, + transform_origin, position, bounds, true, + false, false); grand_child1->SetDrawsContent(true); child1->AddChild(grand_child1.Pass()); @@ -973,13 +850,8 @@ TEST_F(LayerTreeImplTest, HitTestingForMultipleLayersAtVaryingDepths) { gfx::Point3F transform_origin; gfx::PointF position; gfx::Size bounds(100, 100); - SetLayerPropertiesForTesting(root.get(), - identity_matrix, - transform_origin, - position, - bounds, - true, - false); + SetLayerPropertiesForTesting(root.get(), identity_matrix, transform_origin, + position, bounds, true, false, true); root->SetDrawsContent(true); root->SetShouldFlattenTransform(false); root->Set3dSortingContextId(1); @@ -999,13 +871,9 @@ TEST_F(LayerTreeImplTest, HitTestingForMultipleLayersAtVaryingDepths) { position = gfx::PointF(10.f, 10.f); bounds = gfx::Size(50, 50); - SetLayerPropertiesForTesting(child1.get(), - identity_matrix, - transform_origin, - position, - bounds, - true, - false); + SetLayerPropertiesForTesting(child1.get(), identity_matrix, + transform_origin, position, bounds, true, + false, false); child1->SetDrawsContent(true); child1->SetShouldFlattenTransform(false); child1->Set3dSortingContextId(1); @@ -1014,13 +882,8 @@ TEST_F(LayerTreeImplTest, HitTestingForMultipleLayersAtVaryingDepths) { bounds = gfx::Size(50, 50); gfx::Transform translate_z; translate_z.Translate3d(0, 0, -10.f); - SetLayerPropertiesForTesting(child2.get(), - translate_z, - transform_origin, - position, - bounds, - true, - false); + SetLayerPropertiesForTesting(child2.get(), translate_z, transform_origin, + position, bounds, true, false, false); child2->SetDrawsContent(true); child2->SetShouldFlattenTransform(false); child2->Set3dSortingContextId(1); @@ -1030,13 +893,9 @@ TEST_F(LayerTreeImplTest, HitTestingForMultipleLayersAtVaryingDepths) { // 100 x 50. position = gfx::PointF(0.f, 40.f); bounds = gfx::Size(100, 50); - SetLayerPropertiesForTesting(grand_child1.get(), - identity_matrix, - transform_origin, - position, - bounds, - true, - false); + SetLayerPropertiesForTesting(grand_child1.get(), identity_matrix, + transform_origin, position, bounds, true, + false, false); grand_child1->SetDrawsContent(true); grand_child1->SetShouldFlattenTransform(false); @@ -1122,13 +981,8 @@ TEST_F(LayerTreeImplTest, HitTestingRespectsClipParents) { gfx::Point3F transform_origin; gfx::PointF position; gfx::Size bounds(100, 100); - SetLayerPropertiesForTesting(root.get(), - identity_matrix, - transform_origin, - position, - bounds, - true, - false); + SetLayerPropertiesForTesting(root.get(), identity_matrix, transform_origin, + position, bounds, true, false, true); root->SetDrawsContent(true); { scoped_ptr<LayerImpl> child = @@ -1138,27 +992,18 @@ TEST_F(LayerTreeImplTest, HitTestingRespectsClipParents) { position = gfx::PointF(10.f, 10.f); bounds = gfx::Size(1, 1); - SetLayerPropertiesForTesting(child.get(), - identity_matrix, - transform_origin, - position, - bounds, - true, - false); + SetLayerPropertiesForTesting(child.get(), identity_matrix, transform_origin, + position, bounds, true, false, false); child->SetDrawsContent(true); child->SetMasksToBounds(true); position = gfx::PointF(0.f, 40.f); bounds = gfx::Size(100, 50); - SetLayerPropertiesForTesting(grand_child.get(), - identity_matrix, - transform_origin, - position, - bounds, - true, - false); + SetLayerPropertiesForTesting(grand_child.get(), identity_matrix, + transform_origin, position, bounds, true, + false, false); grand_child->SetDrawsContent(true); - grand_child->SetForceRenderSurface(true); + grand_child->SetHasRenderSurface(true); // This should let |grand_child| "escape" |child|'s clip. grand_child->SetClipParent(root.get()); @@ -1184,13 +1029,8 @@ TEST_F(LayerTreeImplTest, HitTestingRespectsScrollParents) { gfx::Point3F transform_origin; gfx::PointF position; gfx::Size bounds(100, 100); - SetLayerPropertiesForTesting(root.get(), - identity_matrix, - transform_origin, - position, - bounds, - true, - false); + SetLayerPropertiesForTesting(root.get(), identity_matrix, transform_origin, + position, bounds, true, false, true); root->SetDrawsContent(true); { scoped_ptr<LayerImpl> child = @@ -1202,40 +1042,27 @@ TEST_F(LayerTreeImplTest, HitTestingRespectsScrollParents) { position = gfx::PointF(10.f, 10.f); bounds = gfx::Size(1, 1); - SetLayerPropertiesForTesting(child.get(), - identity_matrix, - transform_origin, - position, - bounds, - true, - false); + SetLayerPropertiesForTesting(child.get(), identity_matrix, transform_origin, + position, bounds, true, false, false); child->SetDrawsContent(true); child->SetMasksToBounds(true); position = gfx::PointF(); bounds = gfx::Size(200, 200); - SetLayerPropertiesForTesting(scroll_child.get(), - identity_matrix, - transform_origin, - position, - bounds, - true, - false); + SetLayerPropertiesForTesting(scroll_child.get(), identity_matrix, + transform_origin, position, bounds, true, + false, false); scroll_child->SetDrawsContent(true); // This should cause scroll child and its descendants to be affected by // |child|'s clip. scroll_child->SetScrollParent(child.get()); - SetLayerPropertiesForTesting(grand_child.get(), - identity_matrix, - transform_origin, - position, - bounds, - true, - false); + SetLayerPropertiesForTesting(grand_child.get(), identity_matrix, + transform_origin, position, bounds, true, + false, false); grand_child->SetDrawsContent(true); - grand_child->SetForceRenderSurface(true); + grand_child->SetHasRenderSurface(true); scroll_child->AddChild(grand_child.Pass()); root->AddChild(scroll_child.Pass()); @@ -1265,13 +1092,8 @@ TEST_F(LayerTreeImplTest, HitTestingForMultipleLayerLists) { gfx::Point3F transform_origin; gfx::PointF position; gfx::Size bounds(100, 100); - SetLayerPropertiesForTesting(root.get(), - identity_matrix, - transform_origin, - position, - bounds, - true, - false); + SetLayerPropertiesForTesting(root.get(), identity_matrix, transform_origin, + position, bounds, true, false, true); root->SetDrawsContent(true); { // child 1 and child2 are initialized to overlap between x=50 and x=60. @@ -1289,42 +1111,30 @@ TEST_F(LayerTreeImplTest, HitTestingForMultipleLayerLists) { position = gfx::PointF(10.f, 10.f); bounds = gfx::Size(50, 50); - SetLayerPropertiesForTesting(child1.get(), - identity_matrix, - transform_origin, - position, - bounds, - true, - false); + SetLayerPropertiesForTesting(child1.get(), identity_matrix, + transform_origin, position, bounds, true, + false, false); child1->SetDrawsContent(true); - child1->SetForceRenderSurface(true); + child1->SetHasRenderSurface(true); position = gfx::PointF(50.f, 10.f); bounds = gfx::Size(50, 50); - SetLayerPropertiesForTesting(child2.get(), - identity_matrix, - transform_origin, - position, - bounds, - true, - false); + SetLayerPropertiesForTesting(child2.get(), identity_matrix, + transform_origin, position, bounds, true, + false, false); child2->SetDrawsContent(true); - child2->SetForceRenderSurface(true); + child2->SetHasRenderSurface(true); // Remember that grand_child is positioned with respect to its parent (i.e. // child1). In screen space, the intended position is (10, 50), with size // 100 x 50. position = gfx::PointF(0.f, 40.f); bounds = gfx::Size(100, 50); - SetLayerPropertiesForTesting(grand_child1.get(), - identity_matrix, - transform_origin, - position, - bounds, - true, - false); + SetLayerPropertiesForTesting(grand_child1.get(), identity_matrix, + transform_origin, position, bounds, true, + false, false); grand_child1->SetDrawsContent(true); - grand_child1->SetForceRenderSurface(true); + grand_child1->SetHasRenderSurface(true); child1->AddChild(grand_child1.Pass()); root->AddChild(child1.Pass()); @@ -1416,13 +1226,8 @@ TEST_F(LayerTreeImplTest, HitCheckingTouchHandlerRegionsForSingleLayer) { gfx::Point3F transform_origin; gfx::PointF position; gfx::Size bounds(100, 100); - SetLayerPropertiesForTesting(root.get(), - identity_matrix, - transform_origin, - position, - bounds, - true, - false); + SetLayerPropertiesForTesting(root.get(), identity_matrix, transform_origin, + position, bounds, true, false, true); root->SetDrawsContent(true); host_impl().SetViewportSize(root->bounds()); @@ -1504,13 +1309,9 @@ TEST_F(LayerTreeImplTest, gfx::Point3F transform_origin; gfx::PointF position; gfx::Size bounds(100, 100); - SetLayerPropertiesForTesting(root.get(), - uninvertible_transform, - transform_origin, - position, - bounds, - true, - false); + SetLayerPropertiesForTesting(root.get(), uninvertible_transform, + transform_origin, position, bounds, true, false, + true); root->SetDrawsContent(true); root->SetTouchEventHandlerRegion(touch_handler_region); @@ -1582,13 +1383,8 @@ TEST_F(LayerTreeImplTest, // layer is located. gfx::PointF position(50.f, 50.f); gfx::Size bounds(100, 100); - SetLayerPropertiesForTesting(root.get(), - identity_matrix, - transform_origin, - position, - bounds, - true, - false); + SetLayerPropertiesForTesting(root.get(), identity_matrix, transform_origin, + position, bounds, true, false, true); root->SetDrawsContent(true); root->SetTouchEventHandlerRegion(touch_handler_region); @@ -1658,26 +1454,18 @@ TEST_F(LayerTreeImplTest, gfx::Transform identity_matrix; gfx::Point3F transform_origin; - SetLayerPropertiesForTesting(root.get(), - identity_matrix, - transform_origin, - gfx::PointF(), - gfx::Size(100, 100), - true, - false); + SetLayerPropertiesForTesting(root.get(), identity_matrix, transform_origin, + gfx::PointF(), gfx::Size(100, 100), true, false, + true); { Region touch_handler_region(gfx::Rect(10, 10, 30, 30)); gfx::PointF position(25.f, 25.f); gfx::Size bounds(50, 50); scoped_ptr<LayerImpl> test_layer = LayerImpl::Create(host_impl().active_tree(), 12345); - SetLayerPropertiesForTesting(test_layer.get(), - identity_matrix, - transform_origin, - position, - bounds, - true, - false); + SetLayerPropertiesForTesting(test_layer.get(), identity_matrix, + transform_origin, position, bounds, true, + false, false); // override content bounds and contents scale test_layer->SetContentBounds(gfx::Size(100, 100)); @@ -1762,26 +1550,18 @@ TEST_F(LayerTreeImplTest, gfx::Transform identity_matrix; gfx::Point3F transform_origin; // Set the bounds of the root layer big enough to fit the child when scaled. - SetLayerPropertiesForTesting(root.get(), - identity_matrix, - transform_origin, - gfx::PointF(), - gfx::Size(100, 100), - true, - false); + SetLayerPropertiesForTesting(root.get(), identity_matrix, transform_origin, + gfx::PointF(), gfx::Size(100, 100), true, false, + true); { Region touch_handler_region(gfx::Rect(10, 10, 30, 30)); gfx::PointF position(25.f, 25.f); gfx::Size bounds(50, 50); scoped_ptr<LayerImpl> test_layer = LayerImpl::Create(host_impl().active_tree(), 12345); - SetLayerPropertiesForTesting(test_layer.get(), - identity_matrix, - transform_origin, - position, - bounds, - true, - false); + SetLayerPropertiesForTesting(test_layer.get(), identity_matrix, + transform_origin, position, bounds, true, + false, false); test_layer->SetDrawsContent(true); test_layer->SetTouchEventHandlerRegion(touch_handler_region); @@ -1888,13 +1668,9 @@ TEST_F(LayerTreeImplTest, HitCheckingTouchHandlerRegionsForSimpleClippedLayer) { gfx::Point3F transform_origin; scoped_ptr<LayerImpl> root = LayerImpl::Create(host_impl().active_tree(), 1); - SetLayerPropertiesForTesting(root.get(), - identity_matrix, - transform_origin, - gfx::PointF(), - gfx::Size(100, 100), - true, - false); + SetLayerPropertiesForTesting(root.get(), identity_matrix, transform_origin, + gfx::PointF(), gfx::Size(100, 100), true, false, + true); { scoped_ptr<LayerImpl> clipping_layer = LayerImpl::Create(host_impl().active_tree(), 123); @@ -1902,13 +1678,9 @@ TEST_F(LayerTreeImplTest, HitCheckingTouchHandlerRegionsForSimpleClippedLayer) { // layer is located. gfx::PointF position(25.f, 25.f); gfx::Size bounds(50, 50); - SetLayerPropertiesForTesting(clipping_layer.get(), - identity_matrix, - transform_origin, - position, - bounds, - true, - false); + SetLayerPropertiesForTesting(clipping_layer.get(), identity_matrix, + transform_origin, position, bounds, true, + false, false); clipping_layer->SetMasksToBounds(true); scoped_ptr<LayerImpl> child = @@ -1916,13 +1688,8 @@ TEST_F(LayerTreeImplTest, HitCheckingTouchHandlerRegionsForSimpleClippedLayer) { Region touch_handler_region(gfx::Rect(10, 10, 50, 50)); position = gfx::PointF(-50.f, -50.f); bounds = gfx::Size(300, 300); - SetLayerPropertiesForTesting(child.get(), - identity_matrix, - transform_origin, - position, - bounds, - true, - false); + SetLayerPropertiesForTesting(child.get(), identity_matrix, transform_origin, + position, bounds, true, false, false); child->SetDrawsContent(true); child->SetTouchEventHandlerRegion(touch_handler_region); clipping_layer->AddChild(child.Pass()); @@ -1983,13 +1750,9 @@ TEST_F(LayerTreeImplTest, HitCheckingTouchHandlerOverlappingRegions) { gfx::Point3F transform_origin; scoped_ptr<LayerImpl> root = LayerImpl::Create(host_impl().active_tree(), 1); - SetLayerPropertiesForTesting(root.get(), - identity_matrix, - transform_origin, - gfx::PointF(), - gfx::Size(100, 100), - true, - false); + SetLayerPropertiesForTesting(root.get(), identity_matrix, transform_origin, + gfx::PointF(), gfx::Size(100, 100), true, false, + true); { scoped_ptr<LayerImpl> touch_layer = LayerImpl::Create(host_impl().active_tree(), 123); @@ -1997,13 +1760,9 @@ TEST_F(LayerTreeImplTest, HitCheckingTouchHandlerOverlappingRegions) { // layer is located. gfx::PointF position; gfx::Size bounds(50, 50); - SetLayerPropertiesForTesting(touch_layer.get(), - identity_matrix, - transform_origin, - position, - bounds, - true, - false); + SetLayerPropertiesForTesting(touch_layer.get(), identity_matrix, + transform_origin, position, bounds, true, + false, false); touch_layer->SetDrawsContent(true); touch_layer->SetTouchEventHandlerRegion(gfx::Rect(0, 0, 50, 50)); root->AddChild(touch_layer.Pass()); @@ -2016,13 +1775,9 @@ TEST_F(LayerTreeImplTest, HitCheckingTouchHandlerOverlappingRegions) { // layer is located. gfx::PointF position(0, 25); gfx::Size bounds(50, 50); - SetLayerPropertiesForTesting(notouch_layer.get(), - identity_matrix, - transform_origin, - position, - bounds, - true, - false); + SetLayerPropertiesForTesting(notouch_layer.get(), identity_matrix, + transform_origin, position, bounds, true, + false, false); notouch_layer->SetDrawsContent(true); root->AddChild(notouch_layer.Pass()); } @@ -2080,13 +1835,8 @@ TEST_F(LayerTreeImplTest, SelectionBoundsForSingleLayer) { gfx::Point3F transform_origin; gfx::PointF position; gfx::Size bounds(100, 100); - SetLayerPropertiesForTesting(root.get(), - identity_matrix, - transform_origin, - position, - bounds, - true, - false); + SetLayerPropertiesForTesting(root.get(), identity_matrix, transform_origin, + position, bounds, true, false, true); root->SetDrawsContent(true); host_impl().SetViewportSize(root->bounds()); @@ -2156,13 +1906,8 @@ TEST_F(LayerTreeImplTest, SelectionBoundsForPartialOccludedLayers) { gfx::Point3F transform_origin; gfx::PointF position; gfx::Size bounds(100, 100); - SetLayerPropertiesForTesting(root.get(), - identity_matrix, - transform_origin, - position, - bounds, - true, - false); + SetLayerPropertiesForTesting(root.get(), identity_matrix, transform_origin, + position, bounds, true, false, true); gfx::Vector2dF clipping_offset(10, 10); { @@ -2171,26 +1916,18 @@ TEST_F(LayerTreeImplTest, SelectionBoundsForPartialOccludedLayers) { // The clipping layer should occlude the right selection bound. gfx::PointF position = gfx::PointF() + clipping_offset; gfx::Size bounds(50, 50); - SetLayerPropertiesForTesting(clipping_layer.get(), - identity_matrix, - transform_origin, - position, - bounds, - true, - false); + SetLayerPropertiesForTesting(clipping_layer.get(), identity_matrix, + transform_origin, position, bounds, true, + false, false); clipping_layer->SetMasksToBounds(true); scoped_ptr<LayerImpl> clipped_layer = LayerImpl::Create(host_impl().active_tree(), clipped_layer_id); position = gfx::PointF(); bounds = gfx::Size(100, 100); - SetLayerPropertiesForTesting(clipped_layer.get(), - identity_matrix, - transform_origin, - position, - bounds, - true, - false); + SetLayerPropertiesForTesting(clipped_layer.get(), identity_matrix, + transform_origin, position, bounds, true, + false, false); clipped_layer->SetDrawsContent(true); clipping_layer->AddChild(clipped_layer.Pass()); root->AddChild(clipping_layer.Pass()); @@ -2268,13 +2005,8 @@ TEST_F(LayerTreeImplTest, SelectionBoundsForScaledLayers) { gfx::Point3F transform_origin; gfx::PointF position; gfx::Size bounds(100, 100); - SetLayerPropertiesForTesting(root.get(), - identity_matrix, - transform_origin, - position, - bounds, - true, - false); + SetLayerPropertiesForTesting(root.get(), identity_matrix, transform_origin, + position, bounds, true, false, true); gfx::Vector2dF sub_layer_offset(10, 0); { @@ -2282,13 +2014,9 @@ TEST_F(LayerTreeImplTest, SelectionBoundsForScaledLayers) { LayerImpl::Create(host_impl().active_tree(), sub_layer_id); gfx::PointF position = gfx::PointF() + sub_layer_offset; gfx::Size bounds(50, 50); - SetLayerPropertiesForTesting(sub_layer.get(), - identity_matrix, - transform_origin, - position, - bounds, - true, - false); + SetLayerPropertiesForTesting(sub_layer.get(), identity_matrix, + transform_origin, position, bounds, true, + false, false); sub_layer->SetDrawsContent(true); root->AddChild(sub_layer.Pass()); } |