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

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

Issue 736753002: cc: Implement geometry-based tile eviction (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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 "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/resources/resource_provider.h" 7 #include "cc/resources/resource_provider.h"
8 #include "cc/resources/scoped_resource.h" 8 #include "cc/resources/scoped_resource.h"
9 #include "cc/test/fake_output_surface.h" 9 #include "cc/test/fake_output_surface.h"
10 #include "cc/test/fake_output_surface_client.h" 10 #include "cc/test/fake_output_surface_client.h"
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 picture_layer_tiling_->ComputeTilePriorityRects(viewport, 1.0f, 1.0, 187 picture_layer_tiling_->ComputeTilePriorityRects(viewport, 1.0f, 1.0,
188 Occlusion()); 188 Occlusion());
189 189
190 timer_.Reset(); 190 timer_.Reset();
191 TreePriority priorities[] = {SAME_PRIORITY_FOR_BOTH_TREES, 191 TreePriority priorities[] = {SAME_PRIORITY_FOR_BOTH_TREES,
192 SMOOTHNESS_TAKES_PRIORITY, 192 SMOOTHNESS_TAKES_PRIORITY,
193 NEW_CONTENT_TAKES_PRIORITY}; 193 NEW_CONTENT_TAKES_PRIORITY};
194 int priority_count = 0; 194 int priority_count = 0;
195 do { 195 do {
196 PictureLayerTiling::TilingEvictionTileIterator it( 196 PictureLayerTiling::TilingEvictionTileIterator it(
197 picture_layer_tiling_.get(), 197 picture_layer_tiling_.get(), priorities[priority_count],
198 priorities[priority_count], 198 PictureLayerTiling::NOW, false);
199 PictureLayerTiling::NOW);
200 priority_count = (priority_count + 1) % arraysize(priorities); 199 priority_count = (priority_count + 1) % arraysize(priorities);
201 timer_.NextLap(); 200 timer_.NextLap();
202 } while (!timer_.HasTimeLimitExpired()); 201 } while (!timer_.HasTimeLimitExpired());
203 202
204 perf_test::PrintResult("tiling_eviction_tile_iterator_construct", 203 perf_test::PrintResult("tiling_eviction_tile_iterator_construct",
205 "", 204 "",
206 test_name, 205 test_name,
207 timer_.LapsPerSecond(), 206 timer_.LapsPerSecond(),
208 "runs/s", 207 "runs/s",
209 true); 208 true);
(...skipping 22 matching lines...) Expand all
232 ManagedTileState::DrawInfo& draw_info = tile->draw_info(); 231 ManagedTileState::DrawInfo& draw_info = tile->draw_info();
233 draw_info.SetResourceForTesting( 232 draw_info.SetResourceForTesting(
234 ScopedResource::Create(resource_provider_.get()).Pass()); 233 ScopedResource::Create(resource_provider_.get()).Pass());
235 } 234 }
236 235
237 int priority_count = 0; 236 int priority_count = 0;
238 timer_.Reset(); 237 timer_.Reset();
239 do { 238 do {
240 int count = num_tiles; 239 int count = num_tiles;
241 PictureLayerTiling::TilingEvictionTileIterator it( 240 PictureLayerTiling::TilingEvictionTileIterator it(
242 picture_layer_tiling_.get(), 241 picture_layer_tiling_.get(), priorities[priority_count],
243 priorities[priority_count], 242 PictureLayerTiling::EVENTUALLY, false);
244 PictureLayerTiling::EVENTUALLY);
245 while (count--) { 243 while (count--) {
246 ASSERT_TRUE(it) << "count: " << count; 244 ASSERT_TRUE(it) << "count: " << count;
247 ASSERT_TRUE(*it != NULL) << "count: " << count; 245 ASSERT_TRUE(*it != NULL) << "count: " << count;
248 ++it; 246 ++it;
249 } 247 }
250 priority_count = (priority_count + 1) % arraysize(priorities); 248 priority_count = (priority_count + 1) % arraysize(priorities);
251 timer_.NextLap(); 249 timer_.NextLap();
252 } while (!timer_.HasTimeLimitExpired()); 250 } while (!timer_.HasTimeLimitExpired());
253 251
254 // Remove all resources from tiles to make sure the tile version destructor 252 // Remove all resources from tiles to make sure the tile version destructor
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
350 "32_500x500", 32, gfx::Rect(0, 0, 500, 500)); 348 "32_500x500", 32, gfx::Rect(0, 0, 500, 500));
351 RunEvictionIteratorConstructAndIterateTest( 349 RunEvictionIteratorConstructAndIterateTest(
352 "64_100x100", 64, gfx::Rect(0, 0, 100, 100)); 350 "64_100x100", 64, gfx::Rect(0, 0, 100, 100));
353 RunEvictionIteratorConstructAndIterateTest( 351 RunEvictionIteratorConstructAndIterateTest(
354 "64_500x500", 64, gfx::Rect(0, 0, 500, 500)); 352 "64_500x500", 64, gfx::Rect(0, 0, 500, 500));
355 } 353 }
356 354
357 } // namespace 355 } // namespace
358 356
359 } // namespace cc 357 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698