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

Unified Diff: content/child/blink_platform_impl.cc

Issue 220993003: Adjust maximum decoded image size on Android (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 6 years, 9 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: content/child/blink_platform_impl.cc
diff --git a/content/child/blink_platform_impl.cc b/content/child/blink_platform_impl.cc
index c47d31b69a6c3af11a05ea5353a6c0359703c2fa..62669bb648ed3521f2e3d14948e170c85fd011e9 100644
--- a/content/child/blink_platform_impl.cc
+++ b/content/child/blink_platform_impl.cc
@@ -1006,8 +1006,13 @@ size_t BlinkPlatformImpl::maxDecodedImageBytes() {
return 3 * 1024 * 1024 * 4;
}
// For other devices, limit decoded image size based on the amount of physical
- // memory. For a device with 2GB physical memory the limit is 16M pixels.
- return base::SysInfo::AmountOfPhysicalMemory() / 32;
+ // memory.
+ // In some cases all physical memory is not accessible by Chromium, as it can
+ // be reserved for direct use by certain hardware. Thus, we set the limit so
+ // that 1.6GB of reported physical memory on a 2GB device is enough to set the
+ // limit at 16M pixels, which is a desirable value since 4K*4K is a relatively
+ // common texture size.
+ return base::SysInfo::AmountOfPhysicalMemory() / 25;
#else
return noDecodedImageByteLimit;
#endif
« 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