| 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 1618 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1629 ASSERT_TRUE(result_layer); | 1629 ASSERT_TRUE(result_layer); |
| 1630 EXPECT_EQ(12345, result_layer->id()); | 1630 EXPECT_EQ(12345, result_layer->id()); |
| 1631 | 1631 |
| 1632 // Check update of page scale factor on the active tree when page scale layer | 1632 // Check update of page scale factor on the active tree when page scale layer |
| 1633 // is also the root layer. | 1633 // is also the root layer. |
| 1634 page_scale_factor *= 1.5f; | 1634 page_scale_factor *= 1.5f; |
| 1635 host_impl().active_tree()->SetPageScaleOnActiveTree(page_scale_factor); | 1635 host_impl().active_tree()->SetPageScaleOnActiveTree(page_scale_factor); |
| 1636 EXPECT_EQ(host_impl().active_tree()->root_layer(), | 1636 EXPECT_EQ(host_impl().active_tree()->root_layer(), |
| 1637 host_impl().active_tree()->PageScaleLayer()); | 1637 host_impl().active_tree()->PageScaleLayer()); |
| 1638 | 1638 |
| 1639 test_point = gfx::Point(35, 35); | 1639 test_point = gfx::PointF(35.f, 35.f); |
| 1640 test_point = | 1640 test_point = |
| 1641 gfx::ScalePoint(test_point, device_scale_factor * page_scale_factor); | 1641 gfx::ScalePoint(test_point, device_scale_factor * page_scale_factor); |
| 1642 result_layer = | 1642 result_layer = |
| 1643 host_impl().active_tree()->FindLayerThatIsHitByPointInTouchHandlerRegion( | 1643 host_impl().active_tree()->FindLayerThatIsHitByPointInTouchHandlerRegion( |
| 1644 test_point); | 1644 test_point); |
| 1645 ASSERT_TRUE(result_layer); | 1645 ASSERT_TRUE(result_layer); |
| 1646 EXPECT_EQ(12345, result_layer->id()); | 1646 EXPECT_EQ(12345, result_layer->id()); |
| 1647 | 1647 |
| 1648 test_point = gfx::Point(64, 64); | 1648 test_point = gfx::PointF(64.f, 64.f); |
| 1649 test_point = | 1649 test_point = |
| 1650 gfx::ScalePoint(test_point, device_scale_factor * page_scale_factor); | 1650 gfx::ScalePoint(test_point, device_scale_factor * page_scale_factor); |
| 1651 result_layer = | 1651 result_layer = |
| 1652 host_impl().active_tree()->FindLayerThatIsHitByPointInTouchHandlerRegion( | 1652 host_impl().active_tree()->FindLayerThatIsHitByPointInTouchHandlerRegion( |
| 1653 test_point); | 1653 test_point); |
| 1654 ASSERT_TRUE(result_layer); | 1654 ASSERT_TRUE(result_layer); |
| 1655 EXPECT_EQ(12345, result_layer->id()); | 1655 EXPECT_EQ(12345, result_layer->id()); |
| 1656 } | 1656 } |
| 1657 | 1657 |
| 1658 TEST_F(LayerTreeImplTest, HitCheckingTouchHandlerRegionsForSimpleClippedLayer) { | 1658 TEST_F(LayerTreeImplTest, HitCheckingTouchHandlerRegionsForSimpleClippedLayer) { |
| (...skipping 566 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2225 EXPECT_EQ(0u, host_impl().active_tree()->NumLayers()); | 2225 EXPECT_EQ(0u, host_impl().active_tree()->NumLayers()); |
| 2226 scoped_ptr<LayerImpl> root = LayerImpl::Create(host_impl().active_tree(), 1); | 2226 scoped_ptr<LayerImpl> root = LayerImpl::Create(host_impl().active_tree(), 1); |
| 2227 root->AddChild(LayerImpl::Create(host_impl().active_tree(), 2)); | 2227 root->AddChild(LayerImpl::Create(host_impl().active_tree(), 2)); |
| 2228 root->AddChild(LayerImpl::Create(host_impl().active_tree(), 3)); | 2228 root->AddChild(LayerImpl::Create(host_impl().active_tree(), 3)); |
| 2229 root->child_at(1)->AddChild(LayerImpl::Create(host_impl().active_tree(), 4)); | 2229 root->child_at(1)->AddChild(LayerImpl::Create(host_impl().active_tree(), 4)); |
| 2230 EXPECT_EQ(4u, host_impl().active_tree()->NumLayers()); | 2230 EXPECT_EQ(4u, host_impl().active_tree()->NumLayers()); |
| 2231 } | 2231 } |
| 2232 | 2232 |
| 2233 } // namespace | 2233 } // namespace |
| 2234 } // namespace cc | 2234 } // namespace cc |
| OLD | NEW |