From 11cfeeddedd61d3c4aa40945fef0bc2d87c7559d Mon Sep 17 00:00:00 2001 From: Bobby Georgescu Date: Tue, 19 Feb 2013 15:49:14 -0800 Subject: 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 --- src/com/android/gallery3d/ui/BitmapLoader.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/com/android/gallery3d/ui/BitmapLoader.java') 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 { 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 { 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 { } abstract protected Future submitBitmapTask(FutureListener l); - abstract protected void recycleBitmap(Bitmap bitmap); abstract protected void onLoadComplete(Bitmap bitmap); } -- cgit v1.2.3