OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/resources/tile.h" | 5 #include "cc/resources/tile.h" |
6 #include "cc/resources/tile_priority.h" | 6 #include "cc/resources/tile_priority.h" |
7 #include "cc/test/fake_impl_proxy.h" | 7 #include "cc/test/fake_impl_proxy.h" |
8 #include "cc/test/fake_layer_tree_host_impl.h" | 8 #include "cc/test/fake_layer_tree_host_impl.h" |
| 9 #include "cc/test/fake_layer_tree_settings.h" |
9 #include "cc/test/fake_output_surface.h" | 10 #include "cc/test/fake_output_surface.h" |
10 #include "cc/test/fake_output_surface_client.h" | 11 #include "cc/test/fake_output_surface_client.h" |
11 #include "cc/test/fake_picture_layer_impl.h" | 12 #include "cc/test/fake_picture_layer_impl.h" |
12 #include "cc/test/fake_picture_pile_impl.h" | 13 #include "cc/test/fake_picture_pile_impl.h" |
13 #include "cc/test/fake_tile_manager.h" | 14 #include "cc/test/fake_tile_manager.h" |
14 #include "cc/test/impl_side_painting_settings.h" | |
15 #include "cc/test/test_shared_bitmap_manager.h" | 15 #include "cc/test/test_shared_bitmap_manager.h" |
16 #include "cc/test/test_tile_priorities.h" | 16 #include "cc/test/test_tile_priorities.h" |
17 #include "cc/trees/layer_tree_impl.h" | 17 #include "cc/trees/layer_tree_impl.h" |
18 #include "testing/gtest/include/gtest/gtest.h" | 18 #include "testing/gtest/include/gtest/gtest.h" |
19 | 19 |
20 namespace cc { | 20 namespace cc { |
21 namespace { | 21 namespace { |
22 | 22 |
23 class TileManagerTest : public testing::TestWithParam<bool>, | 23 class TileManagerTest : public testing::TestWithParam<bool>, |
24 public TileManagerClient { | 24 public TileManagerClient { |
(...skipping 614 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
639 | 639 |
640 class TileManagerTileIteratorTest : public testing::Test, | 640 class TileManagerTileIteratorTest : public testing::Test, |
641 public TileManagerClient { | 641 public TileManagerClient { |
642 public: | 642 public: |
643 TileManagerTileIteratorTest() | 643 TileManagerTileIteratorTest() |
644 : memory_limit_policy_(ALLOW_ANYTHING), | 644 : memory_limit_policy_(ALLOW_ANYTHING), |
645 max_tiles_(10000), | 645 max_tiles_(10000), |
646 ready_to_activate_(false), | 646 ready_to_activate_(false), |
647 id_(7), | 647 id_(7), |
648 proxy_(base::MessageLoopProxy::current()), | 648 proxy_(base::MessageLoopProxy::current()), |
649 host_impl_(ImplSidePaintingSettings(), | 649 host_impl_(FakeLayerTreeSettings(), |
650 &proxy_, | 650 &proxy_, |
651 &shared_bitmap_manager_) {} | 651 &shared_bitmap_manager_) {} |
652 | 652 |
653 void SetTreePriority(TreePriority tree_priority) { | 653 void SetTreePriority(TreePriority tree_priority) { |
654 GlobalStateThatImpactsTilePriority state; | 654 GlobalStateThatImpactsTilePriority state; |
655 gfx::Size tile_size(256, 256); | 655 gfx::Size tile_size(256, 256); |
656 | 656 |
657 state.soft_memory_limit_in_bytes = 100 * 1000 * 1000; | 657 state.soft_memory_limit_in_bytes = 100 * 1000 * 1000; |
658 state.num_resources_limit = max_tiles_; | 658 state.num_resources_limit = max_tiles_; |
659 state.hard_memory_limit_in_bytes = state.soft_memory_limit_in_bytes * 2; | 659 state.hard_memory_limit_in_bytes = state.soft_memory_limit_in_bytes * 2; |
(...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1129 | 1129 |
1130 last_tile = tile; | 1130 last_tile = tile; |
1131 new_content_tiles.insert(tile); | 1131 new_content_tiles.insert(tile); |
1132 } | 1132 } |
1133 | 1133 |
1134 EXPECT_EQ(tile_count, new_content_tiles.size()); | 1134 EXPECT_EQ(tile_count, new_content_tiles.size()); |
1135 EXPECT_EQ(all_tiles, new_content_tiles); | 1135 EXPECT_EQ(all_tiles, new_content_tiles); |
1136 } | 1136 } |
1137 } // namespace | 1137 } // namespace |
1138 } // namespace cc | 1138 } // namespace cc |
OLD | NEW |