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/test/fake_impl_proxy.h" | 8 #include "cc/test/fake_impl_proxy.h" |
9 #include "cc/test/fake_layer_tree_host_impl.h" | 9 #include "cc/test/fake_layer_tree_host_impl.h" |
10 #include "cc/test/fake_output_surface.h" | 10 #include "cc/test/fake_output_surface.h" |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 host_impl_.pending_tree()->UpdateDrawProperties(); | 123 host_impl_.pending_tree()->UpdateDrawProperties(); |
124 | 124 |
125 TreePriority priorities[] = {SAME_PRIORITY_FOR_BOTH_TREES, | 125 TreePriority priorities[] = {SAME_PRIORITY_FOR_BOTH_TREES, |
126 SMOOTHNESS_TAKES_PRIORITY, | 126 SMOOTHNESS_TAKES_PRIORITY, |
127 NEW_CONTENT_TAKES_PRIORITY}; | 127 NEW_CONTENT_TAKES_PRIORITY}; |
128 int priority_count = 0; | 128 int priority_count = 0; |
129 timer_.Reset(); | 129 timer_.Reset(); |
130 do { | 130 do { |
131 int count = num_tiles; | 131 int count = num_tiles; |
132 PictureLayerImpl::LayerEvictionTileIterator it( | 132 PictureLayerImpl::LayerEvictionTileIterator it( |
133 pending_layer_, priorities[priority_count]); | 133 pending_layer_, nullptr, priorities[priority_count]); |
134 while (count--) { | 134 while (count--) { |
135 ASSERT_TRUE(it) << "count: " << count; | 135 ASSERT_TRUE(it) << "count: " << count; |
136 ASSERT_TRUE(*it != nullptr) << "count: " << count; | 136 ASSERT_TRUE(*it != nullptr) << "count: " << count; |
137 ++it; | 137 ++it; |
138 } | 138 } |
139 priority_count = (priority_count + 1) % arraysize(priorities); | 139 priority_count = (priority_count + 1) % arraysize(priorities); |
140 timer_.NextLap(); | 140 timer_.NextLap(); |
141 } while (!timer_.HasTimeLimitExpired()); | 141 } while (!timer_.HasTimeLimitExpired()); |
142 | 142 |
143 perf_test::PrintResult("layer_eviction_tile_iterator_construct_and_iterate", | 143 perf_test::PrintResult("layer_eviction_tile_iterator_construct_and_iterate", |
(...skipping 11 matching lines...) Expand all Loading... |
155 gfx::ScrollOffset(viewport.x(), viewport.y())); | 155 gfx::ScrollOffset(viewport.x(), viewport.y())); |
156 host_impl_.pending_tree()->UpdateDrawProperties(); | 156 host_impl_.pending_tree()->UpdateDrawProperties(); |
157 | 157 |
158 TreePriority priorities[] = {SAME_PRIORITY_FOR_BOTH_TREES, | 158 TreePriority priorities[] = {SAME_PRIORITY_FOR_BOTH_TREES, |
159 SMOOTHNESS_TAKES_PRIORITY, | 159 SMOOTHNESS_TAKES_PRIORITY, |
160 NEW_CONTENT_TAKES_PRIORITY}; | 160 NEW_CONTENT_TAKES_PRIORITY}; |
161 int priority_count = 0; | 161 int priority_count = 0; |
162 timer_.Reset(); | 162 timer_.Reset(); |
163 do { | 163 do { |
164 PictureLayerImpl::LayerEvictionTileIterator it( | 164 PictureLayerImpl::LayerEvictionTileIterator it( |
165 pending_layer_, priorities[priority_count]); | 165 pending_layer_, nullptr, priorities[priority_count]); |
166 priority_count = (priority_count + 1) % arraysize(priorities); | 166 priority_count = (priority_count + 1) % arraysize(priorities); |
167 timer_.NextLap(); | 167 timer_.NextLap(); |
168 } while (!timer_.HasTimeLimitExpired()); | 168 } while (!timer_.HasTimeLimitExpired()); |
169 | 169 |
170 perf_test::PrintResult("layer_eviction_tile_iterator_construct", | 170 perf_test::PrintResult("layer_eviction_tile_iterator_construct", |
171 "", | 171 "", |
172 test_name, | 172 test_name, |
173 timer_.LapsPerSecond(), | 173 timer_.LapsPerSecond(), |
174 "runs/s", | 174 "runs/s", |
175 true); | 175 true); |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
267 | 267 |
268 RunEvictionIteratorConstructTest("0_0_100x100", gfx::Rect(0, 0, 100, 100)); | 268 RunEvictionIteratorConstructTest("0_0_100x100", gfx::Rect(0, 0, 100, 100)); |
269 RunEvictionIteratorConstructTest("5000_0_100x100", | 269 RunEvictionIteratorConstructTest("5000_0_100x100", |
270 gfx::Rect(5000, 0, 100, 100)); | 270 gfx::Rect(5000, 0, 100, 100)); |
271 RunEvictionIteratorConstructTest("9999_0_100x100", | 271 RunEvictionIteratorConstructTest("9999_0_100x100", |
272 gfx::Rect(9999, 0, 100, 100)); | 272 gfx::Rect(9999, 0, 100, 100)); |
273 } | 273 } |
274 | 274 |
275 } // namespace | 275 } // namespace |
276 } // namespace cc | 276 } // namespace cc |
OLD | NEW |