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 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 picture_layer_tiling_->ComputeTilePriorityRects( | 186 picture_layer_tiling_->ComputeTilePriorityRects( |
187 ACTIVE_TREE, viewport, 1.0f, 1.0, Occlusion()); | 187 ACTIVE_TREE, viewport, 1.0f, 1.0, Occlusion()); |
188 | 188 |
189 timer_.Reset(); | 189 timer_.Reset(); |
190 TreePriority priorities[] = {SAME_PRIORITY_FOR_BOTH_TREES, | 190 TreePriority priorities[] = {SAME_PRIORITY_FOR_BOTH_TREES, |
191 SMOOTHNESS_TAKES_PRIORITY, | 191 SMOOTHNESS_TAKES_PRIORITY, |
192 NEW_CONTENT_TAKES_PRIORITY}; | 192 NEW_CONTENT_TAKES_PRIORITY}; |
193 int priority_count = 0; | 193 int priority_count = 0; |
194 do { | 194 do { |
195 PictureLayerTiling::TilingEvictionTileIterator it( | 195 PictureLayerTiling::TilingEvictionTileIterator it( |
196 picture_layer_tiling_.get(), | 196 picture_layer_tiling_.get(), priorities[priority_count], |
197 priorities[priority_count], | 197 PictureLayerTiling::NOW, false); |
198 PictureLayerTiling::NOW); | |
199 priority_count = (priority_count + 1) % arraysize(priorities); | 198 priority_count = (priority_count + 1) % arraysize(priorities); |
200 timer_.NextLap(); | 199 timer_.NextLap(); |
201 } while (!timer_.HasTimeLimitExpired()); | 200 } while (!timer_.HasTimeLimitExpired()); |
202 | 201 |
203 perf_test::PrintResult("tiling_eviction_tile_iterator_construct", | 202 perf_test::PrintResult("tiling_eviction_tile_iterator_construct", |
204 "", | 203 "", |
205 test_name, | 204 test_name, |
206 timer_.LapsPerSecond(), | 205 timer_.LapsPerSecond(), |
207 "runs/s", | 206 "runs/s", |
208 true); | 207 true); |
(...skipping 22 matching lines...) Expand all Loading... |
231 ManagedTileState::DrawInfo& draw_info = tile->draw_info(); | 230 ManagedTileState::DrawInfo& draw_info = tile->draw_info(); |
232 draw_info.SetResourceForTesting( | 231 draw_info.SetResourceForTesting( |
233 ScopedResource::Create(resource_provider_.get()).Pass()); | 232 ScopedResource::Create(resource_provider_.get()).Pass()); |
234 } | 233 } |
235 | 234 |
236 int priority_count = 0; | 235 int priority_count = 0; |
237 timer_.Reset(); | 236 timer_.Reset(); |
238 do { | 237 do { |
239 int count = num_tiles; | 238 int count = num_tiles; |
240 PictureLayerTiling::TilingEvictionTileIterator it( | 239 PictureLayerTiling::TilingEvictionTileIterator it( |
241 picture_layer_tiling_.get(), | 240 picture_layer_tiling_.get(), priorities[priority_count], |
242 priorities[priority_count], | 241 PictureLayerTiling::EVENTUALLY, false); |
243 PictureLayerTiling::EVENTUALLY); | |
244 while (count--) { | 242 while (count--) { |
245 ASSERT_TRUE(it) << "count: " << count; | 243 ASSERT_TRUE(it) << "count: " << count; |
246 ASSERT_TRUE(*it != NULL) << "count: " << count; | 244 ASSERT_TRUE(*it != NULL) << "count: " << count; |
247 ++it; | 245 ++it; |
248 } | 246 } |
249 priority_count = (priority_count + 1) % arraysize(priorities); | 247 priority_count = (priority_count + 1) % arraysize(priorities); |
250 timer_.NextLap(); | 248 timer_.NextLap(); |
251 } while (!timer_.HasTimeLimitExpired()); | 249 } while (!timer_.HasTimeLimitExpired()); |
252 | 250 |
253 // Remove all resources from tiles to make sure the tile version destructor | 251 // 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... |
349 "32_500x500", 32, gfx::Rect(0, 0, 500, 500)); | 347 "32_500x500", 32, gfx::Rect(0, 0, 500, 500)); |
350 RunEvictionIteratorConstructAndIterateTest( | 348 RunEvictionIteratorConstructAndIterateTest( |
351 "64_100x100", 64, gfx::Rect(0, 0, 100, 100)); | 349 "64_100x100", 64, gfx::Rect(0, 0, 100, 100)); |
352 RunEvictionIteratorConstructAndIterateTest( | 350 RunEvictionIteratorConstructAndIterateTest( |
353 "64_500x500", 64, gfx::Rect(0, 0, 500, 500)); | 351 "64_500x500", 64, gfx::Rect(0, 0, 500, 500)); |
354 } | 352 } |
355 | 353 |
356 } // namespace | 354 } // namespace |
357 | 355 |
358 } // namespace cc | 356 } // namespace cc |
OLD | NEW |