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

Unified Diff: cc/tiles/tile.cc

Issue 1154393003: cc: Use CheckedNumeric for resource size calculations. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: initialize var 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/resources/scoped_resource_unittest.cc ('k') | cc/tiles/tile_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/tiles/tile.cc
diff --git a/cc/tiles/tile.cc b/cc/tiles/tile.cc
index 7d91552eb0980e87416b796e2ff4d61d490dff08..a596194dfdfa138e1a4cf10d77542d6a138fb2ae 100644
--- a/cc/tiles/tile.cc
+++ b/cc/tiles/tile.cc
@@ -66,8 +66,12 @@ void Tile::AsValueInto(base::trace_event::TracedValue* value) const {
}
size_t Tile::GPUMemoryUsageInBytes() const {
- if (draw_info_.resource_)
- return draw_info_.resource_->bytes();
+ if (draw_info_.resource_) {
+ // We can use UncheckedSizeInBytes, since the tile size is determined by the
+ // compositor.
+ return Resource::UncheckedMemorySizeBytes(draw_info_.resource_->size(),
+ draw_info_.resource_->format());
+ }
return 0;
}
« no previous file with comments | « cc/resources/scoped_resource_unittest.cc ('k') | cc/tiles/tile_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698