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/layers/picture_layer_impl.h" | 5 #include "cc/layers/picture_layer_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <limits> | 8 #include <limits> |
9 | 9 |
10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
(...skipping 1336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1347 if (!iterators_[index] || iterators_[index].get_type() != tile_type) | 1347 if (!iterators_[index] || iterators_[index].get_type() != tile_type) |
1348 ++(*this); | 1348 ++(*this); |
1349 } | 1349 } |
1350 | 1350 |
1351 PictureLayerImpl::LayerRasterTileIterator::~LayerRasterTileIterator() {} | 1351 PictureLayerImpl::LayerRasterTileIterator::~LayerRasterTileIterator() {} |
1352 | 1352 |
1353 PictureLayerImpl::LayerRasterTileIterator::operator bool() const { | 1353 PictureLayerImpl::LayerRasterTileIterator::operator bool() const { |
1354 return layer_ && static_cast<size_t>(current_stage_) < arraysize(stages_); | 1354 return layer_ && static_cast<size_t>(current_stage_) < arraysize(stages_); |
1355 } | 1355 } |
1356 | 1356 |
| 1357 bool PictureLayerImpl::LayerRasterTileIterator::HasTilesRequiredForActivation() |
| 1358 const { |
| 1359 if (!*this) |
| 1360 return false; |
| 1361 |
| 1362 int stage_count = arraysize(stages_); |
| 1363 for (int stage = current_stage_; stage < stage_count; ++stage) { |
| 1364 IteratorType index = stages_[stage].iterator_type; |
| 1365 if (iterators_[index].HasTilesRequiredForActivation()) |
| 1366 return true; |
| 1367 } |
| 1368 return false; |
| 1369 } |
| 1370 |
1357 PictureLayerImpl::LayerRasterTileIterator& | 1371 PictureLayerImpl::LayerRasterTileIterator& |
1358 PictureLayerImpl::LayerRasterTileIterator:: | 1372 PictureLayerImpl::LayerRasterTileIterator:: |
1359 operator++() { | 1373 operator++() { |
1360 IteratorType index = stages_[current_stage_].iterator_type; | 1374 IteratorType index = stages_[current_stage_].iterator_type; |
1361 TilePriority::PriorityBin tile_type = stages_[current_stage_].tile_type; | 1375 TilePriority::PriorityBin tile_type = stages_[current_stage_].tile_type; |
1362 | 1376 |
1363 // First advance the iterator. | 1377 // First advance the iterator. |
1364 if (iterators_[index]) | 1378 if (iterators_[index]) |
1365 ++iterators_[index]; | 1379 ++iterators_[index]; |
1366 | 1380 |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1508 return iterator_index_ < iterators_.size(); | 1522 return iterator_index_ < iterators_.size(); |
1509 } | 1523 } |
1510 | 1524 |
1511 bool PictureLayerImpl::LayerEvictionTileIterator::IsCorrectType( | 1525 bool PictureLayerImpl::LayerEvictionTileIterator::IsCorrectType( |
1512 PictureLayerTiling::TilingEvictionTileIterator* it) const { | 1526 PictureLayerTiling::TilingEvictionTileIterator* it) const { |
1513 return it->get_type() == iteration_stage_ && | 1527 return it->get_type() == iteration_stage_ && |
1514 (**it)->required_for_activation() == required_for_activation_; | 1528 (**it)->required_for_activation() == required_for_activation_; |
1515 } | 1529 } |
1516 | 1530 |
1517 } // namespace cc | 1531 } // namespace cc |
OLD | NEW |