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

Side by Side Diff: cc/tiles/tiling_set_raster_queue_all.cc

Issue 2711573002: cc: Fix tile priority inversion in picture layer tiling. (Closed)
Patch Set: Created 3 years, 10 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
« no previous file with comments | « cc/tiles/tiling_set_eviction_queue.cc ('k') | cc/tiles/tiling_set_raster_queue_required.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/tiles/tiling_set_raster_queue_all.h" 5 #include "cc/tiles/tiling_set_raster_queue_all.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <utility> 9 #include <utility>
10 10
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 void TilingSetRasterQueueAll::OnePriorityRectIterator::AdvanceToNextTile( 173 void TilingSetRasterQueueAll::OnePriorityRectIterator::AdvanceToNextTile(
174 TilingIteratorType* iterator) { 174 TilingIteratorType* iterator) {
175 for (;;) { 175 for (;;) {
176 ++(*iterator); 176 ++(*iterator);
177 if (!(*iterator)) { 177 if (!(*iterator)) {
178 current_tile_ = PrioritizedTile(); 178 current_tile_ = PrioritizedTile();
179 break; 179 break;
180 } 180 }
181 Tile* tile = tiling_->TileAt(iterator->index_x(), iterator->index_y()); 181 Tile* tile = tiling_->TileAt(iterator->index_x(), iterator->index_y());
182 if (IsTileValid(tile)) { 182 if (IsTileValid(tile)) {
183 tiling_->UpdateRequiredStatesOnTile(tile);
184 current_tile_ = tiling_->MakePrioritizedTile(tile, priority_rect_type_); 183 current_tile_ = tiling_->MakePrioritizedTile(tile, priority_rect_type_);
185 break; 184 break;
186 } 185 }
187 } 186 }
188 } 187 }
189 188
190 template <typename TilingIteratorType> 189 template <typename TilingIteratorType>
191 bool TilingSetRasterQueueAll::OnePriorityRectIterator:: 190 bool TilingSetRasterQueueAll::OnePriorityRectIterator::
192 GetFirstTileAndCheckIfValid(TilingIteratorType* iterator) { 191 GetFirstTileAndCheckIfValid(TilingIteratorType* iterator) {
193 Tile* tile = tiling_->TileAt(iterator->index_x(), iterator->index_y()); 192 Tile* tile = tiling_->TileAt(iterator->index_x(), iterator->index_y());
194 if (!IsTileValid(tile)) { 193 if (!IsTileValid(tile)) {
195 current_tile_ = PrioritizedTile(); 194 current_tile_ = PrioritizedTile();
196 return false; 195 return false;
197 } 196 }
198 tiling_->UpdateRequiredStatesOnTile(tile);
199 current_tile_ = tiling_->MakePrioritizedTile(tile, priority_rect_type_); 197 current_tile_ = tiling_->MakePrioritizedTile(tile, priority_rect_type_);
200 return true; 198 return true;
201 } 199 }
202 200
203 bool TilingSetRasterQueueAll::OnePriorityRectIterator::IsTileValid( 201 bool TilingSetRasterQueueAll::OnePriorityRectIterator::IsTileValid(
204 const Tile* tile) const { 202 const Tile* tile) const {
205 if (!tile || !TileNeedsRaster(tile)) 203 if (!tile || !TileNeedsRaster(tile))
206 return false; 204 return false;
207 // After the pending visible rect has been processed, we must return false 205 // After the pending visible rect has been processed, we must return false
208 // for pending visible rect tiles as tiling iterators do not ignore those 206 // for pending visible rect tiles as tiling iterators do not ignore those
209 // tiles. 207 // tiles.
210 if (priority_rect_type_ > PictureLayerTiling::PENDING_VISIBLE_RECT) { 208 if (priority_rect_type_ > PictureLayerTiling::PENDING_VISIBLE_RECT) {
211 gfx::Rect tile_rect = tiling_->tiling_data()->TileBounds( 209 gfx::Rect tile_bounds = tiling_data_->TileBounds(tile->tiling_i_index(),
212 tile->tiling_i_index(), tile->tiling_j_index()); 210 tile->tiling_j_index());
213 if (pending_visible_rect_.Intersects(tile_rect)) 211 if (pending_visible_rect_.Intersects(tile_bounds))
214 return false; 212 return false;
215 } 213 }
216 return true; 214 return true;
217 } 215 }
218 216
219 // VisibleTilingIterator. 217 // VisibleTilingIterator.
220 TilingSetRasterQueueAll::VisibleTilingIterator::VisibleTilingIterator( 218 TilingSetRasterQueueAll::VisibleTilingIterator::VisibleTilingIterator(
221 PictureLayerTiling* tiling, 219 PictureLayerTiling* tiling,
222 TilingData* tiling_data) 220 TilingData* tiling_data)
223 : OnePriorityRectIterator(tiling, 221 : OnePriorityRectIterator(tiling,
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
440 current_tile_ = PrioritizedTile(); 438 current_tile_ = PrioritizedTile();
441 return *this; 439 return *this;
442 } 440 }
443 current_tile_ = *eventually_iterator_; 441 current_tile_ = *eventually_iterator_;
444 break; 442 break;
445 } 443 }
446 return *this; 444 return *this;
447 } 445 }
448 446
449 } // namespace cc 447 } // namespace cc
OLDNEW
« no previous file with comments | « cc/tiles/tiling_set_eviction_queue.cc ('k') | cc/tiles/tiling_set_raster_queue_required.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698