| 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 1999 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2010 EXPECT_TRANSFORMATION_MATRIX_EQ( | 2010 EXPECT_TRANSFORMATION_MATRIX_EQ( |
| 2011 expected_screen_space_transform, | 2011 expected_screen_space_transform, |
| 2012 ScreenSpaceTransformFromPropertyTrees( | 2012 ScreenSpaceTransformFromPropertyTrees( |
| 2013 test_layer, | 2013 test_layer, |
| 2014 host_impl().active_tree()->property_trees()->transform_tree)); | 2014 host_impl().active_tree()->property_trees()->transform_tree)); |
| 2015 | 2015 |
| 2016 // We change the position of the test layer such that the test point is now | 2016 // We change the position of the test layer such that the test point is now |
| 2017 // inside the test_layer. | 2017 // inside the test_layer. |
| 2018 test_layer = host_impl().active_tree()->root_layer()->children()[0].get(); | 2018 test_layer = host_impl().active_tree()->root_layer()->children()[0].get(); |
| 2019 test_layer->SetPosition(gfx::PointF(10.f, 10.f)); | 2019 test_layer->SetPosition(gfx::PointF(10.f, 10.f)); |
| 2020 test_layer->NoteLayerPropertyChanged(); |
| 2020 expected_screen_space_transform.MakeIdentity(); | 2021 expected_screen_space_transform.MakeIdentity(); |
| 2021 expected_screen_space_transform.Translate(10.f, 10.f); | 2022 expected_screen_space_transform.Translate(10.f, 10.f); |
| 2022 | 2023 |
| 2023 host_impl().active_tree()->property_trees()->needs_rebuild = true; | 2024 host_impl().active_tree()->property_trees()->needs_rebuild = true; |
| 2024 host_impl().active_tree()->BuildPropertyTreesForTesting(); | 2025 host_impl().active_tree()->BuildPropertyTreesForTesting(); |
| 2025 result_layer = | 2026 result_layer = |
| 2026 host_impl().active_tree()->FindLayerThatIsHitByPointInTouchHandlerRegion( | 2027 host_impl().active_tree()->FindLayerThatIsHitByPointInTouchHandlerRegion( |
| 2027 test_point); | 2028 test_point); |
| 2028 ASSERT_TRUE(result_layer); | 2029 ASSERT_TRUE(result_layer); |
| 2029 ASSERT_EQ(test_layer, result_layer); | 2030 ASSERT_EQ(test_layer, result_layer); |
| (...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2376 TEST_F(LayerTreeImplTest, DeviceScaleFactorNeedsDrawPropertiesUpdate) { | 2377 TEST_F(LayerTreeImplTest, DeviceScaleFactorNeedsDrawPropertiesUpdate) { |
| 2377 host_impl().active_tree()->SetDeviceScaleFactor(1.f); | 2378 host_impl().active_tree()->SetDeviceScaleFactor(1.f); |
| 2378 host_impl().active_tree()->UpdateDrawProperties(false); | 2379 host_impl().active_tree()->UpdateDrawProperties(false); |
| 2379 EXPECT_FALSE(host_impl().active_tree()->needs_update_draw_properties()); | 2380 EXPECT_FALSE(host_impl().active_tree()->needs_update_draw_properties()); |
| 2380 host_impl().active_tree()->SetDeviceScaleFactor(2.f); | 2381 host_impl().active_tree()->SetDeviceScaleFactor(2.f); |
| 2381 EXPECT_TRUE(host_impl().active_tree()->needs_update_draw_properties()); | 2382 EXPECT_TRUE(host_impl().active_tree()->needs_update_draw_properties()); |
| 2382 } | 2383 } |
| 2383 | 2384 |
| 2384 } // namespace | 2385 } // namespace |
| 2385 } // namespace cc | 2386 } // namespace cc |
| OLD | NEW |