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/debug/lap_timer.h" | 5 #include "cc/debug/lap_timer.h" |
6 #include "cc/resources/picture_layer_tiling.h" | 6 #include "cc/resources/picture_layer_tiling.h" |
7 #include "cc/test/fake_picture_layer_tiling_client.h" | 7 #include "cc/test/fake_picture_layer_tiling_client.h" |
8 | 8 |
9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
10 #include "testing/perf/perf_test.h" | 10 #include "testing/perf/perf_test.h" |
(...skipping 21 matching lines...) Expand all Loading... |
32 picture_layer_tiling_->CreateAllTilesForTesting(); | 32 picture_layer_tiling_->CreateAllTilesForTesting(); |
33 } | 33 } |
34 | 34 |
35 virtual void TearDown() OVERRIDE { | 35 virtual void TearDown() OVERRIDE { |
36 picture_layer_tiling_.reset(NULL); | 36 picture_layer_tiling_.reset(NULL); |
37 } | 37 } |
38 | 38 |
39 void RunInvalidateTest(const std::string& test_name, const Region& region) { | 39 void RunInvalidateTest(const std::string& test_name, const Region& region) { |
40 timer_.Reset(); | 40 timer_.Reset(); |
41 do { | 41 do { |
42 picture_layer_tiling_->Invalidate(region); | 42 picture_layer_tiling_->UpdateTilesToCurrentPile( |
| 43 region, picture_layer_tiling_->TilingRect().size()); |
43 timer_.NextLap(); | 44 timer_.NextLap(); |
44 } while (!timer_.HasTimeLimitExpired()); | 45 } while (!timer_.HasTimeLimitExpired()); |
45 | 46 |
46 perf_test::PrintResult( | 47 perf_test::PrintResult( |
47 "invalidation", "", test_name, timer_.LapsPerSecond(), "runs/s", true); | 48 "invalidation", "", test_name, timer_.LapsPerSecond(), "runs/s", true); |
48 } | 49 } |
49 | 50 |
50 void RunUpdateTilePrioritiesStationaryTest(const std::string& test_name, | 51 void RunUpdateTilePrioritiesStationaryTest(const std::string& test_name, |
51 const gfx::Transform& transform) { | 52 const gfx::Transform& transform) { |
52 gfx::Rect viewport_rect(0, 0, 1024, 768); | 53 gfx::Rect viewport_rect(0, 0, 1024, 768); |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 TEST_F(PictureLayerTilingPerfTest, TilingRasterTileIterator) { | 182 TEST_F(PictureLayerTilingPerfTest, TilingRasterTileIterator) { |
182 RunTilingRasterTileIteratorTest("32_100x100", 32, gfx::Rect(0, 0, 100, 100)); | 183 RunTilingRasterTileIteratorTest("32_100x100", 32, gfx::Rect(0, 0, 100, 100)); |
183 RunTilingRasterTileIteratorTest("32_500x500", 32, gfx::Rect(0, 0, 500, 500)); | 184 RunTilingRasterTileIteratorTest("32_500x500", 32, gfx::Rect(0, 0, 500, 500)); |
184 RunTilingRasterTileIteratorTest("64_100x100", 64, gfx::Rect(0, 0, 100, 100)); | 185 RunTilingRasterTileIteratorTest("64_100x100", 64, gfx::Rect(0, 0, 100, 100)); |
185 RunTilingRasterTileIteratorTest("64_500x500", 64, gfx::Rect(0, 0, 500, 500)); | 186 RunTilingRasterTileIteratorTest("64_500x500", 64, gfx::Rect(0, 0, 500, 500)); |
186 } | 187 } |
187 | 188 |
188 } // namespace | 189 } // namespace |
189 | 190 |
190 } // namespace cc | 191 } // namespace cc |
OLD | NEW |