| 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 2352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2363 | 2363 |
| 2364 TEST_F(LayerTreeImplTest, NumLayersSmallTree) { | 2364 TEST_F(LayerTreeImplTest, NumLayersSmallTree) { |
| 2365 EXPECT_EQ(0u, host_impl().active_tree()->NumLayers()); | 2365 EXPECT_EQ(0u, host_impl().active_tree()->NumLayers()); |
| 2366 scoped_ptr<LayerImpl> root = LayerImpl::Create(host_impl().active_tree(), 1); | 2366 scoped_ptr<LayerImpl> root = LayerImpl::Create(host_impl().active_tree(), 1); |
| 2367 root->AddChild(LayerImpl::Create(host_impl().active_tree(), 2)); | 2367 root->AddChild(LayerImpl::Create(host_impl().active_tree(), 2)); |
| 2368 root->AddChild(LayerImpl::Create(host_impl().active_tree(), 3)); | 2368 root->AddChild(LayerImpl::Create(host_impl().active_tree(), 3)); |
| 2369 root->child_at(1)->AddChild(LayerImpl::Create(host_impl().active_tree(), 4)); | 2369 root->child_at(1)->AddChild(LayerImpl::Create(host_impl().active_tree(), 4)); |
| 2370 EXPECT_EQ(4u, host_impl().active_tree()->NumLayers()); | 2370 EXPECT_EQ(4u, host_impl().active_tree()->NumLayers()); |
| 2371 } | 2371 } |
| 2372 | 2372 |
| 2373 TEST_F(LayerTreeImplTest, DeviceScaleFactorNeedsDrawPropertiesUpdate) { |
| 2374 host_impl().active_tree()->SetDeviceScaleFactor(1.f); |
| 2375 host_impl().active_tree()->UpdateDrawProperties(false); |
| 2376 EXPECT_FALSE(host_impl().active_tree()->needs_update_draw_properties()); |
| 2377 host_impl().active_tree()->SetDeviceScaleFactor(2.f); |
| 2378 EXPECT_TRUE(host_impl().active_tree()->needs_update_draw_properties()); |
| 2379 } |
| 2380 |
| 2373 } // namespace | 2381 } // namespace |
| 2374 } // namespace cc | 2382 } // namespace cc |
| OLD | NEW |