From f52ceba89962829aa12f5caba131580e8da85880 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/app/AbstractGalleryActivity.java | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'src/com/android/gallery3d/app/AbstractGalleryActivity.java') diff --git a/src/com/android/gallery3d/app/AbstractGalleryActivity.java b/src/com/android/gallery3d/app/AbstractGalleryActivity.java index c9cce811a..d96094245 100644 --- a/src/com/android/gallery3d/app/AbstractGalleryActivity.java +++ b/src/com/android/gallery3d/app/AbstractGalleryActivity.java @@ -38,9 +38,9 @@ import android.view.WindowManager; import com.android.gallery3d.R; import com.android.gallery3d.common.ApiHelper; -import com.android.gallery3d.data.BitmapPool; import com.android.gallery3d.data.DataManager; import com.android.gallery3d.data.MediaItem; +import com.android.photos.data.GalleryBitmapPool; import com.android.gallery3d.ui.GLRoot; import com.android.gallery3d.ui.GLRootView; import com.android.gallery3d.util.LightCycleHelper.PanoramaViewHelper; @@ -222,16 +222,10 @@ public class AbstractGalleryActivity extends Activity implements GalleryContext } finally { mGLRootView.unlockRenderThread(); } - clearBitmapPool(MediaItem.getMicroThumbPool()); - clearBitmapPool(MediaItem.getThumbPool()); - + GalleryBitmapPool.getInstance().clear(); MediaItem.getBytesBufferPool().clear(); } - private static void clearBitmapPool(BitmapPool pool) { - if (pool != null) pool.clear(); - } - @Override protected void onDestroy() { super.onDestroy(); -- cgit v1.2.3