OLD | NEW |
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 <utility> | 5 #include <utility> |
6 | 6 |
7 #include "cc/resources/tiling_set_eviction_queue.h" | 7 #include "cc/resources/tiling_set_eviction_queue.h" |
8 | 8 |
9 namespace cc { | 9 namespace cc { |
10 | 10 |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 return found_tile; | 210 return found_tile; |
211 } | 211 } |
212 | 212 |
213 template <typename TilingIteratorType> | 213 template <typename TilingIteratorType> |
214 bool TilingSetEvictionQueue::EvictionRectIterator::GetFirstTileAndCheckIfValid( | 214 bool TilingSetEvictionQueue::EvictionRectIterator::GetFirstTileAndCheckIfValid( |
215 TilingIteratorType* iterator) { | 215 TilingIteratorType* iterator) { |
216 PictureLayerTiling* tiling = (*tilings_)[tiling_index_]; | 216 PictureLayerTiling* tiling = (*tilings_)[tiling_index_]; |
217 Tile* tile = tiling->TileAt(iterator->index_x(), iterator->index_y()); | 217 Tile* tile = tiling->TileAt(iterator->index_x(), iterator->index_y()); |
218 prioritized_tile_ = PrioritizedTile(); | 218 prioritized_tile_ = PrioritizedTile(); |
219 // If there's nothing to evict, return false. | 219 // If there's nothing to evict, return false. |
220 if (!tile || !tile->HasResource()) | 220 if (!tile || !tile->draw_info().has_resource()) |
221 return false; | 221 return false; |
222 if (skip_pending_visible_rect_ && | 222 if (skip_pending_visible_rect_ && |
223 tiling->pending_visible_rect().Intersects(tile->content_rect())) { | 223 tiling->pending_visible_rect().Intersects(tile->content_rect())) { |
224 return false; | 224 return false; |
225 } | 225 } |
226 (*tilings_)[tiling_index_]->UpdateRequiredStatesOnTile(tile); | 226 (*tilings_)[tiling_index_]->UpdateRequiredStatesOnTile(tile); |
227 prioritized_tile_ = (*tilings_)[tiling_index_]->MakePrioritizedTile(tile); | 227 prioritized_tile_ = (*tilings_)[tiling_index_]->MakePrioritizedTile(tile); |
228 // In other cases, the tile we got is a viable candidate, return true. | 228 // In other cases, the tile we got is a viable candidate, return true. |
229 return true; | 229 return true; |
230 } | 230 } |
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
516 | 516 |
517 bool TilingSetEvictionQueue::VisibleTilingIterator::TileMatchesRequiredFlags( | 517 bool TilingSetEvictionQueue::VisibleTilingIterator::TileMatchesRequiredFlags( |
518 const PrioritizedTile& tile) const { | 518 const PrioritizedTile& tile) const { |
519 bool activation_flag_matches = tile.tile()->required_for_activation() == | 519 bool activation_flag_matches = tile.tile()->required_for_activation() == |
520 return_required_for_activation_tiles_; | 520 return_required_for_activation_tiles_; |
521 bool occluded_flag_matches = tile.is_occluded() == return_occluded_tiles_; | 521 bool occluded_flag_matches = tile.is_occluded() == return_occluded_tiles_; |
522 return activation_flag_matches && occluded_flag_matches; | 522 return activation_flag_matches && occluded_flag_matches; |
523 } | 523 } |
524 | 524 |
525 } // namespace cc | 525 } // namespace cc |
OLD | NEW |