Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1218)

Side by Side Diff: cc/trees/layer_tree_impl_unittest.cc

Issue 1697613002: cc :: Move tracking of layer_property_changed to main thread (2) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cc/trees/layer_tree_host_impl_unittest.cc ('k') | cc/trees/property_tree.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host_impl_unittest.cc ('k') | cc/trees/property_tree.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698