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 "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 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 picture_layer_tiling_->UpdateTilePriorities( | 195 picture_layer_tiling_->UpdateTilePriorities( |
196 ACTIVE_TREE, viewport, 1.0f, 1.0, NULL, NULL, gfx::Transform()); | 196 ACTIVE_TREE, viewport, 1.0f, 1.0, NULL, NULL, gfx::Transform()); |
197 | 197 |
198 timer_.Reset(); | 198 timer_.Reset(); |
199 TreePriority priorities[] = {SAME_PRIORITY_FOR_BOTH_TREES, | 199 TreePriority priorities[] = {SAME_PRIORITY_FOR_BOTH_TREES, |
200 SMOOTHNESS_TAKES_PRIORITY, | 200 SMOOTHNESS_TAKES_PRIORITY, |
201 NEW_CONTENT_TAKES_PRIORITY}; | 201 NEW_CONTENT_TAKES_PRIORITY}; |
202 int priority_count = 0; | 202 int priority_count = 0; |
203 do { | 203 do { |
204 PictureLayerTiling::TilingEvictionTileIterator it( | 204 PictureLayerTiling::TilingEvictionTileIterator it( |
205 picture_layer_tiling_.get(), priorities[priority_count]); | 205 picture_layer_tiling_.get(), |
| 206 priorities[priority_count], |
| 207 TilePriority::NOW, |
| 208 false); |
206 priority_count = (priority_count + 1) % arraysize(priorities); | 209 priority_count = (priority_count + 1) % arraysize(priorities); |
207 timer_.NextLap(); | 210 timer_.NextLap(); |
208 } while (!timer_.HasTimeLimitExpired()); | 211 } while (!timer_.HasTimeLimitExpired()); |
209 | 212 |
210 perf_test::PrintResult("tiling_eviction_tile_iterator_construct", | 213 perf_test::PrintResult("tiling_eviction_tile_iterator_construct", |
211 "", | 214 "", |
212 test_name, | 215 test_name, |
213 timer_.LapsPerSecond(), | 216 timer_.LapsPerSecond(), |
214 "runs/s", | 217 "runs/s", |
215 true); | 218 true); |
(...skipping 23 matching lines...) Expand all Loading... |
239 tile->GetTileVersionForTesting(tile->GetRasterModeForTesting()); | 242 tile->GetTileVersionForTesting(tile->GetRasterModeForTesting()); |
240 tile_version.SetResourceForTesting( | 243 tile_version.SetResourceForTesting( |
241 ScopedResource::Create(resource_provider_.get()).Pass()); | 244 ScopedResource::Create(resource_provider_.get()).Pass()); |
242 } | 245 } |
243 | 246 |
244 int priority_count = 0; | 247 int priority_count = 0; |
245 timer_.Reset(); | 248 timer_.Reset(); |
246 do { | 249 do { |
247 int count = num_tiles; | 250 int count = num_tiles; |
248 PictureLayerTiling::TilingEvictionTileIterator it( | 251 PictureLayerTiling::TilingEvictionTileIterator it( |
249 picture_layer_tiling_.get(), priorities[priority_count]); | 252 picture_layer_tiling_.get(), |
| 253 priorities[priority_count], |
| 254 TilePriority::EVENTUALLY, |
| 255 false); |
250 while (count--) { | 256 while (count--) { |
251 ASSERT_TRUE(it) << "count: " << count; | 257 ASSERT_TRUE(it) << "count: " << count; |
252 ASSERT_TRUE(*it != NULL) << "count: " << count; | 258 ASSERT_TRUE(*it != NULL) << "count: " << count; |
253 ++it; | 259 ++it; |
254 } | 260 } |
255 priority_count = (priority_count + 1) % arraysize(priorities); | 261 priority_count = (priority_count + 1) % arraysize(priorities); |
256 timer_.NextLap(); | 262 timer_.NextLap(); |
257 } while (!timer_.HasTimeLimitExpired()); | 263 } while (!timer_.HasTimeLimitExpired()); |
258 | 264 |
259 // Remove all resources from tiles to make sure the tile version destructor | 265 // Remove all resources from tiles to make sure the tile version destructor |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
356 "32_500x500", 32, gfx::Rect(0, 0, 500, 500)); | 362 "32_500x500", 32, gfx::Rect(0, 0, 500, 500)); |
357 RunEvictionIteratorConstructAndIterateTest( | 363 RunEvictionIteratorConstructAndIterateTest( |
358 "64_100x100", 64, gfx::Rect(0, 0, 100, 100)); | 364 "64_100x100", 64, gfx::Rect(0, 0, 100, 100)); |
359 RunEvictionIteratorConstructAndIterateTest( | 365 RunEvictionIteratorConstructAndIterateTest( |
360 "64_500x500", 64, gfx::Rect(0, 0, 500, 500)); | 366 "64_500x500", 64, gfx::Rect(0, 0, 500, 500)); |
361 } | 367 } |
362 | 368 |
363 } // namespace | 369 } // namespace |
364 | 370 |
365 } // namespace cc | 371 } // namespace cc |
OLD | NEW |