diff options
author | vmpstr@chromium.org <vmpstr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-05-27 21:03:00 +0000 |
---|---|---|
committer | vmpstr@chromium.org <vmpstr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-05-27 21:03:00 +0000 |
commit | a1154f904109fa9e6e2f220054a4f7a8c2550cde (patch) | |
tree | 50ffc493b3ac44d7372589a876f1f8378b59a0f6 /cc/resources | |
parent | ed72db83bc971295928a018b152540c4e1d613f1 (diff) | |
download | chromium_src-a1154f904109fa9e6e2f220054a4f7a8c2550cde.zip chromium_src-a1154f904109fa9e6e2f220054a4f7a8c2550cde.tar.gz chromium_src-a1154f904109fa9e6e2f220054a4f7a8c2550cde.tar.bz2 |
cc: Fix tiling raster tile iterator to handle initializing tiles.
This patch ensures that if a tile is initialized mid-iteration (as is
desirable in some unittests), then it will continue working as expected.
R=reveman
Review URL: https://codereview.chromium.org/295933008
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@273025 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/resources')
-rw-r--r-- | cc/resources/picture_layer_tiling.cc | 8 | ||||
-rw-r--r-- | cc/resources/picture_layer_tiling.h | 4 |
2 files changed, 7 insertions, 5 deletions
diff --git a/cc/resources/picture_layer_tiling.cc b/cc/resources/picture_layer_tiling.cc index f0b38db..9ab2cf5 100644 --- a/cc/resources/picture_layer_tiling.cc +++ b/cc/resources/picture_layer_tiling.cc @@ -859,8 +859,10 @@ void PictureLayerTiling::TilingRasterTileIterator::AdvancePhase() { ++spiral_iterator_; } - if (!spiral_iterator_ && type_ == TilePriority::EVENTUALLY) + if (!spiral_iterator_ && type_ == TilePriority::EVENTUALLY) { + current_tile_ = NULL; break; + } } while (!spiral_iterator_); } @@ -901,8 +903,10 @@ operator++() { break; case TilePriority::EVENTUALLY: ++spiral_iterator_; - if (!spiral_iterator_) + if (!spiral_iterator_) { + current_tile_ = NULL; return *this; + } next_index = spiral_iterator_.index(); break; } diff --git a/cc/resources/picture_layer_tiling.h b/cc/resources/picture_layer_tiling.h index feb40ff..131e338 100644 --- a/cc/resources/picture_layer_tiling.h +++ b/cc/resources/picture_layer_tiling.h @@ -51,9 +51,7 @@ class CC_EXPORT PictureLayerTiling { TilingRasterTileIterator(PictureLayerTiling* tiling, WhichTree tree); ~TilingRasterTileIterator(); - operator bool() const { - return current_tile_ && TileNeedsRaster(current_tile_); - } + operator bool() const { return !!current_tile_; } Tile* operator*() { return current_tile_; } TilePriority::PriorityBin get_type() const { return type_; } |