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

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

Issue 544863008: cc: Change TODO into comment. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 | « no previous file | no next file » | 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 316 matching lines...) Expand 10 before | Expand all | Expand 10 after
327 327
328 size_t PictureLayerTilingSet::GPUMemoryUsageInBytes() const { 328 size_t PictureLayerTilingSet::GPUMemoryUsageInBytes() const {
329 size_t amount = 0; 329 size_t amount = 0;
330 for (size_t i = 0; i < tilings_.size(); ++i) 330 for (size_t i = 0; i < tilings_.size(); ++i)
331 amount += tilings_[i]->GPUMemoryUsageInBytes(); 331 amount += tilings_[i]->GPUMemoryUsageInBytes();
332 return amount; 332 return amount;
333 } 333 }
334 334
335 PictureLayerTilingSet::TilingRange PictureLayerTilingSet::GetTilingRange( 335 PictureLayerTilingSet::TilingRange PictureLayerTilingSet::GetTilingRange(
336 TilingRangeType type) const { 336 TilingRangeType type) const {
337 // TODO(reveman): Compute these ranges only when the tiling set has changed 337 // Doesn't seem to be the case right now but if it ever becomes a performance
338 // instead of each time GetTilingRange() is called. 338 // problem to compute these ranges each time this function is called, we can
339 // compute them only when the tiling set has changed instead.
339 TilingRange high_res_range(0, 0); 340 TilingRange high_res_range(0, 0);
340 TilingRange low_res_range(tilings_.size(), tilings_.size()); 341 TilingRange low_res_range(tilings_.size(), tilings_.size());
341 for (size_t i = 0; i < tilings_.size(); ++i) { 342 for (size_t i = 0; i < tilings_.size(); ++i) {
342 const PictureLayerTiling* tiling = tilings_[i]; 343 const PictureLayerTiling* tiling = tilings_[i];
343 if (tiling->resolution() == HIGH_RESOLUTION) 344 if (tiling->resolution() == HIGH_RESOLUTION)
344 high_res_range = TilingRange(i, i + 1); 345 high_res_range = TilingRange(i, i + 1);
345 if (tiling->resolution() == LOW_RESOLUTION) 346 if (tiling->resolution() == LOW_RESOLUTION)
346 low_res_range = TilingRange(i, i + 1); 347 low_res_range = TilingRange(i, i + 1);
347 } 348 }
348 349
349 switch (type) { 350 switch (type) {
350 case HIGHER_THAN_HIGH_RES: 351 case HIGHER_THAN_HIGH_RES:
351 return TilingRange(0, high_res_range.start); 352 return TilingRange(0, high_res_range.start);
352 case HIGH_RES: 353 case HIGH_RES:
353 return high_res_range; 354 return high_res_range;
354 case BETWEEN_HIGH_AND_LOW_RES: 355 case BETWEEN_HIGH_AND_LOW_RES:
355 return TilingRange(high_res_range.end, low_res_range.start); 356 return TilingRange(high_res_range.end, low_res_range.start);
356 case LOW_RES: 357 case LOW_RES:
357 return low_res_range; 358 return low_res_range;
358 case LOWER_THAN_LOW_RES: 359 case LOWER_THAN_LOW_RES:
359 return TilingRange(low_res_range.end, tilings_.size()); 360 return TilingRange(low_res_range.end, tilings_.size());
360 } 361 }
361 362
362 NOTREACHED(); 363 NOTREACHED();
363 return TilingRange(0, 0); 364 return TilingRange(0, 0);
364 } 365 }
365 366
366 } // namespace cc 367 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698