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