summaryrefslogtreecommitdiffstats
path: root/src/com/android/gallery3d/ui/BitmapScreenNail.java
diff options
context:
space:
mode:
authorChih-Chung Chang <chihchung@google.com>2012-04-17 20:35:14 +0800
committerChih-Chung Chang <chihchung@google.com>2012-04-18 20:31:10 +0800
commit2eaa2112c460e931ad0261b408213d3d1217d96f (patch)
treee0b9a6e51284ec5e369a3d9926704b1c69190139 /src/com/android/gallery3d/ui/BitmapScreenNail.java
parent146df37d6a6c7ca8686f5934b3d90b16c24a2583 (diff)
downloadandroid_packages_apps_Snap-2eaa2112c460e931ad0261b408213d3d1217d96f.tar.gz
android_packages_apps_Snap-2eaa2112c460e931ad0261b408213d3d1217d96f.tar.bz2
android_packages_apps_Snap-2eaa2112c460e931ad0261b408213d3d1217d96f.zip
Add thumb pool the cache Bitmap used for thumbnails.
Change-Id: Ib710f2a6fc1aa86fe4abdd18d1fa7ac71396a3b4
Diffstat (limited to 'src/com/android/gallery3d/ui/BitmapScreenNail.java')
-rw-r--r--src/com/android/gallery3d/ui/BitmapScreenNail.java10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/com/android/gallery3d/ui/BitmapScreenNail.java b/src/com/android/gallery3d/ui/BitmapScreenNail.java
index 3481aa18e..064e1af0e 100644
--- a/src/com/android/gallery3d/ui/BitmapScreenNail.java
+++ b/src/com/android/gallery3d/ui/BitmapScreenNail.java
@@ -20,6 +20,8 @@ import android.graphics.Bitmap;
import android.graphics.RectF;
import android.util.Log;
+import com.android.gallery3d.data.MediaItem;
+
// This is a ScreenNail wraps a Bitmap. It also includes the rotation
// information. The getWidth() and getHeight() methods return the width/height
// before rotation.
@@ -28,7 +30,7 @@ public class BitmapScreenNail implements ScreenNail {
private final int mWidth;
private final int mHeight;
private final int mRotation;
- private final Bitmap mBitmap;
+ private Bitmap mBitmap;
private BitmapTexture mTexture;
public BitmapScreenNail(Bitmap bitmap, int rotation) {
@@ -60,11 +62,15 @@ public class BitmapScreenNail implements ScreenNail {
}
@Override
- public void pauseDraw() {
+ public void recycle() {
if (mTexture != null) {
mTexture.recycle();
mTexture = null;
}
+ if (mBitmap != null) {
+ MediaItem.getThumbPool().recycle(mBitmap);
+ mBitmap = null;
+ }
}
@Override