summaryrefslogtreecommitdiffstats
path: root/src/com/android/gallery3d/ui/AlbumLabelMaker.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
commitfae7bf8557f7de818a768d7a8c30425a9a5641d8 (patch)
tree341bb1cf1c6fd0f65da4b528abe35e4c56441a96 /src/com/android/gallery3d/ui/AlbumLabelMaker.java
parentea332c69f084322ebdd13419424ee5fab2351760 (diff)
parentf52ceba89962829aa12f5caba131580e8da85880 (diff)
downloadandroid_packages_apps_Gallery2-fae7bf8557f7de818a768d7a8c30425a9a5641d8.tar.gz
android_packages_apps_Gallery2-fae7bf8557f7de818a768d7a8c30425a9a5641d8.tar.bz2
android_packages_apps_Gallery2-fae7bf8557f7de818a768d7a8c30425a9a5641d8.zip
Merge "Replace various BitmapPools with a smarter unified pool" into gb-ub-photos-bryce
Diffstat (limited to 'src/com/android/gallery3d/ui/AlbumLabelMaker.java')
-rw-r--r--src/com/android/gallery3d/ui/AlbumLabelMaker.java17
1 files changed, 7 insertions, 10 deletions
diff --git a/src/com/android/gallery3d/ui/AlbumLabelMaker.java b/src/com/android/gallery3d/ui/AlbumLabelMaker.java
index 6eeeec045..da1cac0bd 100644
--- a/src/com/android/gallery3d/ui/AlbumLabelMaker.java
+++ b/src/com/android/gallery3d/ui/AlbumLabelMaker.java
@@ -27,8 +27,8 @@ import android.text.TextPaint;
import android.text.TextUtils;
import com.android.gallery3d.R;
-import com.android.gallery3d.data.BitmapPool;
import com.android.gallery3d.data.DataSourceType;
+import com.android.photos.data.GalleryBitmapPool;
import com.android.gallery3d.util.ThreadPool;
import com.android.gallery3d.util.ThreadPool.JobContext;
@@ -41,7 +41,8 @@ public class AlbumLabelMaker {
private final Context mContext;
private int mLabelWidth;
- private BitmapPool mBitmapPool;
+ private int mBitmapWidth;
+ private int mBitmapHeight;
private final LazyLoadedBitmap mLocalSetIcon;
private final LazyLoadedBitmap mPicasaIcon;
@@ -109,8 +110,8 @@ public class AlbumLabelMaker {
if (mLabelWidth == width) return;
mLabelWidth = width;
int borders = 2 * BORDER_SIZE;
- mBitmapPool = new BitmapPool(
- width + borders, mSpec.labelBackgroundHeight + borders, 16);
+ mBitmapWidth = width + borders;
+ mBitmapHeight = mSpec.labelBackgroundHeight + borders;
}
public ThreadPool.Job<Bitmap> requestLabel(
@@ -152,7 +153,7 @@ public class AlbumLabelMaker {
synchronized (this) {
labelWidth = mLabelWidth;
- bitmap = mBitmapPool.getBitmap();
+ bitmap = GalleryBitmapPool.getInstance().get(mBitmapWidth, mBitmapHeight);
}
if (bitmap == null) {
@@ -200,10 +201,6 @@ public class AlbumLabelMaker {
}
public void recycleLabel(Bitmap label) {
- mBitmapPool.recycle(label);
- }
-
- public void clearRecycledLabels() {
- if (mBitmapPool != null) mBitmapPool.clear();
+ GalleryBitmapPool.getInstance().put(label);
}
}