Chromium Code Reviews| Index: cc/trees/layer_tree_impl_unittest.cc |
| diff --git a/cc/trees/layer_tree_impl_unittest.cc b/cc/trees/layer_tree_impl_unittest.cc |
| index a0dd11a266eada46c256831cf66693453ff6b633..2b24922974f2293c95a835faa3c3deeaaf811e3a 100644 |
| --- a/cc/trees/layer_tree_impl_unittest.cc |
| +++ b/cc/trees/layer_tree_impl_unittest.cc |
| @@ -57,7 +57,8 @@ TEST_F(LayerTreeImplTest, HitTestingForSingleLayer) { |
| position, |
| bounds, |
| true, |
| - false); |
| + false, |
| + true); |
| root->SetDrawsContent(true); |
| host_impl().SetViewportSize(root->bounds()); |
| @@ -109,7 +110,8 @@ TEST_F(LayerTreeImplTest, HitTestingForSingleLayerAndHud) { |
| position, |
| bounds, |
| true, |
| - false); |
| + false, |
| + true); |
| root->SetDrawsContent(true); |
| // Create hud and add it as a child of root. |
| @@ -181,7 +183,8 @@ TEST_F(LayerTreeImplTest, HitTestingForUninvertibleTransform) { |
| position, |
| bounds, |
| true, |
| - false); |
| + false, |
| + true); |
| root->SetDrawsContent(true); |
| host_impl().SetViewportSize(root->bounds()); |
| @@ -247,7 +250,8 @@ TEST_F(LayerTreeImplTest, HitTestingForSinglePositionedLayer) { |
| position, |
| bounds, |
| true, |
| - false); |
| + false, |
| + true); |
| root->SetDrawsContent(true); |
| host_impl().SetViewportSize(root->bounds()); |
| @@ -303,7 +307,8 @@ TEST_F(LayerTreeImplTest, HitTestingForSingleRotatedLayer) { |
| position, |
| bounds, |
| true, |
| - false); |
| + false, |
| + true); |
| root->SetDrawsContent(true); |
| host_impl().SetViewportSize(root->bounds()); |
| @@ -372,7 +377,8 @@ TEST_F(LayerTreeImplTest, HitTestingForSinglePerspectiveLayer) { |
| position, |
| bounds, |
| true, |
| - false); |
| + false, |
| + true); |
| root->SetDrawsContent(true); |
| host_impl().SetViewportSize(root->bounds()); |
| @@ -433,7 +439,8 @@ TEST_F(LayerTreeImplTest, HitTestingForSingleLayerWithScaledContents) { |
| gfx::PointF(), |
| gfx::Size(100, 100), |
| true, |
| - false); |
| + false, |
| + true); |
| { |
| gfx::PointF position(25.f, 25.f); |
| gfx::Size bounds(50, 50); |
| @@ -513,7 +520,8 @@ TEST_F(LayerTreeImplTest, HitTestingForSimpleClippedLayer) { |
| gfx::PointF(), |
| gfx::Size(100, 100), |
| true, |
| - false); |
| + false, |
| + true); |
| { |
| scoped_ptr<LayerImpl> clipping_layer = |
| LayerImpl::Create(host_impl().active_tree(), 123); |
| @@ -608,7 +616,8 @@ TEST_F(LayerTreeImplTest, HitTestingForMultiClippedRotatedLayer) { |
| position, |
| bounds, |
| true, |
| - false); |
| + false, |
| + true); |
| root->SetMasksToBounds(true); |
| { |
| scoped_ptr<LayerImpl> child = |
| @@ -675,27 +684,6 @@ TEST_F(LayerTreeImplTest, HitTestingForMultiClippedRotatedLayer) { |
| host_impl().active_tree()->SetRootLayer(root.Pass()); |
| host_impl().UpdateNumChildrenAndDrawPropertiesForActiveTree(); |
|
awoloszyn
2014/08/25 21:03:44
This will move to the RenderSurface creation tests
|
| - // 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); |
| @@ -756,7 +744,8 @@ TEST_F(LayerTreeImplTest, HitTestingForNonClippingIntermediateLayer) { |
| gfx::PointF(), |
| gfx::Size(100, 100), |
| true, |
| - false); |
| + false, |
| + true); |
| { |
| scoped_ptr<LayerImpl> intermediate_layer = |
| LayerImpl::Create(host_impl().active_tree(), 123); |
| @@ -841,7 +830,8 @@ TEST_F(LayerTreeImplTest, HitTestingForMultipleLayers) { |
| position, |
| bounds, |
| true, |
| - false); |
| + false, |
| + true); |
| root->SetDrawsContent(true); |
| { |
| // child 1 and child2 are initialized to overlap between x=50 and x=60. |
| @@ -980,7 +970,8 @@ TEST_F(LayerTreeImplTest, HitTestingForMultipleLayersAtVaryingDepths) { |
| position, |
| bounds, |
| true, |
| - false); |
| + false, |
| + true); |
| root->SetDrawsContent(true); |
| root->SetShouldFlattenTransform(false); |
| root->Set3dSortingContextId(1); |
| @@ -1129,7 +1120,8 @@ TEST_F(LayerTreeImplTest, HitTestingRespectsClipParents) { |
| position, |
| bounds, |
| true, |
| - false); |
| + false, |
| + true); |
| root->SetDrawsContent(true); |
| { |
| scoped_ptr<LayerImpl> child = |
| @@ -1159,7 +1151,7 @@ TEST_F(LayerTreeImplTest, HitTestingRespectsClipParents) { |
| true, |
| false); |
| grand_child->SetDrawsContent(true); |
| - grand_child->SetForceRenderSurface(true); |
| + grand_child->CreateRenderSurface(); |
| // This should let |grand_child| "escape" |child|'s clip. |
| grand_child->SetClipParent(root.get()); |
| @@ -1191,7 +1183,8 @@ TEST_F(LayerTreeImplTest, HitTestingRespectsScrollParents) { |
| position, |
| bounds, |
| true, |
| - false); |
| + false, |
| + true); |
| root->SetDrawsContent(true); |
| { |
| scoped_ptr<LayerImpl> child = |
| @@ -1236,7 +1229,7 @@ TEST_F(LayerTreeImplTest, HitTestingRespectsScrollParents) { |
| true, |
| false); |
| grand_child->SetDrawsContent(true); |
| - grand_child->SetForceRenderSurface(true); |
| + grand_child->CreateRenderSurface(); |
| scroll_child->AddChild(grand_child.Pass()); |
| root->AddChild(scroll_child.Pass()); |
| @@ -1272,7 +1265,8 @@ TEST_F(LayerTreeImplTest, HitTestingForMultipleLayerLists) { |
| position, |
| bounds, |
| true, |
| - false); |
| + false, |
| + true); |
| root->SetDrawsContent(true); |
| { |
| // child 1 and child2 are initialized to overlap between x=50 and x=60. |
| @@ -1298,7 +1292,7 @@ TEST_F(LayerTreeImplTest, HitTestingForMultipleLayerLists) { |
| true, |
| false); |
| child1->SetDrawsContent(true); |
| - child1->SetForceRenderSurface(true); |
| + child1->CreateRenderSurface(); |
| position = gfx::PointF(50.f, 10.f); |
| bounds = gfx::Size(50, 50); |
| @@ -1310,7 +1304,7 @@ TEST_F(LayerTreeImplTest, HitTestingForMultipleLayerLists) { |
| true, |
| false); |
| child2->SetDrawsContent(true); |
| - child2->SetForceRenderSurface(true); |
| + child2->CreateRenderSurface(); |
| // 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 |
| @@ -1325,7 +1319,7 @@ TEST_F(LayerTreeImplTest, HitTestingForMultipleLayerLists) { |
| true, |
| false); |
| grand_child1->SetDrawsContent(true); |
| - grand_child1->SetForceRenderSurface(true); |
| + grand_child1->CreateRenderSurface(); |
| child1->AddChild(grand_child1.Pass()); |
| root->AddChild(child1.Pass()); |
| @@ -1423,7 +1417,8 @@ TEST_F(LayerTreeImplTest, HitCheckingTouchHandlerRegionsForSingleLayer) { |
| position, |
| bounds, |
| true, |
| - false); |
| + false, |
| + true); |
| root->SetDrawsContent(true); |
| host_impl().SetViewportSize(root->bounds()); |
| @@ -1511,7 +1506,8 @@ TEST_F(LayerTreeImplTest, |
| position, |
| bounds, |
| true, |
| - false); |
| + false, |
| + true); |
| root->SetDrawsContent(true); |
| root->SetTouchEventHandlerRegion(touch_handler_region); |
| @@ -1589,7 +1585,8 @@ TEST_F(LayerTreeImplTest, |
| position, |
| bounds, |
| true, |
| - false); |
| + false, |
| + true); |
| root->SetDrawsContent(true); |
| root->SetTouchEventHandlerRegion(touch_handler_region); |
| @@ -1665,7 +1662,8 @@ TEST_F(LayerTreeImplTest, |
| gfx::PointF(), |
| gfx::Size(100, 100), |
| true, |
| - false); |
| + false, |
| + true); |
| { |
| Region touch_handler_region(gfx::Rect(10, 10, 30, 30)); |
| gfx::PointF position(25.f, 25.f); |
| @@ -1769,7 +1767,8 @@ TEST_F(LayerTreeImplTest, |
| gfx::PointF(), |
| gfx::Size(100, 100), |
| true, |
| - false); |
| + false, |
| + true); |
| { |
| Region touch_handler_region(gfx::Rect(10, 10, 30, 30)); |
| gfx::PointF position(25.f, 25.f); |
| @@ -1893,7 +1892,8 @@ TEST_F(LayerTreeImplTest, HitCheckingTouchHandlerRegionsForSimpleClippedLayer) { |
| gfx::PointF(), |
| gfx::Size(100, 100), |
| true, |
| - false); |
| + false, |
| + true); |
| { |
| scoped_ptr<LayerImpl> clipping_layer = |
| LayerImpl::Create(host_impl().active_tree(), 123); |
| @@ -1988,7 +1988,8 @@ TEST_F(LayerTreeImplTest, HitCheckingTouchHandlerOverlappingRegions) { |
| gfx::PointF(), |
| gfx::Size(100, 100), |
| true, |
| - false); |
| + false, |
| + true); |
| { |
| scoped_ptr<LayerImpl> touch_layer = |
| LayerImpl::Create(host_impl().active_tree(), 123); |
| @@ -2085,7 +2086,8 @@ TEST_F(LayerTreeImplTest, SelectionBoundsForSingleLayer) { |
| position, |
| bounds, |
| true, |
| - false); |
| + false, |
| + true); |
| root->SetDrawsContent(true); |
| host_impl().SetViewportSize(root->bounds()); |
| @@ -2161,7 +2163,8 @@ TEST_F(LayerTreeImplTest, SelectionBoundsForPartialOccludedLayers) { |
| position, |
| bounds, |
| true, |
| - false); |
| + false, |
| + true); |
| gfx::Vector2dF clipping_offset(10, 10); |
| { |
| @@ -2273,7 +2276,8 @@ TEST_F(LayerTreeImplTest, SelectionBoundsForScaledLayers) { |
| position, |
| bounds, |
| true, |
| - false); |
| + false, |
| + true); |
| gfx::Vector2dF sub_layer_offset(10, 0); |
| { |