| 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 f8de8b06862ba0777c18b80169dbbf590a84161d..a578dd5681d9e6fc0f4b7f803325674011fb7b08 100644
|
| --- a/cc/trees/layer_tree_impl_unittest.cc
|
| +++ b/cc/trees/layer_tree_impl_unittest.cc
|
| @@ -56,7 +56,8 @@ TEST_F(LayerTreeImplTest, HitTestingForSingleLayer) {
|
| position,
|
| bounds,
|
| true,
|
| - false);
|
| + false,
|
| + true);
|
| root->SetDrawsContent(true);
|
|
|
| host_impl().SetViewportSize(root->bounds());
|
| @@ -108,7 +109,8 @@ TEST_F(LayerTreeImplTest, HitTestingForSingleLayerAndHud) {
|
| position,
|
| bounds,
|
| true,
|
| - false);
|
| + false,
|
| + true);
|
| root->SetDrawsContent(true);
|
|
|
| // Create hud and add it as a child of root.
|
| @@ -119,6 +121,7 @@ TEST_F(LayerTreeImplTest, HitTestingForSingleLayerAndHud) {
|
| position,
|
| hud_bounds,
|
| true,
|
| + false,
|
| false);
|
| hud->SetDrawsContent(true);
|
|
|
| @@ -180,7 +183,8 @@ TEST_F(LayerTreeImplTest, HitTestingForUninvertibleTransform) {
|
| position,
|
| bounds,
|
| true,
|
| - false);
|
| + false,
|
| + true);
|
| root->SetDrawsContent(true);
|
|
|
| host_impl().SetViewportSize(root->bounds());
|
| @@ -246,7 +250,8 @@ TEST_F(LayerTreeImplTest, HitTestingForSinglePositionedLayer) {
|
| position,
|
| bounds,
|
| true,
|
| - false);
|
| + false,
|
| + true);
|
| root->SetDrawsContent(true);
|
|
|
| host_impl().SetViewportSize(root->bounds());
|
| @@ -302,7 +307,8 @@ TEST_F(LayerTreeImplTest, HitTestingForSingleRotatedLayer) {
|
| position,
|
| bounds,
|
| true,
|
| - false);
|
| + false,
|
| + true);
|
| root->SetDrawsContent(true);
|
|
|
| host_impl().SetViewportSize(root->bounds());
|
| @@ -371,7 +377,8 @@ TEST_F(LayerTreeImplTest, HitTestingForSinglePerspectiveLayer) {
|
| position,
|
| bounds,
|
| true,
|
| - false);
|
| + false,
|
| + true);
|
| root->SetDrawsContent(true);
|
|
|
| host_impl().SetViewportSize(root->bounds());
|
| @@ -432,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);
|
| @@ -444,6 +452,7 @@ TEST_F(LayerTreeImplTest, HitTestingForSingleLayerWithScaledContents) {
|
| position,
|
| bounds,
|
| true,
|
| + false,
|
| false);
|
|
|
| // override content bounds and contents scale
|
| @@ -512,7 +521,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);
|
| @@ -526,6 +536,7 @@ TEST_F(LayerTreeImplTest, HitTestingForSimpleClippedLayer) {
|
| position,
|
| bounds,
|
| true,
|
| + false,
|
| false);
|
| clipping_layer->SetMasksToBounds(true);
|
|
|
| @@ -539,6 +550,7 @@ TEST_F(LayerTreeImplTest, HitTestingForSimpleClippedLayer) {
|
| position,
|
| bounds,
|
| true,
|
| + false,
|
| false);
|
| child->SetDrawsContent(true);
|
| clipping_layer->AddChild(child.Pass());
|
| @@ -607,7 +619,8 @@ TEST_F(LayerTreeImplTest, HitTestingForMultiClippedRotatedLayer) {
|
| position,
|
| bounds,
|
| true,
|
| - false);
|
| + false,
|
| + true);
|
| root->SetMasksToBounds(true);
|
| {
|
| scoped_ptr<LayerImpl> child =
|
| @@ -625,6 +638,7 @@ TEST_F(LayerTreeImplTest, HitTestingForMultiClippedRotatedLayer) {
|
| position,
|
| bounds,
|
| true,
|
| + false,
|
| false);
|
| child->SetMasksToBounds(true);
|
|
|
| @@ -642,6 +656,7 @@ TEST_F(LayerTreeImplTest, HitTestingForMultiClippedRotatedLayer) {
|
| position,
|
| bounds,
|
| true,
|
| + false,
|
| false);
|
| grand_child->SetMasksToBounds(true);
|
|
|
| @@ -662,6 +677,7 @@ TEST_F(LayerTreeImplTest, HitTestingForMultiClippedRotatedLayer) {
|
| position,
|
| bounds,
|
| true,
|
| + false,
|
| false);
|
| rotated_leaf->SetDrawsContent(true);
|
|
|
| @@ -674,27 +690,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);
|
| @@ -755,7 +750,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);
|
| @@ -769,6 +765,7 @@ TEST_F(LayerTreeImplTest, HitTestingForNonClippingIntermediateLayer) {
|
| position,
|
| bounds,
|
| true,
|
| + false,
|
| false);
|
| // Sanity check the intermediate layer should not clip.
|
| ASSERT_FALSE(intermediate_layer->masks_to_bounds());
|
| @@ -787,6 +784,7 @@ TEST_F(LayerTreeImplTest, HitTestingForNonClippingIntermediateLayer) {
|
| position,
|
| bounds,
|
| true,
|
| + false,
|
| false);
|
| child->SetDrawsContent(true);
|
| intermediate_layer->AddChild(child.Pass());
|
| @@ -840,7 +838,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.
|
| @@ -864,6 +863,7 @@ TEST_F(LayerTreeImplTest, HitTestingForMultipleLayers) {
|
| position,
|
| bounds,
|
| true,
|
| + false,
|
| false);
|
| child1->SetDrawsContent(true);
|
|
|
| @@ -875,6 +875,7 @@ TEST_F(LayerTreeImplTest, HitTestingForMultipleLayers) {
|
| position,
|
| bounds,
|
| true,
|
| + false,
|
| false);
|
| child2->SetDrawsContent(true);
|
|
|
| @@ -889,6 +890,7 @@ TEST_F(LayerTreeImplTest, HitTestingForMultipleLayers) {
|
| position,
|
| bounds,
|
| true,
|
| + false,
|
| false);
|
| grand_child1->SetDrawsContent(true);
|
|
|
| @@ -979,7 +981,8 @@ TEST_F(LayerTreeImplTest, HitTestingForMultipleLayersAtVaryingDepths) {
|
| position,
|
| bounds,
|
| true,
|
| - false);
|
| + false,
|
| + true);
|
| root->SetDrawsContent(true);
|
| root->SetShouldFlattenTransform(false);
|
| root->Set3dSortingContextId(1);
|
| @@ -1005,6 +1008,7 @@ TEST_F(LayerTreeImplTest, HitTestingForMultipleLayersAtVaryingDepths) {
|
| position,
|
| bounds,
|
| true,
|
| + false,
|
| false);
|
| child1->SetDrawsContent(true);
|
| child1->SetShouldFlattenTransform(false);
|
| @@ -1020,6 +1024,7 @@ TEST_F(LayerTreeImplTest, HitTestingForMultipleLayersAtVaryingDepths) {
|
| position,
|
| bounds,
|
| true,
|
| + false,
|
| false);
|
| child2->SetDrawsContent(true);
|
| child2->SetShouldFlattenTransform(false);
|
| @@ -1036,6 +1041,7 @@ TEST_F(LayerTreeImplTest, HitTestingForMultipleLayersAtVaryingDepths) {
|
| position,
|
| bounds,
|
| true,
|
| + false,
|
| false);
|
| grand_child1->SetDrawsContent(true);
|
| grand_child1->SetShouldFlattenTransform(false);
|
| @@ -1128,7 +1134,8 @@ TEST_F(LayerTreeImplTest, HitTestingRespectsClipParents) {
|
| position,
|
| bounds,
|
| true,
|
| - false);
|
| + false,
|
| + true);
|
| root->SetDrawsContent(true);
|
| {
|
| scoped_ptr<LayerImpl> child =
|
| @@ -1144,6 +1151,7 @@ TEST_F(LayerTreeImplTest, HitTestingRespectsClipParents) {
|
| position,
|
| bounds,
|
| true,
|
| + false,
|
| false);
|
| child->SetDrawsContent(true);
|
| child->SetMasksToBounds(true);
|
| @@ -1156,9 +1164,10 @@ TEST_F(LayerTreeImplTest, HitTestingRespectsClipParents) {
|
| 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());
|
| @@ -1190,7 +1199,8 @@ TEST_F(LayerTreeImplTest, HitTestingRespectsScrollParents) {
|
| position,
|
| bounds,
|
| true,
|
| - false);
|
| + false,
|
| + true);
|
| root->SetDrawsContent(true);
|
| {
|
| scoped_ptr<LayerImpl> child =
|
| @@ -1208,6 +1218,7 @@ TEST_F(LayerTreeImplTest, HitTestingRespectsScrollParents) {
|
| position,
|
| bounds,
|
| true,
|
| + false,
|
| false);
|
| child->SetDrawsContent(true);
|
| child->SetMasksToBounds(true);
|
| @@ -1220,6 +1231,7 @@ TEST_F(LayerTreeImplTest, HitTestingRespectsScrollParents) {
|
| position,
|
| bounds,
|
| true,
|
| + false,
|
| false);
|
| scroll_child->SetDrawsContent(true);
|
|
|
| @@ -1233,9 +1245,10 @@ TEST_F(LayerTreeImplTest, HitTestingRespectsScrollParents) {
|
| 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());
|
| @@ -1271,7 +1284,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.
|
| @@ -1295,9 +1309,10 @@ TEST_F(LayerTreeImplTest, HitTestingForMultipleLayerLists) {
|
| 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);
|
| @@ -1307,9 +1322,10 @@ TEST_F(LayerTreeImplTest, HitTestingForMultipleLayerLists) {
|
| 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
|
| @@ -1322,9 +1338,10 @@ TEST_F(LayerTreeImplTest, HitTestingForMultipleLayerLists) {
|
| 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());
|
| @@ -1422,7 +1439,8 @@ TEST_F(LayerTreeImplTest, HitCheckingTouchHandlerRegionsForSingleLayer) {
|
| position,
|
| bounds,
|
| true,
|
| - false);
|
| + false,
|
| + true);
|
| root->SetDrawsContent(true);
|
|
|
| host_impl().SetViewportSize(root->bounds());
|
| @@ -1510,7 +1528,8 @@ TEST_F(LayerTreeImplTest,
|
| position,
|
| bounds,
|
| true,
|
| - false);
|
| + false,
|
| + true);
|
| root->SetDrawsContent(true);
|
| root->SetTouchEventHandlerRegion(touch_handler_region);
|
|
|
| @@ -1588,7 +1607,8 @@ TEST_F(LayerTreeImplTest,
|
| position,
|
| bounds,
|
| true,
|
| - false);
|
| + false,
|
| + true);
|
| root->SetDrawsContent(true);
|
| root->SetTouchEventHandlerRegion(touch_handler_region);
|
|
|
| @@ -1664,7 +1684,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);
|
| @@ -1677,6 +1698,7 @@ TEST_F(LayerTreeImplTest,
|
| position,
|
| bounds,
|
| true,
|
| + false,
|
| false);
|
|
|
| // override content bounds and contents scale
|
| @@ -1768,7 +1790,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);
|
| @@ -1781,6 +1804,7 @@ TEST_F(LayerTreeImplTest,
|
| position,
|
| bounds,
|
| true,
|
| + false,
|
| false);
|
|
|
| test_layer->SetDrawsContent(true);
|
| @@ -1892,7 +1916,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);
|
| @@ -1906,6 +1931,7 @@ TEST_F(LayerTreeImplTest, HitCheckingTouchHandlerRegionsForSimpleClippedLayer) {
|
| position,
|
| bounds,
|
| true,
|
| + false,
|
| false);
|
| clipping_layer->SetMasksToBounds(true);
|
|
|
| @@ -1920,6 +1946,7 @@ TEST_F(LayerTreeImplTest, HitCheckingTouchHandlerRegionsForSimpleClippedLayer) {
|
| position,
|
| bounds,
|
| true,
|
| + false,
|
| false);
|
| child->SetDrawsContent(true);
|
| child->SetTouchEventHandlerRegion(touch_handler_region);
|
| @@ -1987,7 +2014,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);
|
| @@ -2001,6 +2029,7 @@ TEST_F(LayerTreeImplTest, HitCheckingTouchHandlerOverlappingRegions) {
|
| position,
|
| bounds,
|
| true,
|
| + false,
|
| false);
|
| touch_layer->SetDrawsContent(true);
|
| touch_layer->SetTouchEventHandlerRegion(gfx::Rect(0, 0, 50, 50));
|
| @@ -2020,6 +2049,7 @@ TEST_F(LayerTreeImplTest, HitCheckingTouchHandlerOverlappingRegions) {
|
| position,
|
| bounds,
|
| true,
|
| + false,
|
| false);
|
| notouch_layer->SetDrawsContent(true);
|
| root->AddChild(notouch_layer.Pass());
|
| @@ -2084,7 +2114,8 @@ TEST_F(LayerTreeImplTest, SelectionBoundsForSingleLayer) {
|
| position,
|
| bounds,
|
| true,
|
| - false);
|
| + false,
|
| + true);
|
| root->SetDrawsContent(true);
|
|
|
| host_impl().SetViewportSize(root->bounds());
|
| @@ -2160,7 +2191,8 @@ TEST_F(LayerTreeImplTest, SelectionBoundsForPartialOccludedLayers) {
|
| position,
|
| bounds,
|
| true,
|
| - false);
|
| + false,
|
| + true);
|
|
|
| gfx::Vector2dF clipping_offset(10, 10);
|
| {
|
| @@ -2175,6 +2207,7 @@ TEST_F(LayerTreeImplTest, SelectionBoundsForPartialOccludedLayers) {
|
| position,
|
| bounds,
|
| true,
|
| + false,
|
| false);
|
| clipping_layer->SetMasksToBounds(true);
|
|
|
| @@ -2188,6 +2221,7 @@ TEST_F(LayerTreeImplTest, SelectionBoundsForPartialOccludedLayers) {
|
| position,
|
| bounds,
|
| true,
|
| + false,
|
| false);
|
| clipped_layer->SetDrawsContent(true);
|
| clipping_layer->AddChild(clipped_layer.Pass());
|
| @@ -2272,7 +2306,8 @@ TEST_F(LayerTreeImplTest, SelectionBoundsForScaledLayers) {
|
| position,
|
| bounds,
|
| true,
|
| - false);
|
| + false,
|
| + true);
|
|
|
| gfx::Vector2dF sub_layer_offset(10, 0);
|
| {
|
| @@ -2286,6 +2321,7 @@ TEST_F(LayerTreeImplTest, SelectionBoundsForScaledLayers) {
|
| position,
|
| bounds,
|
| true,
|
| + false,
|
| false);
|
| sub_layer->SetDrawsContent(true);
|
| root->AddChild(sub_layer.Pass());
|
|
|