summaryrefslogtreecommitdiffstats
path: root/src/com/android/gallery3d/ui/BitmapLoader.java
diff options
context:
space:
mode:
authorBobby Georgescu <georgescu@google.com>2013-02-22 21:03:45 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2013-02-22 21:03:46 +0000
commite1c1c9b36ef36679ff2cd87ee7771c4d54be024d (patch)
treed340f41e2caec4caef9536c9c4b2508671113197 /src/com/android/gallery3d/ui/BitmapLoader.java
parentbd940c98109d8cf605d81281add83ffe787c4842 (diff)
parent11cfeeddedd61d3c4aa40945fef0bc2d87c7559d (diff)
downloadandroid_packages_apps_Snap-e1c1c9b36ef36679ff2cd87ee7771c4d54be024d.tar.gz
android_packages_apps_Snap-e1c1c9b36ef36679ff2cd87ee7771c4d54be024d.tar.bz2
android_packages_apps_Snap-e1c1c9b36ef36679ff2cd87ee7771c4d54be024d.zip
Merge "Replace various BitmapPools with a smarter unified pool" into gb-ub-photos-bryce
Diffstat (limited to 'src/com/android/gallery3d/ui/BitmapLoader.java')
-rw-r--r--src/com/android/gallery3d/ui/BitmapLoader.java6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/com/android/gallery3d/ui/BitmapLoader.java b/src/com/android/gallery3d/ui/BitmapLoader.java
index 4f07cc047..a708a90f3 100644
--- a/src/com/android/gallery3d/ui/BitmapLoader.java
+++ b/src/com/android/gallery3d/ui/BitmapLoader.java
@@ -18,6 +18,7 @@ package com.android.gallery3d.ui;
import android.graphics.Bitmap;
+import com.android.photos.data.GalleryBitmapPool;
import com.android.gallery3d.util.Future;
import com.android.gallery3d.util.FutureListener;
@@ -51,7 +52,7 @@ public abstract class BitmapLoader implements FutureListener<Bitmap> {
mBitmap = future.get();
if (mState == STATE_RECYCLED) {
if (mBitmap != null) {
- recycleBitmap(mBitmap);
+ GalleryBitmapPool.getInstance().put(mBitmap);
mBitmap = null;
}
return; // don't call callback
@@ -84,7 +85,7 @@ public abstract class BitmapLoader implements FutureListener<Bitmap> {
public synchronized void recycle() {
mState = STATE_RECYCLED;
if (mBitmap != null) {
- recycleBitmap(mBitmap);
+ GalleryBitmapPool.getInstance().put(mBitmap);
mBitmap = null;
}
if (mTask != null) mTask.cancel();
@@ -103,6 +104,5 @@ public abstract class BitmapLoader implements FutureListener<Bitmap> {
}
abstract protected Future<Bitmap> submitBitmapTask(FutureListener<Bitmap> l);
- abstract protected void recycleBitmap(Bitmap bitmap);
abstract protected void onLoadComplete(Bitmap bitmap);
}