diff options
| author | 2009-06-04 22:42:01 -0700 | |
|---|---|---|
| committer | 2009-06-04 22:42:01 -0700 | |
| commit | 7d53a6bf4d7992a31426b028fb6ba6dbfaee88d0 (patch) | |
| tree | 4cd56227b93eba146435e56ddaa66e3467f47b5b | |
| parent | 7642e3418e026dfa30a9566da1ef38c878934535 (diff) | |
| parent | a41962065a93b63e7161cffd662b564e01a9e189 (diff) | |
am a4196206: Merge change 3074 into donut
Merge commit 'a41962065a93b63e7161cffd662b564e01a9e189'
* commit 'a41962065a93b63e7161cffd662b564e01a9e189':
Modify the decoding logic in the FD case when a purgeable flag is set,
| -rw-r--r-- | core/jni/android/graphics/BitmapFactory.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/core/jni/android/graphics/BitmapFactory.cpp b/core/jni/android/graphics/BitmapFactory.cpp index 1fd15d687baf..137707fa93bf 100644 --- a/core/jni/android/graphics/BitmapFactory.cpp +++ b/core/jni/android/graphics/BitmapFactory.cpp @@ -311,7 +311,7 @@ static SkPixelRef* installPixelRef(SkBitmap* bitmap, SkStream* stream, int sampleSize) { SkPixelRef* pr; // only use ashmem for large images, since mmaps come at a price - if (bitmap->getSize() >= 32 * 65536) { + if (bitmap->getSize() >= 32 * 1024) { pr = new SkImageRef_ashmem(stream, bitmap->config(), sampleSize); } else { pr = new SkImageRef_GlobalPool(stream, bitmap->config(), sampleSize); @@ -520,7 +520,10 @@ static jobject nativeDecodeFileDescriptor(JNIEnv* env, jobject clazz, */ AutoFDSeek as(descriptor); - return doDecode(env, stream, padding, bitmapFactoryOptions, true); + /* Allow purgeable iff we own the FD, i.e., in the puregeable and + shareable case. + */ + return doDecode(env, stream, padding, bitmapFactoryOptions, weOwnTheFD); } /* make a deep copy of the asset, and return it as a stream, or NULL if there |