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

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

Issue 22875045: cc: Remove unnecessary "default" cases from switch statements. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 4 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 | Annotate | Revision Log
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/resources/tile.h" 6 #include "cc/resources/tile.h"
7 #include "cc/resources/tile_priority.h" 7 #include "cc/resources/tile_priority.h"
8 #include "cc/test/fake_output_surface.h" 8 #include "cc/test/fake_output_surface.h"
9 #include "cc/test/fake_output_surface_client.h" 9 #include "cc/test/fake_output_surface_client.h"
10 #include "cc/test/fake_picture_pile_impl.h" 10 #include "cc/test/fake_picture_pile_impl.h"
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 0, 93 0,
94 true)); 94 true));
95 tile->SetPriority(ACTIVE_TREE, priority); 95 tile->SetPriority(ACTIVE_TREE, priority);
96 tile->SetPriority(PENDING_TREE, priority); 96 tile->SetPriority(PENDING_TREE, priority);
97 tiles->push_back(tile); 97 tiles->push_back(tile);
98 } 98 }
99 } 99 }
100 100
101 void CreateTiles(int count, TileVector* tiles) { 101 void CreateTiles(int count, TileVector* tiles) {
102 // Roughly an equal amount of all bins. 102 // Roughly an equal amount of all bins.
103 int count_per_bin = count / NUM_BINS; 103 int count_per_bin = count / (MAX_BIN + 1);
104 CreateBinTiles(count_per_bin, TilePriorityForNowBin(), tiles); 104 CreateBinTiles(count_per_bin, TilePriorityForNowBin(), tiles);
105 CreateBinTiles(count_per_bin, TilePriorityForSoonBin(), tiles); 105 CreateBinTiles(count_per_bin, TilePriorityForSoonBin(), tiles);
106 CreateBinTiles(count_per_bin, TilePriorityForEventualBin(), tiles); 106 CreateBinTiles(count_per_bin, TilePriorityForEventualBin(), tiles);
107 CreateBinTiles(count - 3 * count_per_bin, TilePriority(), tiles); 107 CreateBinTiles(count - 3 * count_per_bin, TilePriority(), tiles);
108 } 108 }
109 109
110 void RunManageTilesTest(const std::string test_name, 110 void RunManageTilesTest(const std::string test_name,
111 unsigned tile_count) { 111 unsigned tile_count) {
112 start_time_ = base::TimeTicks(); 112 start_time_ = base::TimeTicks();
113 num_runs_ = 0; 113 num_runs_ = 0;
(...skipping 22 matching lines...) Expand all
136 136
137 TEST_F(TileManagerPerfTest, ManageTiles) { 137 TEST_F(TileManagerPerfTest, ManageTiles) {
138 RunManageTilesTest("manage_tiles_100", 100); 138 RunManageTilesTest("manage_tiles_100", 100);
139 RunManageTilesTest("manage_tiles_1000", 1000); 139 RunManageTilesTest("manage_tiles_1000", 1000);
140 RunManageTilesTest("manage_tiles_10000", 10000); 140 RunManageTilesTest("manage_tiles_10000", 10000);
141 } 141 }
142 142
143 } // namespace 143 } // namespace
144 144
145 } // namespace cc 145 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698