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/macros.h" | 7 #include "base/macros.h" |
8 #include "base/thread_task_runner_handle.h" | 8 #include "base/thread_task_runner_handle.h" |
9 #include "cc/debug/lap_timer.h" | 9 #include "cc/debug/lap_timer.h" |
10 #include "cc/test/fake_display_list_raster_source.h" | |
11 #include "cc/test/fake_impl_task_runner_provider.h" | 10 #include "cc/test/fake_impl_task_runner_provider.h" |
12 #include "cc/test/fake_layer_tree_host_impl.h" | 11 #include "cc/test/fake_layer_tree_host_impl.h" |
13 #include "cc/test/fake_output_surface.h" | 12 #include "cc/test/fake_output_surface.h" |
14 #include "cc/test/fake_picture_layer_impl.h" | 13 #include "cc/test/fake_picture_layer_impl.h" |
| 14 #include "cc/test/fake_raster_source.h" |
15 #include "cc/test/test_shared_bitmap_manager.h" | 15 #include "cc/test/test_shared_bitmap_manager.h" |
16 #include "cc/test/test_task_graph_runner.h" | 16 #include "cc/test/test_task_graph_runner.h" |
17 #include "cc/tiles/tiling_set_raster_queue_all.h" | 17 #include "cc/tiles/tiling_set_raster_queue_all.h" |
18 #include "cc/trees/layer_tree_impl.h" | 18 #include "cc/trees/layer_tree_impl.h" |
19 #include "testing/gtest/include/gtest/gtest.h" | 19 #include "testing/gtest/include/gtest/gtest.h" |
20 #include "testing/perf/perf_test.h" | 20 #include "testing/perf/perf_test.h" |
21 | 21 |
22 namespace cc { | 22 namespace cc { |
23 namespace { | 23 namespace { |
24 | 24 |
(...skipping 25 matching lines...) Expand all Loading... |
50 timer_(kWarmupRuns, | 50 timer_(kWarmupRuns, |
51 base::TimeDelta::FromMilliseconds(kTimeLimitMillis), | 51 base::TimeDelta::FromMilliseconds(kTimeLimitMillis), |
52 kTimeCheckInterval) {} | 52 kTimeCheckInterval) {} |
53 | 53 |
54 void SetUp() override { | 54 void SetUp() override { |
55 host_impl_.SetVisible(true); | 55 host_impl_.SetVisible(true); |
56 host_impl_.InitializeRenderer(output_surface_.get()); | 56 host_impl_.InitializeRenderer(output_surface_.get()); |
57 } | 57 } |
58 | 58 |
59 void SetupPendingTree(const gfx::Size& layer_bounds) { | 59 void SetupPendingTree(const gfx::Size& layer_bounds) { |
60 scoped_refptr<FakeDisplayListRasterSource> raster_source = | 60 scoped_refptr<FakeRasterSource> raster_source = |
61 FakeDisplayListRasterSource::CreateFilled(layer_bounds); | 61 FakeRasterSource::CreateFilled(layer_bounds); |
62 host_impl_.CreatePendingTree(); | 62 host_impl_.CreatePendingTree(); |
63 LayerTreeImpl* pending_tree = host_impl_.pending_tree(); | 63 LayerTreeImpl* pending_tree = host_impl_.pending_tree(); |
64 pending_tree->ClearLayers(); | 64 pending_tree->ClearLayers(); |
65 | 65 |
66 scoped_ptr<FakePictureLayerImpl> pending_layer = | 66 scoped_ptr<FakePictureLayerImpl> pending_layer = |
67 FakePictureLayerImpl::CreateWithRasterSource(pending_tree, 7, | 67 FakePictureLayerImpl::CreateWithRasterSource(pending_tree, 7, |
68 raster_source); | 68 raster_source); |
69 pending_layer->SetDrawsContent(true); | 69 pending_layer->SetDrawsContent(true); |
70 pending_layer->SetForceRenderSurface(true); | 70 pending_layer->SetForceRenderSurface(true); |
71 pending_tree->SetRootLayer(std::move(pending_layer)); | 71 pending_tree->SetRootLayer(std::move(pending_layer)); |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
255 ASSERT_TRUE(host_impl_.tile_manager() != nullptr); | 255 ASSERT_TRUE(host_impl_.tile_manager() != nullptr); |
256 host_impl_.tile_manager()->InitializeTilesWithResourcesForTesting(all_tiles); | 256 host_impl_.tile_manager()->InitializeTilesWithResourcesForTesting(all_tiles); |
257 | 257 |
258 RunEvictionQueueConstructTest("0_0_100x100", gfx::Rect(0, 0, 100, 100)); | 258 RunEvictionQueueConstructTest("0_0_100x100", gfx::Rect(0, 0, 100, 100)); |
259 RunEvictionQueueConstructTest("5000_0_100x100", gfx::Rect(5000, 0, 100, 100)); | 259 RunEvictionQueueConstructTest("5000_0_100x100", gfx::Rect(5000, 0, 100, 100)); |
260 RunEvictionQueueConstructTest("9999_0_100x100", gfx::Rect(9999, 0, 100, 100)); | 260 RunEvictionQueueConstructTest("9999_0_100x100", gfx::Rect(9999, 0, 100, 100)); |
261 } | 261 } |
262 | 262 |
263 } // namespace | 263 } // namespace |
264 } // namespace cc | 264 } // namespace cc |
OLD | NEW |