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 860 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
871 contents_scale, | 871 contents_scale, |
872 rect); | 872 rect); |
873 iter; | 873 iter; |
874 ++iter) { | 874 ++iter) { |
875 Tile* tile = *iter; | 875 Tile* tile = *iter; |
876 // A null tile (i.e. missing recording) can just be skipped. | 876 // A null tile (i.e. missing recording) can just be skipped. |
877 if (!tile) | 877 if (!tile) |
878 continue; | 878 continue; |
879 | 879 |
880 // If the tile is occluded, don't mark it as required for activation. | 880 // If the tile is occluded, don't mark it as required for activation. |
881 if (tile->is_occluded()) | 881 if (tile->is_occluded(PENDING_TREE)) |
882 continue; | 882 continue; |
883 | 883 |
884 // If the missing region doesn't cover it, this tile is fully | 884 // If the missing region doesn't cover it, this tile is fully |
885 // covered by acceptable tiles at other scales. | 885 // covered by acceptable tiles at other scales. |
886 if (!missing_region.Intersects(iter.geometry_rect())) | 886 if (!missing_region.Intersects(iter.geometry_rect())) |
887 continue; | 887 continue; |
888 | 888 |
889 // If the twin tile doesn't exist (i.e. missing recording or so far away | 889 // If the twin tile doesn't exist (i.e. missing recording or so far away |
890 // that it is outside the visible tile rect) or this tile is shared between | 890 // that it is outside the visible tile rect) or this tile is shared between |
891 // with the twin, then this tile isn't required to prevent flashing. | 891 // with the twin, then this tile isn't required to prevent flashing. |
(...skipping 557 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1449 | 1449 |
1450 stages_[2].iterator_type = HIGH_RES; | 1450 stages_[2].iterator_type = HIGH_RES; |
1451 stages_[2].tile_type = TilePriority::SOON; | 1451 stages_[2].tile_type = TilePriority::SOON; |
1452 | 1452 |
1453 stages_[3].iterator_type = HIGH_RES; | 1453 stages_[3].iterator_type = HIGH_RES; |
1454 stages_[3].tile_type = TilePriority::EVENTUALLY; | 1454 stages_[3].tile_type = TilePriority::EVENTUALLY; |
1455 | 1455 |
1456 IteratorType index = stages_[current_stage_].iterator_type; | 1456 IteratorType index = stages_[current_stage_].iterator_type; |
1457 TilePriority::PriorityBin tile_type = stages_[current_stage_].tile_type; | 1457 TilePriority::PriorityBin tile_type = stages_[current_stage_].tile_type; |
1458 if (!iterators_[index] || iterators_[index].get_type() != tile_type || | 1458 if (!iterators_[index] || iterators_[index].get_type() != tile_type || |
1459 (*iterators_[index])->is_occluded()) | 1459 (*iterators_[index])->is_occluded(tree)) |
1460 ++(*this); | 1460 ++(*this); |
1461 } | 1461 } |
1462 | 1462 |
1463 PictureLayerImpl::LayerRasterTileIterator::~LayerRasterTileIterator() {} | 1463 PictureLayerImpl::LayerRasterTileIterator::~LayerRasterTileIterator() {} |
1464 | 1464 |
1465 PictureLayerImpl::LayerRasterTileIterator::operator bool() const { | 1465 PictureLayerImpl::LayerRasterTileIterator::operator bool() const { |
1466 return layer_ && static_cast<size_t>(current_stage_) < arraysize(stages_); | 1466 return layer_ && static_cast<size_t>(current_stage_) < arraysize(stages_); |
1467 } | 1467 } |
1468 | 1468 |
1469 PictureLayerImpl::LayerRasterTileIterator& | 1469 PictureLayerImpl::LayerRasterTileIterator& |
1470 PictureLayerImpl::LayerRasterTileIterator:: | 1470 PictureLayerImpl::LayerRasterTileIterator:: |
1471 operator++() { | 1471 operator++() { |
| 1472 WhichTree tree = |
| 1473 layer_->layer_tree_impl()->IsActiveTree() ? ACTIVE_TREE : PENDING_TREE; |
| 1474 |
1472 IteratorType index = stages_[current_stage_].iterator_type; | 1475 IteratorType index = stages_[current_stage_].iterator_type; |
1473 TilePriority::PriorityBin tile_type = stages_[current_stage_].tile_type; | 1476 TilePriority::PriorityBin tile_type = stages_[current_stage_].tile_type; |
1474 | 1477 |
1475 // First advance the iterator. | 1478 // First advance the iterator. |
1476 if (iterators_[index]) | 1479 if (iterators_[index]) |
1477 ++iterators_[index]; | 1480 ++iterators_[index]; |
1478 | 1481 |
1479 while (iterators_[index] && iterators_[index].get_type() == tile_type && | 1482 while (iterators_[index] && iterators_[index].get_type() == tile_type && |
1480 (*iterators_[index])->is_occluded()) | 1483 (*iterators_[index])->is_occluded(tree)) |
1481 ++iterators_[index]; | 1484 ++iterators_[index]; |
1482 | 1485 |
1483 if (iterators_[index] && iterators_[index].get_type() == tile_type) | 1486 if (iterators_[index] && iterators_[index].get_type() == tile_type) |
1484 return *this; | 1487 return *this; |
1485 | 1488 |
1486 // Next, advance the stage. | 1489 // Next, advance the stage. |
1487 int stage_count = arraysize(stages_); | 1490 int stage_count = arraysize(stages_); |
1488 ++current_stage_; | 1491 ++current_stage_; |
1489 while (current_stage_ < stage_count) { | 1492 while (current_stage_ < stage_count) { |
1490 index = stages_[current_stage_].iterator_type; | 1493 index = stages_[current_stage_].iterator_type; |
1491 tile_type = stages_[current_stage_].tile_type; | 1494 tile_type = stages_[current_stage_].tile_type; |
1492 | 1495 |
1493 if (iterators_[index] && iterators_[index].get_type() == tile_type && | 1496 if (iterators_[index] && iterators_[index].get_type() == tile_type && |
1494 !(*iterators_[index])->is_occluded()) | 1497 !(*iterators_[index])->is_occluded(tree)) |
1495 break; | 1498 break; |
1496 ++current_stage_; | 1499 ++current_stage_; |
1497 } | 1500 } |
1498 return *this; | 1501 return *this; |
1499 } | 1502 } |
1500 | 1503 |
1501 Tile* PictureLayerImpl::LayerRasterTileIterator::operator*() { | 1504 Tile* PictureLayerImpl::LayerRasterTileIterator::operator*() { |
1502 DCHECK(*this); | 1505 DCHECK(*this); |
1503 | 1506 |
1504 IteratorType index = stages_[current_stage_].iterator_type; | 1507 IteratorType index = stages_[current_stage_].iterator_type; |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1629 return iterator_index_ < iterators_.size(); | 1632 return iterator_index_ < iterators_.size(); |
1630 } | 1633 } |
1631 | 1634 |
1632 bool PictureLayerImpl::LayerEvictionTileIterator::IsCorrectType( | 1635 bool PictureLayerImpl::LayerEvictionTileIterator::IsCorrectType( |
1633 PictureLayerTiling::TilingEvictionTileIterator* it) const { | 1636 PictureLayerTiling::TilingEvictionTileIterator* it) const { |
1634 return it->get_type() == iteration_stage_ && | 1637 return it->get_type() == iteration_stage_ && |
1635 (**it)->required_for_activation() == required_for_activation_; | 1638 (**it)->required_for_activation() == required_for_activation_; |
1636 } | 1639 } |
1637 | 1640 |
1638 } // namespace cc | 1641 } // namespace cc |
OLD | NEW |