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