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

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: review 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 1345 matching lines...) Expand 10 before | Expand all | Expand 10 after
1356 if (!iterators_[index] || iterators_[index].get_type() != tile_type) 1356 if (!iterators_[index] || iterators_[index].get_type() != tile_type)
1357 ++(*this); 1357 ++(*this);
1358 } 1358 }
1359 1359
1360 PictureLayerImpl::LayerRasterTileIterator::~LayerRasterTileIterator() {} 1360 PictureLayerImpl::LayerRasterTileIterator::~LayerRasterTileIterator() {}
1361 1361
1362 PictureLayerImpl::LayerRasterTileIterator::operator bool() const { 1362 PictureLayerImpl::LayerRasterTileIterator::operator bool() const {
1363 return layer_ && static_cast<size_t>(current_stage_) < arraysize(stages_); 1363 return layer_ && static_cast<size_t>(current_stage_) < arraysize(stages_);
1364 } 1364 }
1365 1365
1366 bool PictureLayerImpl::LayerRasterTileIterator::HasTilesRequiredForActivation()
1367 const {
1368 if (!*this)
1369 return false;
1370
1371 int stage_count = arraysize(stages_);
1372 for (int stage = current_stage_; stage < stage_count; ++stage) {
1373 IteratorType index = stages_[stage].iterator_type;
1374 if (iterators_[index].HasTilesRequiredForActivation())
1375 return true;
1376 }
1377 return false;
1378 }
1379
1366 PictureLayerImpl::LayerRasterTileIterator& 1380 PictureLayerImpl::LayerRasterTileIterator&
1367 PictureLayerImpl::LayerRasterTileIterator:: 1381 PictureLayerImpl::LayerRasterTileIterator::
1368 operator++() { 1382 operator++() {
1369 IteratorType index = stages_[current_stage_].iterator_type; 1383 IteratorType index = stages_[current_stage_].iterator_type;
1370 TilePriority::PriorityBin tile_type = stages_[current_stage_].tile_type; 1384 TilePriority::PriorityBin tile_type = stages_[current_stage_].tile_type;
1371 1385
1372 // First advance the iterator. 1386 // First advance the iterator.
1373 if (iterators_[index]) 1387 if (iterators_[index])
1374 ++iterators_[index]; 1388 ++iterators_[index];
1375 1389
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
1517 return iterator_index_ < iterators_.size(); 1531 return iterator_index_ < iterators_.size();
1518 } 1532 }
1519 1533
1520 bool PictureLayerImpl::LayerEvictionTileIterator::IsCorrectType( 1534 bool PictureLayerImpl::LayerEvictionTileIterator::IsCorrectType(
1521 PictureLayerTiling::TilingEvictionTileIterator* it) const { 1535 PictureLayerTiling::TilingEvictionTileIterator* it) const {
1522 return it->get_type() == iteration_stage_ && 1536 return it->get_type() == iteration_stage_ &&
1523 (**it)->required_for_activation() == required_for_activation_; 1537 (**it)->required_for_activation() == required_for_activation_;
1524 } 1538 }
1525 1539
1526 } // namespace cc 1540 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698