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

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

Issue 246673005: cc: Start using raster/eviction iterators in tile manager (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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 1398 matching lines...) Expand 10 before | Expand all | Expand 10 after
1409 if (!iterators_[index] || iterators_[index].get_type() != tile_type) 1409 if (!iterators_[index] || iterators_[index].get_type() != tile_type)
1410 ++(*this); 1410 ++(*this);
1411 } 1411 }
1412 1412
1413 PictureLayerImpl::LayerRasterTileIterator::~LayerRasterTileIterator() {} 1413 PictureLayerImpl::LayerRasterTileIterator::~LayerRasterTileIterator() {}
1414 1414
1415 PictureLayerImpl::LayerRasterTileIterator::operator bool() const { 1415 PictureLayerImpl::LayerRasterTileIterator::operator bool() const {
1416 return layer_ && static_cast<size_t>(current_stage_) < arraysize(stages_); 1416 return layer_ && static_cast<size_t>(current_stage_) < arraysize(stages_);
1417 } 1417 }
1418 1418
1419 bool PictureLayerImpl::LayerRasterTileIterator::HasTilesRequiredForActivation()
1420 const {
1421 if (!*this)
1422 return false;
1423
1424 int stage_count = arraysize(stages_);
1425 for (int stage = current_stage_; stage < stage_count; ++stage) {
1426 IteratorType index = stages_[stage].iterator_type;
1427 if (iterators_[index].HasTilesRequiredForActivation())
1428 return true;
1429 }
1430 return false;
1431 }
1432
1419 PictureLayerImpl::LayerRasterTileIterator& 1433 PictureLayerImpl::LayerRasterTileIterator&
1420 PictureLayerImpl::LayerRasterTileIterator:: 1434 PictureLayerImpl::LayerRasterTileIterator::
1421 operator++() { 1435 operator++() {
1422 IteratorType index = stages_[current_stage_].iterator_type; 1436 IteratorType index = stages_[current_stage_].iterator_type;
1423 TilePriority::PriorityBin tile_type = stages_[current_stage_].tile_type; 1437 TilePriority::PriorityBin tile_type = stages_[current_stage_].tile_type;
1424 1438
1425 // First advance the iterator. 1439 // First advance the iterator.
1426 if (iterators_[index]) 1440 if (iterators_[index])
1427 ++iterators_[index]; 1441 ++iterators_[index];
1428 1442
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
1570 return iterator_index_ < iterators_.size(); 1584 return iterator_index_ < iterators_.size();
1571 } 1585 }
1572 1586
1573 bool PictureLayerImpl::LayerEvictionTileIterator::IsCorrectType( 1587 bool PictureLayerImpl::LayerEvictionTileIterator::IsCorrectType(
1574 PictureLayerTiling::TilingEvictionTileIterator* it) const { 1588 PictureLayerTiling::TilingEvictionTileIterator* it) const {
1575 return it->get_type() == iteration_stage_ && 1589 return it->get_type() == iteration_stage_ &&
1576 (**it)->required_for_activation() == required_for_activation_; 1590 (**it)->required_for_activation() == required_for_activation_;
1577 } 1591 }
1578 1592
1579 } // namespace cc 1593 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698