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

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

Issue 1168903003: cc: Fix size_t to int truncations in tiles/ and trees/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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/tile_priority.cc ('k') | cc/trees/layer_tree_host_impl.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 <utility> 5 #include <utility>
6 6
7 #include "cc/tiles/tiling_set_eviction_queue.h" 7 #include "cc/tiles/tiling_set_eviction_queue.h"
8 8
9 namespace cc { 9 namespace cc {
10 10
(...skipping 15 matching lines...) Expand all
26 TilingSetEvictionQueue::~TilingSetEvictionQueue() { 26 TilingSetEvictionQueue::~TilingSetEvictionQueue() {
27 } 27 }
28 28
29 void TilingSetEvictionQueue::GenerateTilingOrder( 29 void TilingSetEvictionQueue::GenerateTilingOrder(
30 PictureLayerTilingSet* tiling_set) { 30 PictureLayerTilingSet* tiling_set) {
31 tilings_.reserve(tiling_set->num_tilings()); 31 tilings_.reserve(tiling_set->num_tilings());
32 // Generate all of the tilings in the order described in the header comment 32 // Generate all of the tilings in the order described in the header comment
33 // for this class. 33 // for this class.
34 PictureLayerTilingSet::TilingRange range = 34 PictureLayerTilingSet::TilingRange range =
35 tiling_set->GetTilingRange(PictureLayerTilingSet::HIGHER_THAN_HIGH_RES); 35 tiling_set->GetTilingRange(PictureLayerTilingSet::HIGHER_THAN_HIGH_RES);
36 for (int i = range.start; i < range.end; ++i) { 36 for (size_t index = range.start; index < range.end; ++index) {
37 PictureLayerTiling* tiling = tiling_set->tiling_at(i); 37 PictureLayerTiling* tiling = tiling_set->tiling_at(index);
38 if (tiling->has_tiles()) 38 if (tiling->has_tiles())
39 tilings_.push_back(tiling); 39 tilings_.push_back(tiling);
40 } 40 }
41 41
42 range = tiling_set->GetTilingRange(PictureLayerTilingSet::LOWER_THAN_LOW_RES); 42 range = tiling_set->GetTilingRange(PictureLayerTilingSet::LOWER_THAN_LOW_RES);
43 for (int i = range.end - 1; i >= range.start; --i) { 43 for (size_t i = range.start; i < range.end; ++i) {
44 PictureLayerTiling* tiling = tiling_set->tiling_at(i); 44 size_t index = range.start + (range.end - 1 - i);
45 PictureLayerTiling* tiling = tiling_set->tiling_at(index);
45 if (tiling->has_tiles()) 46 if (tiling->has_tiles())
46 tilings_.push_back(tiling); 47 tilings_.push_back(tiling);
47 } 48 }
48 49
49 range = tiling_set->GetTilingRange( 50 range = tiling_set->GetTilingRange(
50 PictureLayerTilingSet::BETWEEN_HIGH_AND_LOW_RES); 51 PictureLayerTilingSet::BETWEEN_HIGH_AND_LOW_RES);
51 for (int i = range.end - 1; i >= range.start; --i) { 52 for (size_t i = range.start; i < range.end; ++i) {
52 PictureLayerTiling* tiling = tiling_set->tiling_at(i); 53 size_t index = range.start + (range.end - 1 - i);
54 PictureLayerTiling* tiling = tiling_set->tiling_at(index);
53 if (tiling->has_tiles()) 55 if (tiling->has_tiles())
54 tilings_.push_back(tiling); 56 tilings_.push_back(tiling);
55 } 57 }
56 58
57 range = tiling_set->GetTilingRange(PictureLayerTilingSet::LOW_RES); 59 range = tiling_set->GetTilingRange(PictureLayerTilingSet::LOW_RES);
58 for (int i = range.start; i < range.end; ++i) { 60 for (size_t index = range.start; index < range.end; ++index) {
59 PictureLayerTiling* tiling = tiling_set->tiling_at(i); 61 PictureLayerTiling* tiling = tiling_set->tiling_at(index);
60 if (tiling->has_tiles()) 62 if (tiling->has_tiles())
61 tilings_.push_back(tiling); 63 tilings_.push_back(tiling);
62 } 64 }
63 65
64 range = tiling_set->GetTilingRange(PictureLayerTilingSet::HIGH_RES); 66 range = tiling_set->GetTilingRange(PictureLayerTilingSet::HIGH_RES);
65 for (int i = range.start; i < range.end; ++i) { 67 for (size_t index = range.start; index < range.end; ++index) {
66 PictureLayerTiling* tiling = tiling_set->tiling_at(i); 68 PictureLayerTiling* tiling = tiling_set->tiling_at(index);
67 if (tiling->has_tiles()) 69 if (tiling->has_tiles())
68 tilings_.push_back(tiling); 70 tilings_.push_back(tiling);
69 } 71 }
70 DCHECK_GE(tiling_set->num_tilings(), tilings_.size()); 72 DCHECK_GE(tiling_set->num_tilings(), tilings_.size());
71 } 73 }
72 74
73 void TilingSetEvictionQueue::AdvancePhase() { 75 void TilingSetEvictionQueue::AdvancePhase() {
74 current_tile_ = PrioritizedTile(); 76 current_tile_ = PrioritizedTile();
75 while (!current_tile_.tile() && 77 while (!current_tile_.tile() &&
76 phase_ != VISIBLE_RECT_REQUIRED_FOR_ACTIVATION_UNOCCLUDED) { 78 phase_ != VISIBLE_RECT_REQUIRED_FOR_ACTIVATION_UNOCCLUDED) {
(...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after
514 516
515 bool TilingSetEvictionQueue::VisibleTilingIterator::TileMatchesRequiredFlags( 517 bool TilingSetEvictionQueue::VisibleTilingIterator::TileMatchesRequiredFlags(
516 const PrioritizedTile& tile) const { 518 const PrioritizedTile& tile) const {
517 bool activation_flag_matches = tile.tile()->required_for_activation() == 519 bool activation_flag_matches = tile.tile()->required_for_activation() ==
518 return_required_for_activation_tiles_; 520 return_required_for_activation_tiles_;
519 bool occluded_flag_matches = tile.is_occluded() == return_occluded_tiles_; 521 bool occluded_flag_matches = tile.is_occluded() == return_occluded_tiles_;
520 return activation_flag_matches && occluded_flag_matches; 522 return activation_flag_matches && occluded_flag_matches;
521 } 523 }
522 524
523 } // namespace cc 525 } // namespace cc
OLDNEW
« no previous file with comments | « cc/tiles/tile_priority.cc ('k') | cc/trees/layer_tree_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698