summaryrefslogtreecommitdiffstats
path: root/core/jni/AndroidRuntime.cpp
diff options
context:
space:
mode:
authorAndroid (Google) Code Review <android-gerrit@google.com>2009-04-29 13:35:33 -0700
committerThe Android Open Source Project <initial-contribution@android.com>2009-04-29 13:35:33 -0700
commit070d4c023a4b67e9e29d1c21a7bf9f25d7528c03 (patch)
tree61cb8cc9c1fcc2dd4fcaf7f40ba760cdc4356fbb /core/jni/AndroidRuntime.cpp
parent8e644062271b4082c6348a5061a75148e0086177 (diff)
parent3de05ffb910b572f7816b838628567c760540f7d (diff)
downloadframeworks_base-070d4c023a4b67e9e29d1c21a7bf9f25d7528c03.zip
frameworks_base-070d4c023a4b67e9e29d1c21a7bf9f25d7528c03.tar.gz
frameworks_base-070d4c023a4b67e9e29d1c21a7bf9f25d7528c03.tar.bz2
am 3de05ff: Merge change 586 into donut
Merge commit '3de05ffb910b572f7816b838628567c760540f7d' * commit '3de05ffb910b572f7816b838628567c760540f7d': Manage imagecache ram budget
Diffstat (limited to 'core/jni/AndroidRuntime.cpp')
-rw-r--r--core/jni/AndroidRuntime.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/core/jni/AndroidRuntime.cpp b/core/jni/AndroidRuntime.cpp
index 1c45b35..422020e 100644
--- a/core/jni/AndroidRuntime.cpp
+++ b/core/jni/AndroidRuntime.cpp
@@ -30,6 +30,7 @@
#include <SkGraphics.h>
#include <SkImageDecoder.h>
+#include <SkImageRef_GlobalPool.h>
#include "jni.h"
#include "JNIHelp.h"
@@ -227,6 +228,13 @@ AndroidRuntime::AndroidRuntime()
// this sets our preference for 16bit images during decode
// in case the src is opaque and 24bit
SkImageDecoder::SetDeviceConfig(SkBitmap::kRGB_565_Config);
+ // This cache is shared between browser native images, and java "purgeable"
+ // bitmaps. This globalpool is for images that do not either use the java
+ // heap, or are not backed by ashmem. See BitmapFactory.cpp for the key
+ // java call site.
+ SkImageRef_GlobalPool::SetRAMBudget(512 * 1024);
+ // There is also a global font cache, but its budget is specified in code
+ // see SkFontHost_android.cpp
// Pre-allocate enough space to hold a fair number of options.
mOptions.setCapacity(20);