summaryrefslogtreecommitdiffstats
path: root/src/com/android/gallery3d/filtershow/filters/ImageFilter.java
diff options
context:
space:
mode:
authornicolasroard <nicolasroard@google.com>2013-03-20 14:55:48 -0700
committernicolasroard <nicolasroard@google.com>2013-03-20 19:34:06 -0700
commitfc8a6a38c699c0d75fa29664d9aaa369d361c335 (patch)
tree378d23ecaceee0117f6cd4e26612f215f2c82c2e /src/com/android/gallery3d/filtershow/filters/ImageFilter.java
parent7e3756f133965651434f581255646da497b90a51 (diff)
downloadandroid_packages_apps_Gallery2-fc8a6a38c699c0d75fa29664d9aaa369d361c335.tar.gz
android_packages_apps_Gallery2-fc8a6a38c699c0d75fa29664d9aaa369d361c335.tar.bz2
android_packages_apps_Gallery2-fc8a6a38c699c0d75fa29664d9aaa369d361c335.zip
Fix crashes with RS filters
bug:8418537 Change-Id: I37f8ad8a77f04faed9f721122872f00f7aaaa365
Diffstat (limited to 'src/com/android/gallery3d/filtershow/filters/ImageFilter.java')
-rw-r--r--src/com/android/gallery3d/filtershow/filters/ImageFilter.java18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/com/android/gallery3d/filtershow/filters/ImageFilter.java b/src/com/android/gallery3d/filtershow/filters/ImageFilter.java
index bd9dcafcf..63a76627a 100644
--- a/src/com/android/gallery3d/filtershow/filters/ImageFilter.java
+++ b/src/com/android/gallery3d/filtershow/filters/ImageFilter.java
@@ -22,11 +22,11 @@ import android.widget.Toast;
import com.android.gallery3d.filtershow.FilterShowActivity;
import com.android.gallery3d.filtershow.imageshow.GeometryMetadata;
+import com.android.gallery3d.filtershow.presets.FilterEnvironment;
import com.android.gallery3d.filtershow.presets.ImagePreset;
public abstract class ImageFilter implements Cloneable {
-
- private ImagePreset mImagePreset;
+ private FilterEnvironment mEnvironment = null;
protected String mName = "Original";
private final String LOGTAG = "ImageFilter";
@@ -79,11 +79,7 @@ public abstract class ImageFilter implements Cloneable {
}
public ImagePreset getImagePreset() {
- return mImagePreset;
- }
-
- public void setImagePreset(ImagePreset imagePreset) {
- mImagePreset = imagePreset;
+ return getEnvironment().getImagePreset();
}
public abstract void useRepresentation(FilterRepresentation representation);
@@ -103,4 +99,12 @@ public abstract class ImageFilter implements Cloneable {
w, h);
return originalToScreen;
}
+
+ public void setEnvironment(FilterEnvironment environment) {
+ mEnvironment = environment;
+ }
+
+ public FilterEnvironment getEnvironment() {
+ return mEnvironment;
+ }
}