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

Side by Side Diff: cc/resources/prioritized_tile_set.cc

Issue 366113002: cc: Do not cleanup tiles with raster tasks. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review comments addressed. Created 6 years, 4 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/resources/prioritized_tile_set.h" 5 #include "cc/resources/prioritized_tile_set.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "cc/resources/managed_tile_state.h" 9 #include "cc/resources/managed_tile_state.h"
10 #include "cc/resources/tile.h" 10 #include "cc/resources/tile.h"
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 bin_sorted_[bin] = false; 74 bin_sorted_[bin] = false;
75 } 75 }
76 76
77 void PrioritizedTileSet::Clear() { 77 void PrioritizedTileSet::Clear() {
78 for (int bin = 0; bin < NUM_BINS; ++bin) { 78 for (int bin = 0; bin < NUM_BINS; ++bin) {
79 tiles_[bin].clear(); 79 tiles_[bin].clear();
80 bin_sorted_[bin] = true; 80 bin_sorted_[bin] = true;
81 } 81 }
82 } 82 }
83 83
84 bool PrioritizedTileSet::Empty() {
85 for (int bin = 0; bin < NUM_BINS; ++bin) {
86 if (!tiles_[bin].empty()) {
87 return false;
88 }
reveman 2014/07/28 15:50:53 nit: no need for "{" "}" here
sohanjg 2014/07/30 11:12:57 Done.
89 }
90 return true;
91 }
92
84 void PrioritizedTileSet::SortBinIfNeeded(ManagedTileBin bin) { 93 void PrioritizedTileSet::SortBinIfNeeded(ManagedTileBin bin) {
85 if (!bin_sorted_[bin]) { 94 if (!bin_sorted_[bin]) {
86 SortBinTiles(bin, &tiles_[bin]); 95 SortBinTiles(bin, &tiles_[bin]);
87 bin_sorted_[bin] = true; 96 bin_sorted_[bin] = true;
88 } 97 }
89 } 98 }
90 99
91 PrioritizedTileSet::Iterator::Iterator( 100 PrioritizedTileSet::Iterator::Iterator(
92 PrioritizedTileSet* tile_set, bool use_priority_ordering) 101 PrioritizedTileSet* tile_set, bool use_priority_ordering)
93 : tile_set_(tile_set), 102 : tile_set_(tile_set),
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 if (use_priority_ordering_) 140 if (use_priority_ordering_)
132 tile_set_->SortBinIfNeeded(current_bin_); 141 tile_set_->SortBinIfNeeded(current_bin_);
133 142
134 iterator_ = tile_set_->tiles_[current_bin_].begin(); 143 iterator_ = tile_set_->tiles_[current_bin_].begin();
135 if (iterator_ != tile_set_->tiles_[current_bin_].end()) 144 if (iterator_ != tile_set_->tiles_[current_bin_].end())
136 break; 145 break;
137 } 146 }
138 } 147 }
139 148
140 } // namespace cc 149 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698