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

Unified Diff: cc/layers/picture_layer_impl.cc

Issue 1266103005: cc: Handle overflow/underflow in MathUtil::RoundUp/RoundDown functions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Small nit. Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/base/math_util_unittest.cc ('k') | cc/playback/pixel_ref_map.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/picture_layer_impl.cc
diff --git a/cc/layers/picture_layer_impl.cc b/cc/layers/picture_layer_impl.cc
index bb1f4c590907246f4bcb8556c17f7a637c0ffb06..e2d0fdb786fdc5de428548665e07ef8773f8595e 100644
--- a/cc/layers/picture_layer_impl.cc
+++ b/cc/layers/picture_layer_impl.cc
@@ -702,7 +702,8 @@ gfx::Size PictureLayerImpl::CalculateTileSize(
divisor = 2;
if (content_bounds.width() <= viewport_width / 4)
divisor = 1;
- default_tile_height = MathUtil::RoundUp(viewport_height, divisor) / divisor;
+ default_tile_height =
+ MathUtil::UncheckedRoundUp(viewport_height, divisor) / divisor;
// Grow default sizes to account for overlapping border texels.
default_tile_width += 2 * PictureLayerTiling::kBorderTexels;
@@ -738,12 +739,12 @@ gfx::Size PictureLayerImpl::CalculateTileSize(
// Clamp the tile width/height to the content width/height to save space.
if (content_bounds.width() < default_tile_width) {
tile_width = std::min(tile_width, content_bounds.width());
- tile_width = MathUtil::RoundUp(tile_width, kTileRoundUp);
+ tile_width = MathUtil::UncheckedRoundUp(tile_width, kTileRoundUp);
tile_width = std::min(tile_width, default_tile_width);
}
if (content_bounds.height() < default_tile_height) {
tile_height = std::min(tile_height, content_bounds.height());
- tile_height = MathUtil::RoundUp(tile_height, kTileRoundUp);
+ tile_height = MathUtil::UncheckedRoundUp(tile_height, kTileRoundUp);
tile_height = std::min(tile_height, default_tile_height);
}
« no previous file with comments | « cc/base/math_util_unittest.cc ('k') | cc/playback/pixel_ref_map.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698