| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/layers/picture_layer_impl.h" | 5 #include "cc/layers/picture_layer_impl.h" |
| 6 | 6 |
| 7 #include "cc/debug/lap_timer.h" | 7 #include "cc/debug/lap_timer.h" |
| 8 #include "cc/resources/tiling_set_raster_queue_all.h" | 8 #include "cc/resources/tiling_set_raster_queue_all.h" |
| 9 #include "cc/test/fake_impl_proxy.h" | 9 #include "cc/test/fake_impl_proxy.h" |
| 10 #include "cc/test/fake_layer_tree_host_impl.h" | 10 #include "cc/test/fake_layer_tree_host_impl.h" |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 timer_.NextLap(); | 87 timer_.NextLap(); |
| 88 } while (!timer_.HasTimeLimitExpired()); | 88 } while (!timer_.HasTimeLimitExpired()); |
| 89 | 89 |
| 90 perf_test::PrintResult("tiling_set_raster_queue_construct_and_iterate", "", | 90 perf_test::PrintResult("tiling_set_raster_queue_construct_and_iterate", "", |
| 91 test_name, timer_.LapsPerSecond(), "runs/s", true); | 91 test_name, timer_.LapsPerSecond(), "runs/s", true); |
| 92 } | 92 } |
| 93 | 93 |
| 94 void RunRasterQueueConstructTest(const std::string& test_name, | 94 void RunRasterQueueConstructTest(const std::string& test_name, |
| 95 const gfx::Rect& viewport) { | 95 const gfx::Rect& viewport) { |
| 96 host_impl_.SetViewportSize(viewport.size()); | 96 host_impl_.SetViewportSize(viewport.size()); |
| 97 pending_layer_->SetScrollOffset( | 97 pending_layer_->PushScrollOffsetFromMainThread( |
| 98 gfx::ScrollOffset(viewport.x(), viewport.y())); | 98 gfx::ScrollOffset(viewport.x(), viewport.y())); |
| 99 host_impl_.pending_tree()->UpdateDrawProperties(); | 99 host_impl_.pending_tree()->UpdateDrawProperties(); |
| 100 | 100 |
| 101 timer_.Reset(); | 101 timer_.Reset(); |
| 102 do { | 102 do { |
| 103 scoped_ptr<TilingSetRasterQueueAll> queue(new TilingSetRasterQueueAll( | 103 scoped_ptr<TilingSetRasterQueueAll> queue(new TilingSetRasterQueueAll( |
| 104 pending_layer_->picture_layer_tiling_set(), false)); | 104 pending_layer_->picture_layer_tiling_set(), false)); |
| 105 timer_.NextLap(); | 105 timer_.NextLap(); |
| 106 } while (!timer_.HasTimeLimitExpired()); | 106 } while (!timer_.HasTimeLimitExpired()); |
| 107 | 107 |
| (...skipping 28 matching lines...) Expand all Loading... |
| 136 } while (!timer_.HasTimeLimitExpired()); | 136 } while (!timer_.HasTimeLimitExpired()); |
| 137 | 137 |
| 138 perf_test::PrintResult("tiling_set_eviction_queue_construct_and_iterate", | 138 perf_test::PrintResult("tiling_set_eviction_queue_construct_and_iterate", |
| 139 "", test_name, timer_.LapsPerSecond(), "runs/s", | 139 "", test_name, timer_.LapsPerSecond(), "runs/s", |
| 140 true); | 140 true); |
| 141 } | 141 } |
| 142 | 142 |
| 143 void RunEvictionQueueConstructTest(const std::string& test_name, | 143 void RunEvictionQueueConstructTest(const std::string& test_name, |
| 144 const gfx::Rect& viewport) { | 144 const gfx::Rect& viewport) { |
| 145 host_impl_.SetViewportSize(viewport.size()); | 145 host_impl_.SetViewportSize(viewport.size()); |
| 146 pending_layer_->SetScrollOffset( | 146 pending_layer_->PushScrollOffsetFromMainThread( |
| 147 gfx::ScrollOffset(viewport.x(), viewport.y())); | 147 gfx::ScrollOffset(viewport.x(), viewport.y())); |
| 148 host_impl_.pending_tree()->UpdateDrawProperties(); | 148 host_impl_.pending_tree()->UpdateDrawProperties(); |
| 149 | 149 |
| 150 TreePriority priorities[] = {SAME_PRIORITY_FOR_BOTH_TREES, | 150 TreePriority priorities[] = {SAME_PRIORITY_FOR_BOTH_TREES, |
| 151 SMOOTHNESS_TAKES_PRIORITY, | 151 SMOOTHNESS_TAKES_PRIORITY, |
| 152 NEW_CONTENT_TAKES_PRIORITY}; | 152 NEW_CONTENT_TAKES_PRIORITY}; |
| 153 int priority_count = 0; | 153 int priority_count = 0; |
| 154 timer_.Reset(); | 154 timer_.Reset(); |
| 155 do { | 155 do { |
| 156 scoped_ptr<TilingSetEvictionQueue> queue( | 156 scoped_ptr<TilingSetEvictionQueue> queue( |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 248 ASSERT_TRUE(host_impl_.tile_manager() != nullptr); | 248 ASSERT_TRUE(host_impl_.tile_manager() != nullptr); |
| 249 host_impl_.tile_manager()->InitializeTilesWithResourcesForTesting(all_tiles); | 249 host_impl_.tile_manager()->InitializeTilesWithResourcesForTesting(all_tiles); |
| 250 | 250 |
| 251 RunEvictionQueueConstructTest("0_0_100x100", gfx::Rect(0, 0, 100, 100)); | 251 RunEvictionQueueConstructTest("0_0_100x100", gfx::Rect(0, 0, 100, 100)); |
| 252 RunEvictionQueueConstructTest("5000_0_100x100", gfx::Rect(5000, 0, 100, 100)); | 252 RunEvictionQueueConstructTest("5000_0_100x100", gfx::Rect(5000, 0, 100, 100)); |
| 253 RunEvictionQueueConstructTest("9999_0_100x100", gfx::Rect(9999, 0, 100, 100)); | 253 RunEvictionQueueConstructTest("9999_0_100x100", gfx::Rect(9999, 0, 100, 100)); |
| 254 } | 254 } |
| 255 | 255 |
| 256 } // namespace | 256 } // namespace |
| 257 } // namespace cc | 257 } // namespace cc |
| OLD | NEW |