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_proxy.h" | 10 #include "cc/test/fake_impl_proxy.h" |
(...skipping 1452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1463 | 1463 |
1464 // Sanity check the scenario we just created. | 1464 // Sanity check the scenario we just created. |
1465 // The visible content rect for test_layer is actually 100x100, even though | 1465 // The visible content rect for test_layer is actually 100x100, even though |
1466 // its layout size is 50x50, positioned at 25x25. | 1466 // its layout size is 50x50, positioned at 25x25. |
1467 LayerImpl* test_layer = | 1467 LayerImpl* test_layer = |
1468 host_impl().active_tree()->root_layer()->children()[0]; | 1468 host_impl().active_tree()->root_layer()->children()[0]; |
1469 ASSERT_EQ(1u, RenderSurfaceLayerList().size()); | 1469 ASSERT_EQ(1u, RenderSurfaceLayerList().size()); |
1470 ASSERT_EQ(1u, root_layer()->render_surface()->layer_list().size()); | 1470 ASSERT_EQ(1u, root_layer()->render_surface()->layer_list().size()); |
1471 | 1471 |
1472 // Check whether the child layer fits into the root after scaled. | 1472 // Check whether the child layer fits into the root after scaled. |
1473 EXPECT_EQ(gfx::Rect(test_layer->bounds()), | 1473 EXPECT_EQ(gfx::Rect(test_layer->bounds()), test_layer->visible_layer_rect()); |
1474 test_layer->visible_content_rect()); | |
1475 | 1474 |
1476 // Hit checking for a point outside the layer should return a null pointer | 1475 // Hit checking for a point outside the layer should return a null pointer |
1477 // (the root layer does not draw content, so it will not be tested either). | 1476 // (the root layer does not draw content, so it will not be tested either). |
1478 gfx::PointF test_point(76.f, 76.f); | 1477 gfx::PointF test_point(76.f, 76.f); |
1479 test_point = | 1478 test_point = |
1480 gfx::ScalePoint(test_point, device_scale_factor * page_scale_factor); | 1479 gfx::ScalePoint(test_point, device_scale_factor * page_scale_factor); |
1481 LayerImpl* result_layer = | 1480 LayerImpl* result_layer = |
1482 host_impl().active_tree()->FindLayerThatIsHitByPointInTouchHandlerRegion( | 1481 host_impl().active_tree()->FindLayerThatIsHitByPointInTouchHandlerRegion( |
1483 test_point); | 1482 test_point); |
1484 EXPECT_FALSE(result_layer); | 1483 EXPECT_FALSE(result_layer); |
(...skipping 486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1971 EXPECT_EQ(0u, host_impl().active_tree()->NumLayers()); | 1970 EXPECT_EQ(0u, host_impl().active_tree()->NumLayers()); |
1972 scoped_ptr<LayerImpl> root = LayerImpl::Create(host_impl().active_tree(), 1); | 1971 scoped_ptr<LayerImpl> root = LayerImpl::Create(host_impl().active_tree(), 1); |
1973 root->AddChild(LayerImpl::Create(host_impl().active_tree(), 2)); | 1972 root->AddChild(LayerImpl::Create(host_impl().active_tree(), 2)); |
1974 root->AddChild(LayerImpl::Create(host_impl().active_tree(), 3)); | 1973 root->AddChild(LayerImpl::Create(host_impl().active_tree(), 3)); |
1975 root->child_at(1)->AddChild(LayerImpl::Create(host_impl().active_tree(), 4)); | 1974 root->child_at(1)->AddChild(LayerImpl::Create(host_impl().active_tree(), 4)); |
1976 EXPECT_EQ(4u, host_impl().active_tree()->NumLayers()); | 1975 EXPECT_EQ(4u, host_impl().active_tree()->NumLayers()); |
1977 } | 1976 } |
1978 | 1977 |
1979 } // namespace | 1978 } // namespace |
1980 } // namespace cc | 1979 } // namespace cc |
OLD | NEW |