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

Unified Diff: android_webview/browser/browser_view_renderer.cc

Issue 269893002: aw: Avoid using std::max for compile (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 8 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: android_webview/browser/browser_view_renderer.cc
diff --git a/android_webview/browser/browser_view_renderer.cc b/android_webview/browser/browser_view_renderer.cc
index 7db981674578754db45baded9786af9ba539e759..b8613b79dd7e8ac07062489603230228901ebb71 100644
--- a/android_webview/browser/browser_view_renderer.cc
+++ b/android_webview/browser/browser_view_renderer.cc
@@ -171,11 +171,10 @@ BrowserViewRenderer::CalculateDesiredMemoryPolicy() {
policy.bytes_limit =
(policy.bytes_limit / kMemoryAllocationStep + 1) * kMemoryAllocationStep;
- size_t tiles = std::max(width * height * kTileMultiplier / g_tile_area, 1u);
+ size_t tiles = width * height * kTileMultiplier / g_tile_area;
// Round up to a multiple of kTileAllocationStep. The minimum number of tiles
// is also kTileAllocationStep.
- tiles = (tiles + kTileAllocationStep - 1) / kTileAllocationStep *
- kTileAllocationStep;
+ tiles = (tiles / kTileAllocationStep + 1) * kTileAllocationStep;
policy.num_resources_limit = tiles;
return policy;
}
« 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