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 "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_picture_layer_impl.h" | 10 #include "cc/test/fake_picture_layer_impl.h" |
11 #include "cc/test/fake_picture_pile_impl.h" | 11 #include "cc/test/fake_picture_pile_impl.h" |
12 #include "cc/test/impl_side_painting_settings.h" | |
13 #include "cc/test/test_shared_bitmap_manager.h" | 12 #include "cc/test/test_shared_bitmap_manager.h" |
14 #include "cc/trees/layer_tree_impl.h" | 13 #include "cc/trees/layer_tree_impl.h" |
15 #include "testing/gtest/include/gtest/gtest.h" | 14 #include "testing/gtest/include/gtest/gtest.h" |
16 #include "testing/perf/perf_test.h" | 15 #include "testing/perf/perf_test.h" |
17 | 16 |
18 namespace cc { | 17 namespace cc { |
19 namespace { | 18 namespace { |
20 | 19 |
21 static const int kTimeLimitMillis = 2000; | 20 static const int kTimeLimitMillis = 2000; |
22 static const int kWarmupRuns = 5; | 21 static const int kWarmupRuns = 5; |
23 static const int kTimeCheckInterval = 10; | 22 static const int kTimeCheckInterval = 10; |
24 | 23 |
25 class PictureLayerImplPerfTest : public testing::Test { | 24 class PictureLayerImplPerfTest : public testing::Test { |
26 public: | 25 public: |
27 PictureLayerImplPerfTest() | 26 PictureLayerImplPerfTest() |
28 : num_runs_(0), | 27 : num_runs_(0), |
29 proxy_(base::MessageLoopProxy::current()), | 28 proxy_(base::MessageLoopProxy::current()), |
30 host_impl_(ImplSidePaintingSettings(), | 29 host_impl_(LayerTreeSettings(true), |
31 &proxy_, | 30 &proxy_, |
32 &shared_bitmap_manager_) {} | 31 &shared_bitmap_manager_) {} |
33 | 32 |
34 virtual void SetUp() OVERRIDE { | 33 virtual void SetUp() OVERRIDE { |
35 host_impl_.InitializeRenderer( | 34 host_impl_.InitializeRenderer( |
36 FakeOutputSurface::Create3d().PassAs<OutputSurface>()); | 35 FakeOutputSurface::Create3d().PassAs<OutputSurface>()); |
37 } | 36 } |
38 | 37 |
39 void SetupPendingTree(const gfx::Size& layer_bounds, | 38 void SetupPendingTree(const gfx::Size& layer_bounds, |
40 const gfx::Size& tile_size) { | 39 const gfx::Size& tile_size) { |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 pending_layer_->AddTiling(2.0f); | 122 pending_layer_->AddTiling(2.0f); |
124 | 123 |
125 RunLayerRasterTileIteratorTest("32_100x100", 32, gfx::Size(100, 100)); | 124 RunLayerRasterTileIteratorTest("32_100x100", 32, gfx::Size(100, 100)); |
126 RunLayerRasterTileIteratorTest("32_500x500", 32, gfx::Size(500, 500)); | 125 RunLayerRasterTileIteratorTest("32_500x500", 32, gfx::Size(500, 500)); |
127 RunLayerRasterTileIteratorTest("64_100x100", 64, gfx::Size(100, 100)); | 126 RunLayerRasterTileIteratorTest("64_100x100", 64, gfx::Size(100, 100)); |
128 RunLayerRasterTileIteratorTest("64_500x500", 64, gfx::Size(500, 500)); | 127 RunLayerRasterTileIteratorTest("64_500x500", 64, gfx::Size(500, 500)); |
129 } | 128 } |
130 | 129 |
131 } // namespace | 130 } // namespace |
132 } // namespace cc | 131 } // namespace cc |
OLD | NEW |