| 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 429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 440 EXPECT_FALSE(result_layer); | 440 EXPECT_FALSE(result_layer); |
| 441 | 441 |
| 442 test_point = gfx::PointF(140.f, 140.f); | 442 test_point = gfx::PointF(140.f, 140.f); |
| 443 result_layer = | 443 result_layer = |
| 444 host_impl().active_tree()->FindLayerThatIsHitByPoint(test_point); | 444 host_impl().active_tree()->FindLayerThatIsHitByPoint(test_point); |
| 445 ASSERT_TRUE(result_layer); | 445 ASSERT_TRUE(result_layer); |
| 446 EXPECT_EQ(5, result_layer->id()); | 446 EXPECT_EQ(5, result_layer->id()); |
| 447 | 447 |
| 448 ClipTree& clip_tree = host_impl().active_tree()->property_trees()->clip_tree; | 448 ClipTree& clip_tree = host_impl().active_tree()->property_trees()->clip_tree; |
| 449 ClipNode* clip_node = clip_tree.Node(result_layer->clip_tree_index()); | 449 ClipNode* clip_node = clip_tree.Node(result_layer->clip_tree_index()); |
| 450 EXPECT_NE(clip_node->data.transform_id, clip_node->data.target_id); | 450 EXPECT_NE(clip_node->data.transform_id, clip_node->data.target_transform_id); |
| 451 } | 451 } |
| 452 | 452 |
| 453 TEST_F(LayerTreeImplTest, HitTestingSiblings) { | 453 TEST_F(LayerTreeImplTest, HitTestingSiblings) { |
| 454 // This tests hit testing when the test point hits only one of the siblings. | 454 // This tests hit testing when the test point hits only one of the siblings. |
| 455 gfx::Transform identity_matrix; | 455 gfx::Transform identity_matrix; |
| 456 std::unique_ptr<LayerImpl> root = | 456 std::unique_ptr<LayerImpl> root = |
| 457 LayerImpl::Create(host_impl().active_tree(), 1); | 457 LayerImpl::Create(host_impl().active_tree(), 1); |
| 458 SetLayerPropertiesForTesting(root.get(), identity_matrix, gfx::Point3F(), | 458 SetLayerPropertiesForTesting(root.get(), identity_matrix, gfx::Point3F(), |
| 459 gfx::PointF(), gfx::Size(100, 100), true, false, | 459 gfx::PointF(), gfx::Size(100, 100), true, false, |
| 460 true); | 460 true); |
| (...skipping 2105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2566 gfx::PointF test_point = gfx::PointF(1.f, 1.f); | 2566 gfx::PointF test_point = gfx::PointF(1.f, 1.f); |
| 2567 LayerImpl* result_layer = | 2567 LayerImpl* result_layer = |
| 2568 host_impl().active_tree()->FindLayerThatIsHitByPoint(test_point); | 2568 host_impl().active_tree()->FindLayerThatIsHitByPoint(test_point); |
| 2569 | 2569 |
| 2570 CHECK(result_layer); | 2570 CHECK(result_layer); |
| 2571 EXPECT_EQ(2, result_layer->id()); | 2571 EXPECT_EQ(2, result_layer->id()); |
| 2572 } | 2572 } |
| 2573 | 2573 |
| 2574 } // namespace | 2574 } // namespace |
| 2575 } // namespace cc | 2575 } // namespace cc |
| OLD | NEW |