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

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

Issue 638353002: [C++11 Allowed Features] Declares a type-safe null pointer converting from NULL to nullptr in src/… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Formating. Created 6 years, 2 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
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"
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 FakePicturePileImpl::CreateFilledPile(tile_size, layer_bounds); 130 FakePicturePileImpl::CreateFilledPile(tile_size, layer_bounds);
131 scoped_refptr<FakePicturePileImpl> active_pile = 131 scoped_refptr<FakePicturePileImpl> active_pile =
132 FakePicturePileImpl::CreateFilledPile(tile_size, layer_bounds); 132 FakePicturePileImpl::CreateFilledPile(tile_size, layer_bounds);
133 133
134 SetupTrees(pending_pile, active_pile); 134 SetupTrees(pending_pile, active_pile);
135 } 135 }
136 136
137 void ActivateTree() { 137 void ActivateTree() {
138 host_impl_.ActivateSyncTree(); 138 host_impl_.ActivateSyncTree();
139 CHECK(!host_impl_.pending_tree()); 139 CHECK(!host_impl_.pending_tree());
140 pending_root_layer_ = NULL; 140 pending_root_layer_ = nullptr;
141 active_root_layer_ = static_cast<FakePictureLayerImpl*>( 141 active_root_layer_ = static_cast<FakePictureLayerImpl*>(
142 host_impl_.active_tree()->LayerById(id_)); 142 host_impl_.active_tree()->LayerById(id_));
143 } 143 }
144 144
145 void SetupDefaultTreesWithFixedTileSize(const gfx::Size& layer_bounds, 145 void SetupDefaultTreesWithFixedTileSize(const gfx::Size& layer_bounds,
146 const gfx::Size& tile_size) { 146 const gfx::Size& tile_size) {
147 SetupDefaultTrees(layer_bounds); 147 SetupDefaultTrees(layer_bounds);
148 pending_root_layer_->set_fixed_tile_size(tile_size); 148 pending_root_layer_->set_fixed_tile_size(tile_size);
149 active_root_layer_->set_fixed_tile_size(tile_size); 149 active_root_layer_->set_fixed_tile_size(tile_size);
150 } 150 }
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 } 223 }
224 224
225 int priority_count = 0; 225 int priority_count = 0;
226 timer_.Reset(); 226 timer_.Reset();
227 do { 227 do {
228 int count = tile_count; 228 int count = tile_count;
229 RasterTilePriorityQueue queue; 229 RasterTilePriorityQueue queue;
230 host_impl_.BuildRasterQueue(&queue, priorities[priority_count]); 230 host_impl_.BuildRasterQueue(&queue, priorities[priority_count]);
231 while (count--) { 231 while (count--) {
232 ASSERT_FALSE(queue.IsEmpty()); 232 ASSERT_FALSE(queue.IsEmpty());
233 ASSERT_TRUE(queue.Top() != NULL); 233 ASSERT_TRUE(queue.Top() != nullptr);
234 queue.Pop(); 234 queue.Pop();
235 } 235 }
236 priority_count = (priority_count + 1) % arraysize(priorities); 236 priority_count = (priority_count + 1) % arraysize(priorities);
237 timer_.NextLap(); 237 timer_.NextLap();
238 } while (!timer_.HasTimeLimitExpired()); 238 } while (!timer_.HasTimeLimitExpired());
239 239
240 perf_test::PrintResult( 240 perf_test::PrintResult(
241 "tile_manager_raster_tile_queue_construct_and_iterate", 241 "tile_manager_raster_tile_queue_construct_and_iterate",
242 "", 242 "",
243 test_name, 243 test_name,
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 } 301 }
302 } 302 }
303 303
304 timer_.Reset(); 304 timer_.Reset();
305 do { 305 do {
306 int count = tile_count; 306 int count = tile_count;
307 EvictionTilePriorityQueue queue; 307 EvictionTilePriorityQueue queue;
308 host_impl_.BuildEvictionQueue(&queue, priorities[priority_count]); 308 host_impl_.BuildEvictionQueue(&queue, priorities[priority_count]);
309 while (count--) { 309 while (count--) {
310 ASSERT_FALSE(queue.IsEmpty()); 310 ASSERT_FALSE(queue.IsEmpty());
311 ASSERT_TRUE(queue.Top() != NULL); 311 ASSERT_TRUE(queue.Top() != nullptr);
312 queue.Pop(); 312 queue.Pop();
313 } 313 }
314 priority_count = (priority_count + 1) % arraysize(priorities); 314 priority_count = (priority_count + 1) % arraysize(priorities);
315 timer_.NextLap(); 315 timer_.NextLap();
316 } while (!timer_.HasTimeLimitExpired()); 316 } while (!timer_.HasTimeLimitExpired());
317 317
318 perf_test::PrintResult( 318 perf_test::PrintResult(
319 "tile_manager_eviction_tile_queue_construct_and_iterate", 319 "tile_manager_eviction_tile_queue_construct_and_iterate",
320 "", 320 "",
321 test_name, 321 test_name,
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
487 RunEvictionQueueConstructAndIterateTest("10_128", 10, 128); 487 RunEvictionQueueConstructAndIterateTest("10_128", 10, 128);
488 RunEvictionQueueConstructAndIterateTest("50_16", 50, 16); 488 RunEvictionQueueConstructAndIterateTest("50_16", 50, 16);
489 RunEvictionQueueConstructAndIterateTest("50_32", 50, 32); 489 RunEvictionQueueConstructAndIterateTest("50_32", 50, 32);
490 RunEvictionQueueConstructAndIterateTest("50_64", 50, 64); 490 RunEvictionQueueConstructAndIterateTest("50_64", 50, 64);
491 RunEvictionQueueConstructAndIterateTest("50_128", 50, 128); 491 RunEvictionQueueConstructAndIterateTest("50_128", 50, 128);
492 } 492 }
493 493
494 } // namespace 494 } // namespace
495 495
496 } // namespace cc 496 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698