diff options
author | nicolasroard <nicolasroard@google.com> | 2013-07-15 11:24:36 -0700 |
---|---|---|
committer | nicolasroard <nicolasroard@google.com> | 2013-07-30 11:28:59 -0700 |
commit | 13ae2608e04998f0d13bc3f58cda5237bdde0b7d (patch) | |
tree | a1bbb351775e1dfe26e8feb60aae123e3b84e51a /src/com/android/gallery3d/filtershow/pipeline/FilterEnvironment.java | |
parent | 7d1433ac9191fa7b7c79a0187d4d0f30c16f84d9 (diff) | |
download | android_packages_apps_Snap-13ae2608e04998f0d13bc3f58cda5237bdde0b7d.tar.gz android_packages_apps_Snap-13ae2608e04998f0d13bc3f58cda5237bdde0b7d.tar.bz2 android_packages_apps_Snap-13ae2608e04998f0d13bc3f58cda5237bdde0b7d.zip |
Add user presets saving/loading
Change-Id: I85c5dd0df1e9264a01c8d7a6d44602e87799890c
Diffstat (limited to 'src/com/android/gallery3d/filtershow/pipeline/FilterEnvironment.java')
-rw-r--r-- | src/com/android/gallery3d/filtershow/pipeline/FilterEnvironment.java | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/com/android/gallery3d/filtershow/pipeline/FilterEnvironment.java b/src/com/android/gallery3d/filtershow/pipeline/FilterEnvironment.java index f97dc757a..29608bfbd 100644 --- a/src/com/android/gallery3d/filtershow/pipeline/FilterEnvironment.java +++ b/src/com/android/gallery3d/filtershow/pipeline/FilterEnvironment.java @@ -20,6 +20,7 @@ import android.graphics.Bitmap; import android.support.v8.renderscript.Allocation; import com.android.gallery3d.filtershow.filters.FilterRepresentation; +import com.android.gallery3d.filtershow.filters.FilterUserPresetRepresentation; import com.android.gallery3d.filtershow.filters.FiltersManagerInterface; import com.android.gallery3d.filtershow.filters.ImageFilter; @@ -128,6 +129,12 @@ public class FilterEnvironment { } public Bitmap applyRepresentation(FilterRepresentation representation, Bitmap bitmap) { + if (representation instanceof FilterUserPresetRepresentation) { + // we allow instances of FilterUserPresetRepresentation in a preset only to know if one + // has been applied (so we can show this in the UI). But as all the filters in them are + // applied directly they do not themselves need to do any kind of filtering. + return bitmap; + } ImageFilter filter = mFiltersManager.getFilterForRepresentation(representation); filter.useRepresentation(representation); filter.setEnvironment(this); |