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

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

Issue 367833003: cc: Start using raster/eviction iterators. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « cc/resources/picture_layer_tiling_set.h ('k') | cc/resources/picture_layer_tiling_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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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/picture_layer_tiling_set.h" 5 #include "cc/resources/picture_layer_tiling_set.h"
6 6
7 #include <limits> 7 #include <limits>
8 8
9 namespace cc { 9 namespace cc {
10 10
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 return NULL; 211 return NULL;
212 return *tiling_iter_; 212 return *tiling_iter_;
213 } 213 }
214 214
215 Tile* PictureLayerTilingSet::CoverageIterator::operator*() const { 215 Tile* PictureLayerTilingSet::CoverageIterator::operator*() const {
216 if (!tiling_iter_) 216 if (!tiling_iter_)
217 return NULL; 217 return NULL;
218 return *tiling_iter_; 218 return *tiling_iter_;
219 } 219 }
220 220
221 PictureLayerTiling* PictureLayerTilingSet::CoverageIterator::CurrentTiling() { 221 TileResolution PictureLayerTilingSet::CoverageIterator::resolution() const {
222 const PictureLayerTiling* tiling = CurrentTiling();
223 DCHECK(tiling);
224 return tiling->resolution();
225 }
226
227 PictureLayerTiling* PictureLayerTilingSet::CoverageIterator::CurrentTiling()
228 const {
222 if (current_tiling_ < 0) 229 if (current_tiling_ < 0)
223 return NULL; 230 return NULL;
224 if (static_cast<size_t>(current_tiling_) >= set_->tilings_.size()) 231 if (static_cast<size_t>(current_tiling_) >= set_->tilings_.size())
225 return NULL; 232 return NULL;
226 return set_->tilings_[current_tiling_]; 233 return set_->tilings_[current_tiling_];
227 } 234 }
228 235
229 int PictureLayerTilingSet::CoverageIterator::NextTiling() const { 236 int PictureLayerTilingSet::CoverageIterator::NextTiling() const {
230 // Order returned by this method is: 237 // Order returned by this method is:
231 // 1. Ideal tiling index 238 // 1. Ideal tiling index
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
300 } 307 }
301 308
302 return *this; 309 return *this;
303 } 310 }
304 311
305 PictureLayerTilingSet::CoverageIterator::operator bool() const { 312 PictureLayerTilingSet::CoverageIterator::operator bool() const {
306 return current_tiling_ < static_cast<int>(set_->tilings_.size()) || 313 return current_tiling_ < static_cast<int>(set_->tilings_.size()) ||
307 region_iter_.has_rect(); 314 region_iter_.has_rect();
308 } 315 }
309 316
310 void PictureLayerTilingSet::DidBecomeActive() {
311 for (size_t i = 0; i < tilings_.size(); ++i)
312 tilings_[i]->DidBecomeActive();
313 }
314
315 void PictureLayerTilingSet::DidBecomeRecycled() {
316 for (size_t i = 0; i < tilings_.size(); ++i)
317 tilings_[i]->DidBecomeRecycled();
318 }
319
320 void PictureLayerTilingSet::AsValueInto(base::debug::TracedValue* state) const { 317 void PictureLayerTilingSet::AsValueInto(base::debug::TracedValue* state) const {
321 for (size_t i = 0; i < tilings_.size(); ++i) { 318 for (size_t i = 0; i < tilings_.size(); ++i) {
322 state->BeginDictionary(); 319 state->BeginDictionary();
323 tilings_[i]->AsValueInto(state); 320 tilings_[i]->AsValueInto(state);
324 state->EndDictionary(); 321 state->EndDictionary();
325 } 322 }
326 } 323 }
327 324
328 size_t PictureLayerTilingSet::GPUMemoryUsageInBytes() const { 325 size_t PictureLayerTilingSet::GPUMemoryUsageInBytes() const {
329 size_t amount = 0; 326 size_t amount = 0;
(...skipping 28 matching lines...) Expand all
358 return low_res_range; 355 return low_res_range;
359 case LOWER_THAN_LOW_RES: 356 case LOWER_THAN_LOW_RES:
360 return TilingRange(low_res_range.end, tilings_.size()); 357 return TilingRange(low_res_range.end, tilings_.size());
361 } 358 }
362 359
363 NOTREACHED(); 360 NOTREACHED();
364 return TilingRange(0, 0); 361 return TilingRange(0, 0);
365 } 362 }
366 363
367 } // namespace cc 364 } // namespace cc
OLDNEW
« no previous file with comments | « cc/resources/picture_layer_tiling_set.h ('k') | cc/resources/picture_layer_tiling_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698