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/picture_layer_tiling_set.h" | 5 #include "cc/picture_layer_tiling_set.h" |
6 | 6 |
7 namespace cc { | 7 namespace cc { |
8 | 8 |
9 namespace { | 9 namespace { |
10 | 10 |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 bool first_time = current_tiling_ < 0; | 200 bool first_time = current_tiling_ < 0; |
201 | 201 |
202 if (!*this && !first_time) | 202 if (!*this && !first_time) |
203 return *this; | 203 return *this; |
204 | 204 |
205 if (tiling_iter_) | 205 if (tiling_iter_) |
206 ++tiling_iter_; | 206 ++tiling_iter_; |
207 | 207 |
208 // Loop until we find a valid place to stop. | 208 // Loop until we find a valid place to stop. |
209 while (true) { | 209 while (true) { |
210 while (tiling_iter_ && (!*tiling_iter_ || !tiling_iter_->GetResourceId())) { | 210 while (tiling_iter_ && (!*tiling_iter_ || |
| 211 !tiling_iter_->drawing_info().is_ready_to_draw())) { |
211 missing_region_.Union(tiling_iter_.geometry_rect()); | 212 missing_region_.Union(tiling_iter_.geometry_rect()); |
212 ++tiling_iter_; | 213 ++tiling_iter_; |
213 } | 214 } |
214 if (tiling_iter_) | 215 if (tiling_iter_) |
215 return *this; | 216 return *this; |
216 | 217 |
217 // If the set of current rects for this tiling is done, go to the next | 218 // If the set of current rects for this tiling is done, go to the next |
218 // tiling and set up to iterate through all of the remaining holes. | 219 // tiling and set up to iterate through all of the remaining holes. |
219 // This will also happen the first time through the loop. | 220 // This will also happen the first time through the loop. |
220 if (!region_iter_.has_rect()) { | 221 if (!region_iter_.has_rect()) { |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
305 } | 306 } |
306 | 307 |
307 scoped_ptr<base::Value> PictureLayerTilingSet::AsValue() const { | 308 scoped_ptr<base::Value> PictureLayerTilingSet::AsValue() const { |
308 scoped_ptr<base::ListValue> state(new base::ListValue()); | 309 scoped_ptr<base::ListValue> state(new base::ListValue()); |
309 for (size_t i = 0; i < tilings_.size(); ++i) | 310 for (size_t i = 0; i < tilings_.size(); ++i) |
310 state->Append(tilings_[i]->AsValue().release()); | 311 state->Append(tilings_[i]->AsValue().release()); |
311 return state.PassAs<base::Value>(); | 312 return state.PassAs<base::Value>(); |
312 } | 313 } |
313 | 314 |
314 } // namespace cc | 315 } // namespace cc |
OLD | NEW |