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 "base/thread_task_runner_handle.h" | 7 #include "base/thread_task_runner_handle.h" |
8 #include "cc/debug/lap_timer.h" | 8 #include "cc/debug/lap_timer.h" |
9 #include "cc/resources/tiling_set_raster_queue_all.h" | 9 #include "cc/resources/tiling_set_raster_queue_all.h" |
10 #include "cc/test/fake_impl_proxy.h" | 10 #include "cc/test/fake_impl_proxy.h" |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 bool update_lcd_text = false; | 78 bool update_lcd_text = false; |
79 host_impl_.pending_tree()->UpdateDrawProperties(update_lcd_text); | 79 host_impl_.pending_tree()->UpdateDrawProperties(update_lcd_text); |
80 | 80 |
81 timer_.Reset(); | 81 timer_.Reset(); |
82 do { | 82 do { |
83 int count = num_tiles; | 83 int count = num_tiles; |
84 scoped_ptr<TilingSetRasterQueueAll> queue(new TilingSetRasterQueueAll( | 84 scoped_ptr<TilingSetRasterQueueAll> queue(new TilingSetRasterQueueAll( |
85 pending_layer_->picture_layer_tiling_set(), false)); | 85 pending_layer_->picture_layer_tiling_set(), false)); |
86 while (count--) { | 86 while (count--) { |
87 ASSERT_TRUE(!queue->IsEmpty()) << "count: " << count; | 87 ASSERT_TRUE(!queue->IsEmpty()) << "count: " << count; |
88 ASSERT_TRUE(queue->Top() != nullptr) << "count: " << count; | 88 ASSERT_TRUE(queue->Top().tile()) << "count: " << count; |
89 queue->Pop(); | 89 queue->Pop(); |
90 } | 90 } |
91 timer_.NextLap(); | 91 timer_.NextLap(); |
92 } while (!timer_.HasTimeLimitExpired()); | 92 } while (!timer_.HasTimeLimitExpired()); |
93 | 93 |
94 perf_test::PrintResult("tiling_set_raster_queue_construct_and_iterate", "", | 94 perf_test::PrintResult("tiling_set_raster_queue_construct_and_iterate", "", |
95 test_name, timer_.LapsPerSecond(), "runs/s", true); | 95 test_name, timer_.LapsPerSecond(), "runs/s", true); |
96 } | 96 } |
97 | 97 |
98 void RunRasterQueueConstructTest(const std::string& test_name, | 98 void RunRasterQueueConstructTest(const std::string& test_name, |
(...skipping 23 matching lines...) Expand all Loading... |
122 bool update_lcd_text = false; | 122 bool update_lcd_text = false; |
123 host_impl_.pending_tree()->UpdateDrawProperties(update_lcd_text); | 123 host_impl_.pending_tree()->UpdateDrawProperties(update_lcd_text); |
124 | 124 |
125 timer_.Reset(); | 125 timer_.Reset(); |
126 do { | 126 do { |
127 int count = num_tiles; | 127 int count = num_tiles; |
128 scoped_ptr<TilingSetEvictionQueue> queue(new TilingSetEvictionQueue( | 128 scoped_ptr<TilingSetEvictionQueue> queue(new TilingSetEvictionQueue( |
129 pending_layer_->picture_layer_tiling_set())); | 129 pending_layer_->picture_layer_tiling_set())); |
130 while (count--) { | 130 while (count--) { |
131 ASSERT_TRUE(!queue->IsEmpty()) << "count: " << count; | 131 ASSERT_TRUE(!queue->IsEmpty()) << "count: " << count; |
132 ASSERT_TRUE(queue->Top() != nullptr) << "count: " << count; | 132 ASSERT_TRUE(queue->Top().tile()) << "count: " << count; |
133 queue->Pop(); | 133 queue->Pop(); |
134 } | 134 } |
135 timer_.NextLap(); | 135 timer_.NextLap(); |
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 |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
244 ASSERT_TRUE(host_impl_.tile_manager() != nullptr); | 244 ASSERT_TRUE(host_impl_.tile_manager() != nullptr); |
245 host_impl_.tile_manager()->InitializeTilesWithResourcesForTesting(all_tiles); | 245 host_impl_.tile_manager()->InitializeTilesWithResourcesForTesting(all_tiles); |
246 | 246 |
247 RunEvictionQueueConstructTest("0_0_100x100", gfx::Rect(0, 0, 100, 100)); | 247 RunEvictionQueueConstructTest("0_0_100x100", gfx::Rect(0, 0, 100, 100)); |
248 RunEvictionQueueConstructTest("5000_0_100x100", gfx::Rect(5000, 0, 100, 100)); | 248 RunEvictionQueueConstructTest("5000_0_100x100", gfx::Rect(5000, 0, 100, 100)); |
249 RunEvictionQueueConstructTest("9999_0_100x100", gfx::Rect(9999, 0, 100, 100)); | 249 RunEvictionQueueConstructTest("9999_0_100x100", gfx::Rect(9999, 0, 100, 100)); |
250 } | 250 } |
251 | 251 |
252 } // namespace | 252 } // namespace |
253 } // namespace cc | 253 } // namespace cc |
OLD | NEW |