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 "base/time/time.h" | 5 #include "base/time/time.h" |
6 #include "cc/debug/lap_timer.h" | 6 #include "cc/debug/lap_timer.h" |
7 #include "cc/resources/tile.h" | 7 #include "cc/resources/tile.h" |
8 #include "cc/resources/tile_priority.h" | 8 #include "cc/resources/tile_priority.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" |
11 #include "cc/test/fake_output_surface.h" | 11 #include "cc/test/fake_output_surface.h" |
12 #include "cc/test/fake_output_surface_client.h" | 12 #include "cc/test/fake_output_surface_client.h" |
13 #include "cc/test/fake_picture_layer_impl.h" | 13 #include "cc/test/fake_picture_layer_impl.h" |
14 #include "cc/test/fake_picture_pile_impl.h" | 14 #include "cc/test/fake_picture_pile_impl.h" |
15 #include "cc/test/fake_tile_manager.h" | 15 #include "cc/test/fake_tile_manager.h" |
16 #include "cc/test/fake_tile_manager_client.h" | 16 #include "cc/test/fake_tile_manager_client.h" |
17 #include "cc/test/impl_side_painting_settings.h" | 17 #include "cc/test/impl_side_painting_settings.h" |
18 #include "cc/test/test_shared_bitmap_manager.h" | 18 #include "cc/test/test_shared_bitmap_manager.h" |
19 #include "cc/test/test_tile_priorities.h" | 19 #include "cc/test/test_tile_priorities.h" |
20 #include "cc/trees/layer_tree_impl.h" | 20 #include "cc/trees/layer_tree_impl.h" |
21 | 21 |
22 #include "testing/gtest/include/gtest/gtest.h" | 22 #include "testing/gtest/include/gtest/gtest.h" |
23 #include "testing/perf/perf_test.h" | 23 #include "testing/perf/perf_test.h" |
24 | 24 |
25 #include "ui/gfx/frame_time.h" | |
26 | |
25 namespace cc { | 27 namespace cc { |
26 | 28 |
27 namespace { | 29 namespace { |
28 | 30 |
29 static const int kTimeLimitMillis = 2000; | 31 static const int kTimeLimitMillis = 2000; |
30 static const int kWarmupRuns = 5; | 32 static const int kWarmupRuns = 5; |
31 static const int kTimeCheckInterval = 10; | 33 static const int kTimeCheckInterval = 10; |
32 | 34 |
33 class FakeRasterizerImpl : public Rasterizer, public RasterizerTaskClient { | 35 class FakeRasterizerImpl : public Rasterizer, public RasterizerTaskClient { |
34 public: | 36 public: |
(...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
383 return state; | 385 return state; |
384 } | 386 } |
385 | 387 |
386 void RunManageTilesTest(const std::string& test_name, | 388 void RunManageTilesTest(const std::string& test_name, |
387 int layer_count, | 389 int layer_count, |
388 int approximate_tile_count_per_layer) { | 390 int approximate_tile_count_per_layer) { |
389 std::vector<LayerImpl*> layers = | 391 std::vector<LayerImpl*> layers = |
390 CreateLayers(layer_count, approximate_tile_count_per_layer); | 392 CreateLayers(layer_count, approximate_tile_count_per_layer); |
391 timer_.Reset(); | 393 timer_.Reset(); |
392 do { | 394 do { |
393 host_impl_.UpdateCurrentFrameTime(); | 395 BeginFrameArgs args = |
396 BeginFrameArgs::Create(gfx::FrameTime::Now(), | |
397 base::TimeTicks(), | |
398 BeginFrameArgs::DefaultInterval()); | |
mithro-old
2014/08/11 07:33:33
src/cc/test/begin_frame_args_test.h has helpers fo
Sami
2014/08/11 17:51:26
Handy!
| |
399 host_impl_.UpdateCurrentFrameTime(args); | |
394 for (unsigned i = 0; i < layers.size(); ++i) | 400 for (unsigned i = 0; i < layers.size(); ++i) |
395 layers[i]->UpdateTiles(NULL); | 401 layers[i]->UpdateTiles(NULL); |
396 | 402 |
397 GlobalStateThatImpactsTilePriority global_state(GlobalStateForTest()); | 403 GlobalStateThatImpactsTilePriority global_state(GlobalStateForTest()); |
398 tile_manager()->ManageTiles(global_state); | 404 tile_manager()->ManageTiles(global_state); |
399 tile_manager()->UpdateVisibleTiles(); | 405 tile_manager()->UpdateVisibleTiles(); |
400 timer_.NextLap(); | 406 timer_.NextLap(); |
401 host_impl_.ResetCurrentFrameTimeForNextFrame(); | 407 host_impl_.ResetCurrentFrameTimeForNextFrame(); |
402 } while (!timer_.HasTimeLimitExpired()); | 408 } while (!timer_.HasTimeLimitExpired()); |
403 | 409 |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
473 RunEvictionQueueConstructAndIterateTest("10_128", 10, 128); | 479 RunEvictionQueueConstructAndIterateTest("10_128", 10, 128); |
474 RunEvictionQueueConstructAndIterateTest("50_16", 50, 16); | 480 RunEvictionQueueConstructAndIterateTest("50_16", 50, 16); |
475 RunEvictionQueueConstructAndIterateTest("50_32", 50, 32); | 481 RunEvictionQueueConstructAndIterateTest("50_32", 50, 32); |
476 RunEvictionQueueConstructAndIterateTest("50_64", 50, 64); | 482 RunEvictionQueueConstructAndIterateTest("50_64", 50, 64); |
477 RunEvictionQueueConstructAndIterateTest("50_128", 50, 128); | 483 RunEvictionQueueConstructAndIterateTest("50_128", 50, 128); |
478 } | 484 } |
479 | 485 |
480 } // namespace | 486 } // namespace |
481 | 487 |
482 } // namespace cc | 488 } // namespace cc |
OLD | NEW |