diff options
author | Bobby Georgescu <georgescu@google.com> | 2013-02-19 15:49:14 -0800 |
---|---|---|
committer | Bobby Georgescu <georgescu@google.com> | 2013-02-22 12:56:23 -0800 |
commit | 11cfeeddedd61d3c4aa40945fef0bc2d87c7559d (patch) | |
tree | ab09906b8fe29d40768210bbeb5fc16be4a87625 /src/com/android/gallery3d/ui/BitmapLoader.java | |
parent | 0718d480a144ba0a44c07c48f90e85cf4ec669c6 (diff) | |
download | android_packages_apps_Snap-11cfeeddedd61d3c4aa40945fef0bc2d87c7559d.tar.gz android_packages_apps_Snap-11cfeeddedd61d3c4aa40945fef0bc2d87c7559d.tar.bz2 android_packages_apps_Snap-11cfeeddedd61d3c4aa40945fef0bc2d87c7559d.zip |
Replace various BitmapPools with a smarter unified pool
Make all of gallery use a single shared pool, and pave the
way for making the pool more adaptive based on the current
workload.
Change-Id: Ia32561ad50b1b9716ebe2fd32a7bf02737685dac
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); } |