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