diff options
author | Bobby Georgescu <georgescu@google.com> | 2013-02-22 21:03:45 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2013-02-22 21:03:46 +0000 |
commit | e1c1c9b36ef36679ff2cd87ee7771c4d54be024d (patch) | |
tree | d340f41e2caec4caef9536c9c4b2508671113197 /src/com/android/gallery3d/ui/BitmapLoader.java | |
parent | bd940c98109d8cf605d81281add83ffe787c4842 (diff) | |
parent | 11cfeeddedd61d3c4aa40945fef0bc2d87c7559d (diff) | |
download | android_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.java | 6 |
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); } |