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

Unified Diff: cc/tiles/tile_manager.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/tiles/tile.cc ('k') | cc/tiles/tile_manager_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/tiles/tile_manager.cc
diff --git a/cc/tiles/tile_manager.cc b/cc/tiles/tile_manager.cc
index cf6981e71975b1ed0ca7d30bc93637e394f9287f..e110fc2a29e81872e1089c398602cdd1e122378c 100644
--- a/cc/tiles/tile_manager.cc
+++ b/cc/tiles/tile_manager.cc
@@ -974,7 +974,9 @@ TileManager::MemoryUsage::MemoryUsage(int64 memory_bytes, int resource_count)
TileManager::MemoryUsage TileManager::MemoryUsage::FromConfig(
const gfx::Size& size,
ResourceFormat format) {
- return MemoryUsage(Resource::MemorySizeBytes(size, format), 1);
+ // We can use UncheckedMemorySizeBytes here since this is used with a tile
+ // size which is determined by the compositor (it's at most max texture size).
+ return MemoryUsage(Resource::UncheckedMemorySizeBytes(size, format), 1);
}
// static
« no previous file with comments | « cc/tiles/tile.cc ('k') | cc/tiles/tile_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698