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/app | |
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/app')
-rw-r--r-- | src/com/android/gallery3d/app/AbstractGalleryActivity.java | 10 | ||||
-rw-r--r-- | src/com/android/gallery3d/app/PhotoDataAdapter.java | 5 |
2 files changed, 4 insertions, 11 deletions
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(); diff --git a/src/com/android/gallery3d/app/PhotoDataAdapter.java b/src/com/android/gallery3d/app/PhotoDataAdapter.java index faff14674..d409315d1 100644 --- a/src/com/android/gallery3d/app/PhotoDataAdapter.java +++ b/src/com/android/gallery3d/app/PhotoDataAdapter.java @@ -23,7 +23,6 @@ import android.os.Message; import com.android.gallery3d.common.BitmapUtils; import com.android.gallery3d.common.Utils; -import com.android.gallery3d.data.BitmapPool; import com.android.gallery3d.data.ContentListener; import com.android.gallery3d.data.LocalMediaItem; import com.android.gallery3d.data.MediaItem; @@ -550,8 +549,8 @@ public class PhotoDataAdapter implements PhotoPage.Model { } @Override - public Bitmap getTile(int level, int x, int y, int tileSize, BitmapPool pool) { - return mTileProvider.getTile(level, x, y, tileSize, pool); + public Bitmap getTile(int level, int x, int y, int tileSize) { + return mTileProvider.getTile(level, x, y, tileSize); } @Override |