summaryrefslogtreecommitdiffstats
path: root/src/com/android/gallery3d/filtershow/presets
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/presets
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/presets')
-rw-r--r--src/com/android/gallery3d/filtershow/presets/FilterEnvironment.java16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/com/android/gallery3d/filtershow/presets/FilterEnvironment.java b/src/com/android/gallery3d/filtershow/presets/FilterEnvironment.java
index c20502290..c45036012 100644
--- a/src/com/android/gallery3d/filtershow/presets/FilterEnvironment.java
+++ b/src/com/android/gallery3d/filtershow/presets/FilterEnvironment.java
@@ -17,6 +17,7 @@
package com.android.gallery3d.filtershow.presets;
import android.graphics.Bitmap;
+import com.android.gallery3d.filtershow.cache.CachingPipeline;
import com.android.gallery3d.filtershow.filters.FilterRepresentation;
import com.android.gallery3d.filtershow.filters.FiltersManager;
import com.android.gallery3d.filtershow.filters.ImageFilter;
@@ -26,6 +27,7 @@ public class FilterEnvironment {
private float mScaleFactor;
private int mQuality;
private FiltersManager mFiltersManager;
+ private CachingPipeline mCachingPipeline;
public void setImagePreset(ImagePreset imagePreset) {
mImagePreset = imagePreset;
@@ -62,7 +64,17 @@ public class FilterEnvironment {
public Bitmap applyRepresentation(FilterRepresentation representation, Bitmap bitmap) {
ImageFilter filter = mFiltersManager.getFilterForRepresentation(representation);
filter.useRepresentation(representation);
- filter.setImagePreset(mImagePreset);
- return filter.apply(bitmap, mScaleFactor, mQuality);
+ filter.setEnvironment(this);
+ Bitmap ret = filter.apply(bitmap, mScaleFactor, mQuality);
+ filter.setEnvironment(null);
+ return ret;
+ }
+
+ public CachingPipeline getCachingPipeline() {
+ return mCachingPipeline;
+ }
+
+ public void setCachingPipeline(CachingPipeline cachingPipeline) {
+ mCachingPipeline = cachingPipeline;
}
}