diff options
author | nicolasroard <nicolasroard@google.com> | 2013-03-20 14:55:48 -0700 |
---|---|---|
committer | nicolasroard <nicolasroard@google.com> | 2013-03-20 19:34:06 -0700 |
commit | 7847f8d2fef696ac30d502a9875afeb0c727a5f1 (patch) | |
tree | 0a3a4fa20f83c43d3bf1128d709f422adf2d6b68 /src/com/android/gallery3d/filtershow/presets | |
parent | a40965b95af786ed2aa13ff63e38b92881f3c315 (diff) | |
download | android_packages_apps_Snap-7847f8d2fef696ac30d502a9875afeb0c727a5f1.tar.gz android_packages_apps_Snap-7847f8d2fef696ac30d502a9875afeb0c727a5f1.tar.bz2 android_packages_apps_Snap-7847f8d2fef696ac30d502a9875afeb0c727a5f1.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.java | 16 |
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; } } |