OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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/resources/picture_layer_tiling_set.h" | 5 #include "cc/resources/picture_layer_tiling_set.h" |
6 | 6 |
7 namespace cc { | 7 namespace cc { |
8 | 8 |
9 namespace { | 9 namespace { |
10 | 10 |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 ++tiling_iter_; | 216 ++tiling_iter_; |
217 } | 217 } |
218 if (tiling_iter_) | 218 if (tiling_iter_) |
219 return *this; | 219 return *this; |
220 | 220 |
221 // If the set of current rects for this tiling is done, go to the next | 221 // If the set of current rects for this tiling is done, go to the next |
222 // tiling and set up to iterate through all of the remaining holes. | 222 // tiling and set up to iterate through all of the remaining holes. |
223 // This will also happen the first time through the loop. | 223 // This will also happen the first time through the loop. |
224 if (!region_iter_.has_rect()) { | 224 if (!region_iter_.has_rect()) { |
225 current_tiling_ = NextTiling(); | 225 current_tiling_ = NextTiling(); |
226 current_region_.Swap(missing_region_); | 226 current_region_.Swap(&missing_region_); |
227 missing_region_.Clear(); | 227 missing_region_.Clear(); |
228 region_iter_ = Region::Iterator(current_region_); | 228 region_iter_ = Region::Iterator(current_region_); |
229 | 229 |
230 // All done and all filled. | 230 // All done and all filled. |
231 if (!region_iter_.has_rect()) { | 231 if (!region_iter_.has_rect()) { |
232 current_tiling_ = set_->tilings_.size(); | 232 current_tiling_ = set_->tilings_.size(); |
233 return *this; | 233 return *this; |
234 } | 234 } |
235 | 235 |
236 // No more valid tiles, return this checkerboard rect. | 236 // No more valid tiles, return this checkerboard rect. |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
304 } | 304 } |
305 | 305 |
306 scoped_ptr<base::Value> PictureLayerTilingSet::AsValue() const { | 306 scoped_ptr<base::Value> PictureLayerTilingSet::AsValue() const { |
307 scoped_ptr<base::ListValue> state(new base::ListValue()); | 307 scoped_ptr<base::ListValue> state(new base::ListValue()); |
308 for (size_t i = 0; i < tilings_.size(); ++i) | 308 for (size_t i = 0; i < tilings_.size(); ++i) |
309 state->Append(tilings_[i]->AsValue().release()); | 309 state->Append(tilings_[i]->AsValue().release()); |
310 return state.PassAs<base::Value>(); | 310 return state.PassAs<base::Value>(); |
311 } | 311 } |
312 | 312 |
313 } // namespace cc | 313 } // namespace cc |
OLD | NEW |