diff options
author | Mike Reed <reed@google.com> | 2009-04-27 11:43:30 -0400 |
---|---|---|
committer | Mike Reed <reed@google.com> | 2009-04-27 11:43:30 -0400 |
commit | fc8db53eee11568b286e8d9c17e211bd6781fab6 (patch) | |
tree | afa69f7118c3f2634c3c7fdad58871a1784352e6 | |
parent | 1fb758e94b5b9e342b6dc6452cb5bd7cf0cc4ed6 (diff) | |
download | frameworks_base-fc8db53eee11568b286e8d9c17e211bd6781fab6.zip frameworks_base-fc8db53eee11568b286e8d9c17e211bd6781fab6.tar.gz frameworks_base-fc8db53eee11568b286e8d9c17e211bd6781fab6.tar.bz2 |
Manage imagecache ram budget
This code was lifted from the browser, and is now global since java clients may
also use this cache for decoded images
-rw-r--r-- | core/jni/AndroidRuntime.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/core/jni/AndroidRuntime.cpp b/core/jni/AndroidRuntime.cpp index 6742062..7c9f457 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" @@ -228,6 +229,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); |