| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "cc/trees/layer_tree_impl.h" | 5 #include "cc/trees/layer_tree_impl.h" |
| 6 | 6 |
| 7 #include "cc/layers/heads_up_display_layer_impl.h" | 7 #include "cc/layers/heads_up_display_layer_impl.h" |
| 8 #include "cc/layers/layer.h" | 8 #include "cc/layers/layer.h" |
| 9 #include "cc/layers/solid_color_scrollbar_layer_impl.h" | 9 #include "cc/layers/solid_color_scrollbar_layer_impl.h" |
| 10 #include "cc/test/fake_impl_task_runner_provider.h" | 10 #include "cc/test/fake_impl_task_runner_provider.h" |
| (...skipping 771 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 782 LayerImpl::Create(host_impl().active_tree(), 123); | 782 LayerImpl::Create(host_impl().active_tree(), 123); |
| 783 // this layer is positioned, and hit testing should correctly know where the | 783 // this layer is positioned, and hit testing should correctly know where the |
| 784 // layer is located. | 784 // layer is located. |
| 785 gfx::PointF position(10.f, 10.f); | 785 gfx::PointF position(10.f, 10.f); |
| 786 gfx::Size bounds(50, 50); | 786 gfx::Size bounds(50, 50); |
| 787 SetLayerPropertiesForTesting(intermediate_layer.get(), identity_matrix, | 787 SetLayerPropertiesForTesting(intermediate_layer.get(), identity_matrix, |
| 788 transform_origin, position, bounds, true, | 788 transform_origin, position, bounds, true, |
| 789 false, false); | 789 false, false); |
| 790 // Sanity check the intermediate layer should not clip. | 790 // Sanity check the intermediate layer should not clip. |
| 791 ASSERT_FALSE(intermediate_layer->masks_to_bounds()); | 791 ASSERT_FALSE(intermediate_layer->masks_to_bounds()); |
| 792 ASSERT_FALSE(intermediate_layer->mask_layer()); | 792 ASSERT_FALSE(intermediate_layer->test_properties()->mask_layer); |
| 793 | 793 |
| 794 // The child of the intermediate_layer is translated so that it does not | 794 // The child of the intermediate_layer is translated so that it does not |
| 795 // overlap intermediate_layer at all. If child is incorrectly clipped, we | 795 // overlap intermediate_layer at all. If child is incorrectly clipped, we |
| 796 // would not be able to hit it successfully. | 796 // would not be able to hit it successfully. |
| 797 std::unique_ptr<LayerImpl> child = | 797 std::unique_ptr<LayerImpl> child = |
| 798 LayerImpl::Create(host_impl().active_tree(), 456); | 798 LayerImpl::Create(host_impl().active_tree(), 456); |
| 799 position = gfx::PointF(60.f, 60.f); // 70, 70 in screen space | 799 position = gfx::PointF(60.f, 60.f); // 70, 70 in screen space |
| 800 bounds = gfx::Size(20, 20); | 800 bounds = gfx::Size(20, 20); |
| 801 SetLayerPropertiesForTesting(child.get(), identity_matrix, transform_origin, | 801 SetLayerPropertiesForTesting(child.get(), identity_matrix, transform_origin, |
| 802 position, bounds, true, false, false); | 802 position, bounds, true, false, false); |
| (...skipping 1743 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2546 gfx::PointF test_point = gfx::PointF(1.f, 1.f); | 2546 gfx::PointF test_point = gfx::PointF(1.f, 1.f); |
| 2547 LayerImpl* result_layer = | 2547 LayerImpl* result_layer = |
| 2548 host_impl().active_tree()->FindLayerThatIsHitByPoint(test_point); | 2548 host_impl().active_tree()->FindLayerThatIsHitByPoint(test_point); |
| 2549 | 2549 |
| 2550 CHECK(result_layer); | 2550 CHECK(result_layer); |
| 2551 EXPECT_EQ(2, result_layer->id()); | 2551 EXPECT_EQ(2, result_layer->id()); |
| 2552 } | 2552 } |
| 2553 | 2553 |
| 2554 } // namespace | 2554 } // namespace |
| 2555 } // namespace cc | 2555 } // namespace cc |
| OLD | NEW |