summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRuben Brunk <rubenbrunk@google.com>2013-03-11 12:00:06 -0700
committerRuben Brunk <rubenbrunk@google.com>2013-03-11 12:07:27 -0700
commit4ef1d738b796d9b6af448d9bfc46e262a97eafcd (patch)
tree40022a86ac12ba33fa3d01e67744fc846cb55079 /src
parente0654dad632fa12959335dc68d6ae27b0d846376 (diff)
downloadandroid_packages_apps_Snap-4ef1d738b796d9b6af448d9bfc46e262a97eafcd.tar.gz
android_packages_apps_Snap-4ef1d738b796d9b6af448d9bfc46e262a97eafcd.tar.bz2
android_packages_apps_Snap-4ef1d738b796d9b6af448d9bfc46e262a97eafcd.zip
Clear Gallery's bitmap pool before starting photoeditor.
Change-Id: Iaa1f559db12ba22e53673b2e9fe2c3fbabf33514
Diffstat (limited to 'src')
-rw-r--r--src/com/android/gallery3d/filtershow/FilterShowActivity.java14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/com/android/gallery3d/filtershow/FilterShowActivity.java b/src/com/android/gallery3d/filtershow/FilterShowActivity.java
index 1c7c0642a..10650b9e6 100644
--- a/src/com/android/gallery3d/filtershow/FilterShowActivity.java
+++ b/src/com/android/gallery3d/filtershow/FilterShowActivity.java
@@ -86,6 +86,7 @@ import com.android.gallery3d.filtershow.ui.FilterIconButton;
import com.android.gallery3d.filtershow.ui.FramedTextButton;
import com.android.gallery3d.filtershow.ui.Spline;
import com.android.gallery3d.util.GalleryUtils;
+import com.android.photos.data.GalleryBitmapPool;
import java.io.File;
import java.io.IOException;
@@ -141,6 +142,8 @@ public class FilterShowActivity extends Activity implements OnItemClickListener,
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
+ clearGalleryBitmapPool();
+
setupMasterImage();
setDefaultValues();
fillEditors();
@@ -512,6 +515,17 @@ public class FilterShowActivity extends Activity implements OnItemClickListener,
}
+ private void clearGalleryBitmapPool() {
+ (new AsyncTask<Void, Void, Void>() {
+ @Override
+ protected Void doInBackground(Void... params) {
+ // Free memory held in Gallery's Bitmap pool. May be O(n) for n bitmaps.
+ GalleryBitmapPool.getInstance().clear();
+ return null;
+ }
+ }).execute();
+ }
+
private void fillButtonIcons() {
Bitmap bmap = mImageLoader.getOriginalBitmapSmall();
if (bmap != null && bmap.getWidth() > 0 && bmap.getHeight() > 0) {