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

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: nits updated. 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
« no previous file with comments | « cc/resources/prioritized_tile_set.h ('k') | cc/resources/prioritized_tile_set_unittest.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 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::IsEmpty() {
85 for (int bin = 0; bin < NUM_BINS; ++bin)
86 if (!tiles_[bin].empty())
87 return false;
88
89 return true;
90 }
91
84 void PrioritizedTileSet::SortBinIfNeeded(ManagedTileBin bin) { 92 void PrioritizedTileSet::SortBinIfNeeded(ManagedTileBin bin) {
85 if (!bin_sorted_[bin]) { 93 if (!bin_sorted_[bin]) {
86 SortBinTiles(bin, &tiles_[bin]); 94 SortBinTiles(bin, &tiles_[bin]);
87 bin_sorted_[bin] = true; 95 bin_sorted_[bin] = true;
88 } 96 }
89 } 97 }
90 98
91 PrioritizedTileSet::Iterator::Iterator( 99 PrioritizedTileSet::Iterator::Iterator(
92 PrioritizedTileSet* tile_set, bool use_priority_ordering) 100 PrioritizedTileSet* tile_set, bool use_priority_ordering)
93 : tile_set_(tile_set), 101 : tile_set_(tile_set),
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 if (use_priority_ordering_) 139 if (use_priority_ordering_)
132 tile_set_->SortBinIfNeeded(current_bin_); 140 tile_set_->SortBinIfNeeded(current_bin_);
133 141
134 iterator_ = tile_set_->tiles_[current_bin_].begin(); 142 iterator_ = tile_set_->tiles_[current_bin_].begin();
135 if (iterator_ != tile_set_->tiles_[current_bin_].end()) 143 if (iterator_ != tile_set_->tiles_[current_bin_].end())
136 break; 144 break;
137 } 145 }
138 } 146 }
139 147
140 } // namespace cc 148 } // namespace cc
OLDNEW
« no previous file with comments | « cc/resources/prioritized_tile_set.h ('k') | cc/resources/prioritized_tile_set_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698