summaryrefslogtreecommitdiffstats
path: root/ui/gl/gl_context_android.cc
diff options
context:
space:
mode:
authorkaanb@chromium.org <kaanb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-18 12:11:28 +0000
committerkaanb@chromium.org <kaanb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-18 12:11:28 +0000
commit42afafedacdb7f002be5788105c9a20c2abe27b3 (patch)
tree45167c1f90e0853abcfa1e14b87b24c97ca6ce4d /ui/gl/gl_context_android.cc
parent837804a05320b46bb4a43ff82c56fb83e54d2ef6 (diff)
downloadchromium_src-42afafedacdb7f002be5788105c9a20c2abe27b3.zip
chromium_src-42afafedacdb7f002be5788105c9a20c2abe27b3.tar.gz
chromium_src-42afafedacdb7f002be5788105c9a20c2abe27b3.tar.bz2
Use 1/8 of heap size as TotalGpuMemory for low end devices.
Also disabling async uploads if the heap size is less than 128MB as with async uploads the number of tiles grow unbounded without respecting the TotalGpuMemory. epenner and myself will investigate further. BUG=243703 Review URL: https://chromiumcodereview.appspot.com/16859003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@206946 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/gl/gl_context_android.cc')
-rw-r--r--ui/gl/gl_context_android.cc10
1 files changed, 7 insertions, 3 deletions
diff --git a/ui/gl/gl_context_android.cc b/ui/gl/gl_context_android.cc
index 552b055..1fe9416 100644
--- a/ui/gl/gl_context_android.cc
+++ b/ui/gl/gl_context_android.cc
@@ -89,10 +89,12 @@ bool GLContextEGL::GetTotalGpuMemory(size_t* bytes) {
// end devices, 1/2 of the heap size can be too high, but this
// correlates well with having a small heap-growth-limit. So for
// devices with less ram, we factor in the growth limit.
+ // For devices with very limited memory, (e.g. Nexus S) we use
+ // 1/8 of the heap_size.
//
// This is the result of the calculation below:
// Droid DNA 1080P 128MB
- // Nexus S 56MB
+ // Nexus S 16MB
// Galaxy Nexus 112MB
// Nexus 4/10 256MB
// Xoom 88MB
@@ -103,9 +105,11 @@ bool GLContextEGL::GetTotalGpuMemory(size_t* bytes) {
base::SysInfo::DalvikHeapGrowthLimitMB());
size_t limit = 0;
if (heap_size >= 350)
- limit = heap_size / 2;
+ limit = heap_size / 2;
+ else if (heap_size <= 128)
+ limit = heap_size / 8;
else
- limit = (heap_size + (heap_growth * 2)) / 4;
+ limit = (heap_size + (heap_growth * 2)) / 4;
dalvik_limit = limit * 1024 * 1024;
}
*bytes = dalvik_limit;