summaryrefslogtreecommitdiffstats
path: root/src/com/android/gallery3d/filtershow/filters
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android/gallery3d/filtershow/filters')
-rw-r--r--src/com/android/gallery3d/filtershow/filters/ImageFilter.java30
-rw-r--r--src/com/android/gallery3d/filtershow/filters/ImageFilterRS.java5
2 files changed, 2 insertions, 33 deletions
diff --git a/src/com/android/gallery3d/filtershow/filters/ImageFilter.java b/src/com/android/gallery3d/filtershow/filters/ImageFilter.java
index 866fc5e42..614c6a01d 100644
--- a/src/com/android/gallery3d/filtershow/filters/ImageFilter.java
+++ b/src/com/android/gallery3d/filtershow/filters/ImageFilter.java
@@ -18,10 +18,8 @@ package com.android.gallery3d.filtershow.filters;
import android.graphics.Bitmap;
import android.graphics.Matrix;
-import android.widget.Toast;
import com.android.gallery3d.R;
-import com.android.gallery3d.filtershow.FilterShowActivity;
import com.android.gallery3d.filtershow.editors.BasicEditor;
import com.android.gallery3d.filtershow.imageshow.GeometryMetadata;
import com.android.gallery3d.filtershow.presets.ImagePreset;
@@ -33,30 +31,6 @@ public abstract class ImageFilter implements Cloneable {
protected String mName = "Original";
private final String LOGTAG = "ImageFilter";
- // TODO: Temporary, for dogfood note memory issues with toasts for better
- // feedback. Remove this when filters actually work in low memory
- // situations.
- private static FilterShowActivity sActivity = null;
-
- public static void setActivityForMemoryToasts(FilterShowActivity activity) {
- sActivity = activity;
- }
-
- public static void reset() {
- sActivity = null;
- }
-
- public void displayLowMemoryToast() {
- if (sActivity != null) {
- sActivity.runOnUiThread(new Runnable() {
- public void run() {
- Toast.makeText(sActivity, "Memory too low for filter " + getName() +
- ", please file a bug report", Toast.LENGTH_SHORT).show();
- }
- });
- }
- }
-
public void setName(String name) {
mName = name;
}
@@ -71,8 +45,8 @@ public abstract class ImageFilter implements Cloneable {
}
/**
- * Called on small bitmaps to create button icons for each filter. Override
- * this to provide filter-specific button icons.
+ * Called on small bitmaps to create button icons for each filter.
+ * Override this to provide filter-specific button icons.
*/
public Bitmap iconApply(Bitmap bitmap, float scaleFactor, int quality) {
return apply(bitmap, scaleFactor, quality);
diff --git a/src/com/android/gallery3d/filtershow/filters/ImageFilterRS.java b/src/com/android/gallery3d/filtershow/filters/ImageFilterRS.java
index a3467edde..74712be47 100644
--- a/src/com/android/gallery3d/filtershow/filters/ImageFilterRS.java
+++ b/src/com/android/gallery3d/filtershow/filters/ImageFilterRS.java
@@ -89,11 +89,6 @@ public abstract class ImageFilterRS extends ImageFilter {
Log.e(LOGTAG, "Illegal argument? " + e);
} catch (android.renderscript.RSRuntimeException e) {
Log.e(LOGTAG, "RS runtime exception ? " + e);
- } catch (java.lang.OutOfMemoryError e) {
- // Many of the renderscript filters allocated large (>16Mb resources) in order to apply.
- System.gc();
- displayLowMemoryToast();
- Log.e(LOGTAG, "not enough memory for filter " + getName(), e);
}
return bitmap;
}