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/tiles/tiling_set_raster_queue_all.h" | 5 #include "cc/tiles/tiling_set_raster_queue_all.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
265 TilingSetRasterQueueAll::SkewportTilingIterator::SkewportTilingIterator( | 265 TilingSetRasterQueueAll::SkewportTilingIterator::SkewportTilingIterator( |
266 PictureLayerTiling* tiling, | 266 PictureLayerTiling* tiling, |
267 TilingData* tiling_data) | 267 TilingData* tiling_data) |
268 : OnePriorityRectIterator(tiling, | 268 : OnePriorityRectIterator(tiling, |
269 tiling_data, | 269 tiling_data, |
270 PictureLayerTiling::SKEWPORT_RECT) { | 270 PictureLayerTiling::SKEWPORT_RECT) { |
271 if (!tiling_->has_skewport_rect_tiles()) | 271 if (!tiling_->has_skewport_rect_tiles()) |
272 return; | 272 return; |
273 iterator_ = TilingData::SpiralDifferenceIterator( | 273 iterator_ = TilingData::SpiralDifferenceIterator( |
274 tiling_data_, tiling_->current_skewport_rect(), | 274 tiling_data_, tiling_->current_skewport_rect(), |
275 tiling_->current_visible_rect(), tiling_->current_visible_rect()); | 275 tiling_->current_visible_rect(), tiling_->current_visible_rect(), |
| 276 TilingData::IsPyramidSequenceEnabled()); |
276 if (!iterator_) | 277 if (!iterator_) |
277 return; | 278 return; |
278 if (!GetFirstTileAndCheckIfValid(&iterator_)) { | 279 if (!GetFirstTileAndCheckIfValid(&iterator_)) { |
279 ++(*this); | 280 ++(*this); |
280 return; | 281 return; |
281 } | 282 } |
282 } | 283 } |
283 | 284 |
284 TilingSetRasterQueueAll::SkewportTilingIterator& | 285 TilingSetRasterQueueAll::SkewportTilingIterator& |
285 TilingSetRasterQueueAll::SkewportTilingIterator:: | 286 TilingSetRasterQueueAll::SkewportTilingIterator:: |
286 operator++() { | 287 operator++() { |
287 AdvanceToNextTile(&iterator_); | 288 AdvanceToNextTile(&iterator_); |
288 return *this; | 289 return *this; |
289 } | 290 } |
290 | 291 |
291 // SoonBorderTilingIterator. | 292 // SoonBorderTilingIterator. |
292 TilingSetRasterQueueAll::SoonBorderTilingIterator::SoonBorderTilingIterator( | 293 TilingSetRasterQueueAll::SoonBorderTilingIterator::SoonBorderTilingIterator( |
293 PictureLayerTiling* tiling, | 294 PictureLayerTiling* tiling, |
294 TilingData* tiling_data) | 295 TilingData* tiling_data) |
295 : OnePriorityRectIterator(tiling, | 296 : OnePriorityRectIterator(tiling, |
296 tiling_data, | 297 tiling_data, |
297 PictureLayerTiling::SOON_BORDER_RECT) { | 298 PictureLayerTiling::SOON_BORDER_RECT) { |
298 if (!tiling_->has_soon_border_rect_tiles()) | 299 if (!tiling_->has_soon_border_rect_tiles()) |
299 return; | 300 return; |
300 iterator_ = TilingData::SpiralDifferenceIterator( | 301 iterator_ = TilingData::SpiralDifferenceIterator( |
301 tiling_data_, tiling_->current_soon_border_rect(), | 302 tiling_data_, tiling_->current_soon_border_rect(), |
302 tiling_->current_skewport_rect(), tiling_->current_visible_rect()); | 303 tiling_->current_skewport_rect(), tiling_->current_visible_rect(), |
| 304 TilingData::IsPyramidSequenceEnabled()); |
303 if (!iterator_) | 305 if (!iterator_) |
304 return; | 306 return; |
305 if (!GetFirstTileAndCheckIfValid(&iterator_)) { | 307 if (!GetFirstTileAndCheckIfValid(&iterator_)) { |
306 ++(*this); | 308 ++(*this); |
307 return; | 309 return; |
308 } | 310 } |
309 } | 311 } |
310 | 312 |
311 TilingSetRasterQueueAll::SoonBorderTilingIterator& | 313 TilingSetRasterQueueAll::SoonBorderTilingIterator& |
312 TilingSetRasterQueueAll::SoonBorderTilingIterator:: | 314 TilingSetRasterQueueAll::SoonBorderTilingIterator:: |
313 operator++() { | 315 operator++() { |
314 AdvanceToNextTile(&iterator_); | 316 AdvanceToNextTile(&iterator_); |
315 return *this; | 317 return *this; |
316 } | 318 } |
317 | 319 |
318 // EventuallyTilingIterator. | 320 // EventuallyTilingIterator. |
319 TilingSetRasterQueueAll::EventuallyTilingIterator::EventuallyTilingIterator( | 321 TilingSetRasterQueueAll::EventuallyTilingIterator::EventuallyTilingIterator( |
320 PictureLayerTiling* tiling, | 322 PictureLayerTiling* tiling, |
321 TilingData* tiling_data) | 323 TilingData* tiling_data) |
322 : OnePriorityRectIterator(tiling, | 324 : OnePriorityRectIterator(tiling, |
323 tiling_data, | 325 tiling_data, |
324 PictureLayerTiling::EVENTUALLY_RECT) { | 326 PictureLayerTiling::EVENTUALLY_RECT) { |
325 if (!tiling_->has_eventually_rect_tiles()) | 327 if (!tiling_->has_eventually_rect_tiles()) |
326 return; | 328 return; |
327 iterator_ = TilingData::SpiralDifferenceIterator( | 329 iterator_ = TilingData::SpiralDifferenceIterator( |
328 tiling_data_, tiling_->current_eventually_rect(), | 330 tiling_data_, tiling_->current_eventually_rect(), |
329 tiling_->current_skewport_rect(), tiling_->current_soon_border_rect()); | 331 tiling_->current_skewport_rect(), tiling_->current_soon_border_rect(), |
| 332 TilingData::IsPyramidSequenceEnabled()); |
330 if (!iterator_) | 333 if (!iterator_) |
331 return; | 334 return; |
332 if (!GetFirstTileAndCheckIfValid(&iterator_)) { | 335 if (!GetFirstTileAndCheckIfValid(&iterator_)) { |
333 ++(*this); | 336 ++(*this); |
334 return; | 337 return; |
335 } | 338 } |
336 } | 339 } |
337 | 340 |
338 TilingSetRasterQueueAll::EventuallyTilingIterator& | 341 TilingSetRasterQueueAll::EventuallyTilingIterator& |
339 TilingSetRasterQueueAll::EventuallyTilingIterator:: | 342 TilingSetRasterQueueAll::EventuallyTilingIterator:: |
(...skipping 11 matching lines...) Expand all Loading... |
351 TilingData* tiling_data) | 354 TilingData* tiling_data) |
352 : tiling_(tiling), tiling_data_(tiling_data), phase_(Phase::VISIBLE_RECT) { | 355 : tiling_(tiling), tiling_data_(tiling_data), phase_(Phase::VISIBLE_RECT) { |
353 visible_iterator_ = VisibleTilingIterator(tiling_, tiling_data_); | 356 visible_iterator_ = VisibleTilingIterator(tiling_, tiling_data_); |
354 if (visible_iterator_.done()) { | 357 if (visible_iterator_.done()) { |
355 AdvancePhase(); | 358 AdvancePhase(); |
356 return; | 359 return; |
357 } | 360 } |
358 current_tile_ = *visible_iterator_; | 361 current_tile_ = *visible_iterator_; |
359 } | 362 } |
360 | 363 |
| 364 TilingSetRasterQueueAll::TilingIterator::TilingIterator( |
| 365 const TilingSetRasterQueueAll::TilingIterator& other) = default; |
| 366 |
| 367 TilingSetRasterQueueAll::TilingIterator::TilingIterator( |
| 368 TilingSetRasterQueueAll::TilingIterator&& other) = default; |
| 369 |
361 TilingSetRasterQueueAll::TilingIterator::~TilingIterator() { | 370 TilingSetRasterQueueAll::TilingIterator::~TilingIterator() { |
362 } | 371 } |
363 | 372 |
| 373 TilingSetRasterQueueAll::TilingIterator& |
| 374 TilingSetRasterQueueAll::TilingIterator::operator=( |
| 375 const TilingSetRasterQueueAll::TilingIterator& other) = default; |
| 376 |
| 377 TilingSetRasterQueueAll::TilingIterator& |
| 378 TilingSetRasterQueueAll::TilingIterator::operator=( |
| 379 TilingSetRasterQueueAll::TilingIterator&& other) = default; |
| 380 |
364 void TilingSetRasterQueueAll::TilingIterator::AdvancePhase() { | 381 void TilingSetRasterQueueAll::TilingIterator::AdvancePhase() { |
365 DCHECK_LT(phase_, Phase::EVENTUALLY_RECT); | 382 DCHECK_LT(phase_, Phase::EVENTUALLY_RECT); |
366 | 383 |
367 current_tile_ = PrioritizedTile(); | 384 current_tile_ = PrioritizedTile(); |
368 while (!current_tile_.tile() && phase_ < Phase::EVENTUALLY_RECT) { | 385 while (!current_tile_.tile() && phase_ < Phase::EVENTUALLY_RECT) { |
369 phase_ = static_cast<Phase>(phase_ + 1); | 386 phase_ = static_cast<Phase>(phase_ + 1); |
370 switch (phase_) { | 387 switch (phase_) { |
371 case Phase::VISIBLE_RECT: | 388 case Phase::VISIBLE_RECT: |
372 NOTREACHED(); | 389 NOTREACHED(); |
373 return; | 390 return; |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
438 current_tile_ = PrioritizedTile(); | 455 current_tile_ = PrioritizedTile(); |
439 return *this; | 456 return *this; |
440 } | 457 } |
441 current_tile_ = *eventually_iterator_; | 458 current_tile_ = *eventually_iterator_; |
442 break; | 459 break; |
443 } | 460 } |
444 return *this; | 461 return *this; |
445 } | 462 } |
446 | 463 |
447 } // namespace cc | 464 } // namespace cc |
OLD | NEW |