Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1332)

Side by Side Diff: cc/layers/picture_layer_impl.cc

Issue 343463004: Move occlusion info to TilePriority. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 856 matching lines...) Expand 10 before | Expand all | Expand 10 after
867 contents_scale, 867 contents_scale,
868 rect); 868 rect);
869 iter; 869 iter;
870 ++iter) { 870 ++iter) {
871 Tile* tile = *iter; 871 Tile* tile = *iter;
872 // A null tile (i.e. missing recording) can just be skipped. 872 // A null tile (i.e. missing recording) can just be skipped.
873 if (!tile) 873 if (!tile)
874 continue; 874 continue;
875 875
876 // If the tile is occluded, don't mark it as required for activation. 876 // If the tile is occluded, don't mark it as required for activation.
877 if (tile->is_occluded()) 877 WhichTree tree =
878 layer_tree_impl()->IsActiveTree() ? ACTIVE_TREE : PENDING_TREE;
879 if (tile->priority(tree).is_occluded)
878 continue; 880 continue;
879 881
880 // If the missing region doesn't cover it, this tile is fully 882 // If the missing region doesn't cover it, this tile is fully
881 // covered by acceptable tiles at other scales. 883 // covered by acceptable tiles at other scales.
882 if (!missing_region.Intersects(iter.geometry_rect())) 884 if (!missing_region.Intersects(iter.geometry_rect()))
883 continue; 885 continue;
884 886
885 // If the twin tile doesn't exist (i.e. missing recording or so far away 887 // If the twin tile doesn't exist (i.e. missing recording or so far away
886 // that it is outside the visible tile rect) or this tile is shared between 888 // that it is outside the visible tile rect) or this tile is shared between
887 // with the twin, then this tile isn't required to prevent flashing. 889 // with the twin, then this tile isn't required to prevent flashing.
(...skipping 593 matching lines...) Expand 10 before | Expand all | Expand 10 after
1481 1483
1482 stages_[2].iterator_type = HIGH_RES; 1484 stages_[2].iterator_type = HIGH_RES;
1483 stages_[2].tile_type = TilePriority::SOON; 1485 stages_[2].tile_type = TilePriority::SOON;
1484 1486
1485 stages_[3].iterator_type = HIGH_RES; 1487 stages_[3].iterator_type = HIGH_RES;
1486 stages_[3].tile_type = TilePriority::EVENTUALLY; 1488 stages_[3].tile_type = TilePriority::EVENTUALLY;
1487 1489
1488 IteratorType index = stages_[current_stage_].iterator_type; 1490 IteratorType index = stages_[current_stage_].iterator_type;
1489 TilePriority::PriorityBin tile_type = stages_[current_stage_].tile_type; 1491 TilePriority::PriorityBin tile_type = stages_[current_stage_].tile_type;
1490 if (!iterators_[index] || iterators_[index].get_type() != tile_type || 1492 if (!iterators_[index] || iterators_[index].get_type() != tile_type ||
1491 (*iterators_[index])->is_occluded()) 1493 (*iterators_[index])->priority(tree).is_occluded)
1492 ++(*this); 1494 ++(*this);
1493 } 1495 }
1494 1496
1495 PictureLayerImpl::LayerRasterTileIterator::~LayerRasterTileIterator() {} 1497 PictureLayerImpl::LayerRasterTileIterator::~LayerRasterTileIterator() {}
1496 1498
1497 PictureLayerImpl::LayerRasterTileIterator::operator bool() const { 1499 PictureLayerImpl::LayerRasterTileIterator::operator bool() const {
1498 return layer_ && static_cast<size_t>(current_stage_) < arraysize(stages_); 1500 return layer_ && static_cast<size_t>(current_stage_) < arraysize(stages_);
1499 } 1501 }
1500 1502
1501 PictureLayerImpl::LayerRasterTileIterator& 1503 PictureLayerImpl::LayerRasterTileIterator&
1502 PictureLayerImpl::LayerRasterTileIterator:: 1504 PictureLayerImpl::LayerRasterTileIterator::
1503 operator++() { 1505 operator++() {
1506 WhichTree tree =
1507 layer_->layer_tree_impl()->IsActiveTree() ? ACTIVE_TREE : PENDING_TREE;
1508
1504 IteratorType index = stages_[current_stage_].iterator_type; 1509 IteratorType index = stages_[current_stage_].iterator_type;
1505 TilePriority::PriorityBin tile_type = stages_[current_stage_].tile_type; 1510 TilePriority::PriorityBin tile_type = stages_[current_stage_].tile_type;
1506 1511
1507 // First advance the iterator. 1512 // First advance the iterator.
1508 if (iterators_[index]) 1513 if (iterators_[index])
1509 ++iterators_[index]; 1514 ++iterators_[index];
1510 1515
1511 while (iterators_[index] && iterators_[index].get_type() == tile_type && 1516 while (iterators_[index] && iterators_[index].get_type() == tile_type &&
1512 (*iterators_[index])->is_occluded()) 1517 (*iterators_[index])->priority(tree).is_occluded)
1513 ++iterators_[index]; 1518 ++iterators_[index];
1514 1519
1515 if (iterators_[index] && iterators_[index].get_type() == tile_type) 1520 if (iterators_[index] && iterators_[index].get_type() == tile_type)
1516 return *this; 1521 return *this;
1517 1522
1518 // Next, advance the stage. 1523 // Next, advance the stage.
1519 int stage_count = arraysize(stages_); 1524 int stage_count = arraysize(stages_);
1520 ++current_stage_; 1525 ++current_stage_;
1521 while (current_stage_ < stage_count) { 1526 while (current_stage_ < stage_count) {
1522 index = stages_[current_stage_].iterator_type; 1527 index = stages_[current_stage_].iterator_type;
1523 tile_type = stages_[current_stage_].tile_type; 1528 tile_type = stages_[current_stage_].tile_type;
1524 1529
1525 if (iterators_[index] && iterators_[index].get_type() == tile_type && 1530 if (iterators_[index] && iterators_[index].get_type() == tile_type &&
1526 !(*iterators_[index])->is_occluded()) 1531 !(*iterators_[index])->priority(tree).is_occluded)
1527 break; 1532 break;
1528 ++current_stage_; 1533 ++current_stage_;
1529 } 1534 }
1530 return *this; 1535 return *this;
1531 } 1536 }
1532 1537
1533 Tile* PictureLayerImpl::LayerRasterTileIterator::operator*() { 1538 Tile* PictureLayerImpl::LayerRasterTileIterator::operator*() {
1534 DCHECK(*this); 1539 DCHECK(*this);
1535 1540
1536 IteratorType index = stages_[current_stage_].iterator_type; 1541 IteratorType index = stages_[current_stage_].iterator_type;
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
1661 return iterator_index_ < iterators_.size(); 1666 return iterator_index_ < iterators_.size();
1662 } 1667 }
1663 1668
1664 bool PictureLayerImpl::LayerEvictionTileIterator::IsCorrectType( 1669 bool PictureLayerImpl::LayerEvictionTileIterator::IsCorrectType(
1665 PictureLayerTiling::TilingEvictionTileIterator* it) const { 1670 PictureLayerTiling::TilingEvictionTileIterator* it) const {
1666 return it->get_type() == iteration_stage_ && 1671 return it->get_type() == iteration_stage_ &&
1667 (**it)->required_for_activation() == required_for_activation_; 1672 (**it)->required_for_activation() == required_for_activation_;
1668 } 1673 }
1669 1674
1670 } // namespace cc 1675 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/layers/picture_layer_impl_unittest.cc » ('j') | cc/layers/picture_layer_impl_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698