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

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 1389 matching lines...) Expand 10 before | Expand all | Expand 10 after
1400 if (!iterators_[index] || iterators_[index].get_type() != tile_type) 1400 if (!iterators_[index] || iterators_[index].get_type() != tile_type)
1401 ++(*this); 1401 ++(*this);
1402 } 1402 }
1403 1403
1404 PictureLayerImpl::LayerRasterTileIterator::~LayerRasterTileIterator() {} 1404 PictureLayerImpl::LayerRasterTileIterator::~LayerRasterTileIterator() {}
1405 1405
1406 PictureLayerImpl::LayerRasterTileIterator::operator bool() const { 1406 PictureLayerImpl::LayerRasterTileIterator::operator bool() const {
1407 return layer_ && static_cast<size_t>(current_stage_) < arraysize(stages_); 1407 return layer_ && static_cast<size_t>(current_stage_) < arraysize(stages_);
1408 } 1408 }
1409 1409
1410 bool PictureLayerImpl::LayerRasterTileIterator::HasTilesRequiredForActivation()
1411 const {
1412 if (!*this)
1413 return false;
1414
1415 int stage_count = arraysize(stages_);
1416 for (int stage = current_stage_; stage < stage_count; ++stage) {
1417 IteratorType index = stages_[stage].iterator_type;
1418 if (iterators_[index].HasTilesRequiredForActivation())
1419 return true;
1420 }
1421 return false;
1422 }
1423
1410 PictureLayerImpl::LayerRasterTileIterator& 1424 PictureLayerImpl::LayerRasterTileIterator&
1411 PictureLayerImpl::LayerRasterTileIterator:: 1425 PictureLayerImpl::LayerRasterTileIterator::
1412 operator++() { 1426 operator++() {
1413 IteratorType index = stages_[current_stage_].iterator_type; 1427 IteratorType index = stages_[current_stage_].iterator_type;
1414 TilePriority::PriorityBin tile_type = stages_[current_stage_].tile_type; 1428 TilePriority::PriorityBin tile_type = stages_[current_stage_].tile_type;
1415 1429
1416 // First advance the iterator. 1430 // First advance the iterator.
1417 if (iterators_[index]) 1431 if (iterators_[index])
1418 ++iterators_[index]; 1432 ++iterators_[index];
1419 1433
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
1561 return iterator_index_ < iterators_.size(); 1575 return iterator_index_ < iterators_.size();
1562 } 1576 }
1563 1577
1564 bool PictureLayerImpl::LayerEvictionTileIterator::IsCorrectType( 1578 bool PictureLayerImpl::LayerEvictionTileIterator::IsCorrectType(
1565 PictureLayerTiling::TilingEvictionTileIterator* it) const { 1579 PictureLayerTiling::TilingEvictionTileIterator* it) const {
1566 return it->get_type() == iteration_stage_ && 1580 return it->get_type() == iteration_stage_ &&
1567 (**it)->required_for_activation() == required_for_activation_; 1581 (**it)->required_for_activation() == required_for_activation_;
1568 } 1582 }
1569 1583
1570 } // namespace cc 1584 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698