diff options
author | Owen Lin <owenlin@google.com> | 2012-04-09 10:15:35 +0800 |
---|---|---|
committer | Owen Lin <owenlin@google.com> | 2012-04-10 14:39:23 +0800 |
commit | d8d1cfdb80a7bcc950e8deb957a6c55ec83a68b0 (patch) | |
tree | c5a5f0dac151c4f4cec881e9862ce592343b9608 /src/com/android/gallery3d/data/MediaItem.java | |
parent | a66827d34d8c29a612787e3fa2557a53191494da (diff) | |
download | android_packages_apps_Snap-d8d1cfdb80a7bcc950e8deb957a6c55ec83a68b0.tar.gz android_packages_apps_Snap-d8d1cfdb80a7bcc950e8deb957a6c55ec83a68b0.tar.bz2 android_packages_apps_Snap-d8d1cfdb80a7bcc950e8deb957a6c55ec83a68b0.zip |
Add BytesBufferPool to prevent GC.
Change-Id: Ia8513ff380a60f102481cbf25650eca149b75064
Diffstat (limited to 'src/com/android/gallery3d/data/MediaItem.java')
-rw-r--r-- | src/com/android/gallery3d/data/MediaItem.java | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/com/android/gallery3d/data/MediaItem.java b/src/com/android/gallery3d/data/MediaItem.java index 2b8f8a353..3de70d954 100644 --- a/src/com/android/gallery3d/data/MediaItem.java +++ b/src/com/android/gallery3d/data/MediaItem.java @@ -19,7 +19,6 @@ package com.android.gallery3d.data; import android.graphics.Bitmap; import android.graphics.BitmapRegionDecoder; -import com.android.gallery3d.ui.BitmapPool; import com.android.gallery3d.ui.ScreenNail; import com.android.gallery3d.util.ThreadPool.Job; @@ -40,9 +39,15 @@ public abstract class MediaItem extends MediaObject { public static final String MIME_TYPE_JPEG = "image/jpeg"; + private static final int BYTESBUFFE_POOL_SIZE = 4; + private static final int BYTESBUFFER_SIZE = 200 * 1024; + private static final BitmapPool sMicroThumbPool = new BitmapPool(MICROTHUMBNAIL_TARGET_SIZE, MICROTHUMBNAIL_TARGET_SIZE); + private static final BytesBufferPool sMicroThumbBufferPool = + new BytesBufferPool(BYTESBUFFE_POOL_SIZE, BYTESBUFFER_SIZE); + // TODO: fix default value for latlng and change this. public static final double INVALID_LATLNG = 0f; @@ -116,4 +121,8 @@ public abstract class MediaItem extends MediaObject { public static BitmapPool getMicroThumbPool() { return sMicroThumbPool; } + + public static BytesBufferPool getBytesBufferPool() { + return sMicroThumbBufferPool; + } } |