Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(111)

Side by Side Diff: cc/resources/tile_manager_perftest.cc

Issue 1028333002: Chromium -> Mojo roll. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cc/resources/tile_manager.cc ('k') | cc/resources/tile_manager_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/raster_buffer.h" 7 #include "cc/resources/raster_buffer.h"
8 #include "cc/resources/tile.h" 8 #include "cc/resources/tile.h"
9 #include "cc/resources/tile_priority.h" 9 #include "cc/resources/tile_priority.h"
10 #include "cc/test/begin_frame_args_test.h" 10 #include "cc/test/begin_frame_args_test.h"
11 #include "cc/test/fake_impl_proxy.h" 11 #include "cc/test/fake_impl_proxy.h"
12 #include "cc/test/fake_layer_tree_host_impl.h" 12 #include "cc/test/fake_layer_tree_host_impl.h"
13 #include "cc/test/fake_output_surface.h" 13 #include "cc/test/fake_output_surface.h"
14 #include "cc/test/fake_output_surface_client.h" 14 #include "cc/test/fake_output_surface_client.h"
15 #include "cc/test/fake_picture_layer_impl.h" 15 #include "cc/test/fake_picture_layer_impl.h"
16 #include "cc/test/fake_picture_pile_impl.h" 16 #include "cc/test/fake_picture_pile_impl.h"
17 #include "cc/test/fake_tile_manager.h" 17 #include "cc/test/fake_tile_manager.h"
18 #include "cc/test/fake_tile_manager_client.h" 18 #include "cc/test/fake_tile_manager_client.h"
19 #include "cc/test/impl_side_painting_settings.h" 19 #include "cc/test/impl_side_painting_settings.h"
20 #include "cc/test/test_shared_bitmap_manager.h" 20 #include "cc/test/test_shared_bitmap_manager.h"
21 #include "cc/test/test_task_graph_runner.h"
21 #include "cc/test/test_tile_priorities.h" 22 #include "cc/test/test_tile_priorities.h"
22 #include "cc/trees/layer_tree_impl.h" 23 #include "cc/trees/layer_tree_impl.h"
23 24
24 #include "testing/gtest/include/gtest/gtest.h" 25 #include "testing/gtest/include/gtest/gtest.h"
25 #include "testing/perf/perf_test.h" 26 #include "testing/perf/perf_test.h"
26 27
27 #include "ui/gfx/frame_time.h" 28 #include "ui/gfx/frame_time.h"
28 29
29 namespace cc { 30 namespace cc {
30 namespace { 31 namespace {
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 84
84 class TileManagerPerfTest : public testing::Test { 85 class TileManagerPerfTest : public testing::Test {
85 public: 86 public:
86 TileManagerPerfTest() 87 TileManagerPerfTest()
87 : memory_limit_policy_(ALLOW_ANYTHING), 88 : memory_limit_policy_(ALLOW_ANYTHING),
88 max_tiles_(10000), 89 max_tiles_(10000),
89 id_(7), 90 id_(7),
90 proxy_(base::MessageLoopProxy::current()), 91 proxy_(base::MessageLoopProxy::current()),
91 host_impl_(ImplSidePaintingSettings(10000), 92 host_impl_(ImplSidePaintingSettings(10000),
92 &proxy_, 93 &proxy_,
93 &shared_bitmap_manager_), 94 &shared_bitmap_manager_,
95 &task_graph_runner_),
94 timer_(kWarmupRuns, 96 timer_(kWarmupRuns,
95 base::TimeDelta::FromMilliseconds(kTimeLimitMillis), 97 base::TimeDelta::FromMilliseconds(kTimeLimitMillis),
96 kTimeCheckInterval) {} 98 kTimeCheckInterval) {}
97 99
98 void SetTreePriority(TreePriority tree_priority) { 100 void SetTreePriority(TreePriority tree_priority) {
99 GlobalStateThatImpactsTilePriority state; 101 GlobalStateThatImpactsTilePriority state;
100 gfx::Size tile_size(256, 256); 102 gfx::Size tile_size(256, 256);
101 103
102 state.soft_memory_limit_in_bytes = 100 * 1000 * 1000; 104 state.soft_memory_limit_in_bytes = 100 * 1000 * 1000;
103 state.num_resources_limit = max_tiles_; 105 state.num_resources_limit = max_tiles_;
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after
400 perf_test::PrintResult("prepare_tiles", "", test_name, 402 perf_test::PrintResult("prepare_tiles", "", test_name,
401 timer_.LapsPerSecond(), "runs/s", true); 403 timer_.LapsPerSecond(), "runs/s", true);
402 } 404 }
403 405
404 TileManager* tile_manager() { return host_impl_.tile_manager(); } 406 TileManager* tile_manager() { return host_impl_.tile_manager(); }
405 407
406 protected: 408 protected:
407 GlobalStateThatImpactsTilePriority global_state_; 409 GlobalStateThatImpactsTilePriority global_state_;
408 410
409 TestSharedBitmapManager shared_bitmap_manager_; 411 TestSharedBitmapManager shared_bitmap_manager_;
412 TestTaskGraphRunner task_graph_runner_;
410 TileMemoryLimitPolicy memory_limit_policy_; 413 TileMemoryLimitPolicy memory_limit_policy_;
411 int max_tiles_; 414 int max_tiles_;
412 int id_; 415 int id_;
413 FakeImplProxy proxy_; 416 FakeImplProxy proxy_;
414 FakeLayerTreeHostImpl host_impl_; 417 FakeLayerTreeHostImpl host_impl_;
415 FakePictureLayerImpl* pending_root_layer_; 418 FakePictureLayerImpl* pending_root_layer_;
416 FakePictureLayerImpl* active_root_layer_; 419 FakePictureLayerImpl* active_root_layer_;
417 LapTimer timer_; 420 LapTimer timer_;
418 LayerTreeSettings settings_; 421 LayerTreeSettings settings_;
419 422
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
471 RunEvictionQueueConstructAndIterateTest("10_64", 10, 64); 474 RunEvictionQueueConstructAndIterateTest("10_64", 10, 64);
472 RunEvictionQueueConstructAndIterateTest("10_128", 10, 128); 475 RunEvictionQueueConstructAndIterateTest("10_128", 10, 128);
473 RunEvictionQueueConstructAndIterateTest("50_16", 50, 16); 476 RunEvictionQueueConstructAndIterateTest("50_16", 50, 16);
474 RunEvictionQueueConstructAndIterateTest("50_32", 50, 32); 477 RunEvictionQueueConstructAndIterateTest("50_32", 50, 32);
475 RunEvictionQueueConstructAndIterateTest("50_64", 50, 64); 478 RunEvictionQueueConstructAndIterateTest("50_64", 50, 64);
476 RunEvictionQueueConstructAndIterateTest("50_128", 50, 128); 479 RunEvictionQueueConstructAndIterateTest("50_128", 50, 128);
477 } 480 }
478 481
479 } // namespace 482 } // namespace
480 } // namespace cc 483 } // namespace cc
OLDNEW
« no previous file with comments | « cc/resources/tile_manager.cc ('k') | cc/resources/tile_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698