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