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/layers/picture_layer_impl.h" | 5 #include "cc/layers/picture_layer_impl.h" |
6 | 6 |
7 #include "base/thread_task_runner_handle.h" | 7 #include "base/thread_task_runner_handle.h" |
8 #include "cc/debug/lap_timer.h" | 8 #include "cc/debug/lap_timer.h" |
9 #include "cc/test/fake_impl_proxy.h" | 9 #include "cc/test/fake_impl_proxy.h" |
10 #include "cc/test/fake_layer_tree_host_impl.h" | 10 #include "cc/test/fake_layer_tree_host_impl.h" |
(...skipping 18 matching lines...) Expand all Loading... |
29 FakePictureLayerImpl* layer, | 29 FakePictureLayerImpl* layer, |
30 std::vector<Tile*>* all_tiles) { | 30 std::vector<Tile*>* all_tiles) { |
31 PictureLayerTiling* tiling = layer->AddTiling(scale); | 31 PictureLayerTiling* tiling = layer->AddTiling(scale); |
32 | 32 |
33 tiling->CreateAllTilesForTesting(); | 33 tiling->CreateAllTilesForTesting(); |
34 std::vector<Tile*> tiling_tiles = tiling->AllTilesForTesting(); | 34 std::vector<Tile*> tiling_tiles = tiling->AllTilesForTesting(); |
35 std::copy( | 35 std::copy( |
36 tiling_tiles.begin(), tiling_tiles.end(), std::back_inserter(*all_tiles)); | 36 tiling_tiles.begin(), tiling_tiles.end(), std::back_inserter(*all_tiles)); |
37 } | 37 } |
38 | 38 |
39 class LayerTreeSettingsWithLargeInterestArea : public LayerTreeSettings { | |
40 public: | |
41 LayerTreeSettingsWithLargeInterestArea() { | |
42 tiling_interest_area_viewport_multiplier = 10000; | |
43 } | |
44 }; | |
45 | |
46 class PictureLayerImplPerfTest : public testing::Test { | 39 class PictureLayerImplPerfTest : public testing::Test { |
47 public: | 40 public: |
48 PictureLayerImplPerfTest() | 41 PictureLayerImplPerfTest() |
49 : proxy_(base::ThreadTaskRunnerHandle::Get()), | 42 : proxy_(base::ThreadTaskRunnerHandle::Get()), |
50 host_impl_(LayerTreeSettingsWithLargeInterestArea(), | 43 host_impl_(LayerTreeSettings(), |
51 &proxy_, | 44 &proxy_, |
52 &shared_bitmap_manager_, | 45 &shared_bitmap_manager_, |
53 &task_graph_runner_), | 46 &task_graph_runner_), |
54 timer_(kWarmupRuns, | 47 timer_(kWarmupRuns, |
55 base::TimeDelta::FromMilliseconds(kTimeLimitMillis), | 48 base::TimeDelta::FromMilliseconds(kTimeLimitMillis), |
56 kTimeCheckInterval) {} | 49 kTimeCheckInterval) {} |
57 | 50 |
58 void SetUp() override { | 51 void SetUp() override { |
59 host_impl_.InitializeRenderer(FakeOutputSurface::Create3d()); | 52 host_impl_.InitializeRenderer(FakeOutputSurface::Create3d()); |
60 } | 53 } |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
250 ASSERT_TRUE(host_impl_.tile_manager() != nullptr); | 243 ASSERT_TRUE(host_impl_.tile_manager() != nullptr); |
251 host_impl_.tile_manager()->InitializeTilesWithResourcesForTesting(all_tiles); | 244 host_impl_.tile_manager()->InitializeTilesWithResourcesForTesting(all_tiles); |
252 | 245 |
253 RunEvictionQueueConstructTest("0_0_100x100", gfx::Rect(0, 0, 100, 100)); | 246 RunEvictionQueueConstructTest("0_0_100x100", gfx::Rect(0, 0, 100, 100)); |
254 RunEvictionQueueConstructTest("5000_0_100x100", gfx::Rect(5000, 0, 100, 100)); | 247 RunEvictionQueueConstructTest("5000_0_100x100", gfx::Rect(5000, 0, 100, 100)); |
255 RunEvictionQueueConstructTest("9999_0_100x100", gfx::Rect(9999, 0, 100, 100)); | 248 RunEvictionQueueConstructTest("9999_0_100x100", gfx::Rect(9999, 0, 100, 100)); |
256 } | 249 } |
257 | 250 |
258 } // namespace | 251 } // namespace |
259 } // namespace cc | 252 } // namespace cc |
OLD | NEW |