diff options
author | ztenghui <ztenghui@google.com> | 2013-06-03 18:16:43 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2013-06-03 18:16:44 +0000 |
commit | 3939633cad71e4e9da482752dd3b1cde850ef963 (patch) | |
tree | e91fa13d75820055d1982d8e7a85b80cad142aa6 /src | |
parent | 31f71961edadf2f9d6c137b3bd4cb4d3a3db1f27 (diff) | |
parent | 71e436c3c839b5dccb409e93abb6509b21144b14 (diff) | |
download | android_packages_apps_Snap-3939633cad71e4e9da482752dd3b1cde850ef963.tar.gz android_packages_apps_Snap-3939633cad71e4e9da482752dd3b1cde850ef963.tar.bz2 android_packages_apps_Snap-3939633cad71e4e9da482752dd3b1cde850ef963.zip |
Merge "Add LUT3D filter state saving" into gb-ub-photos-carlsbad
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/gallery3d/filtershow/filters/BaseFiltersManager.java | 7 | ||||
-rw-r--r-- | src/com/android/gallery3d/filtershow/filters/FilterFxRepresentation.java | 8 |
2 files changed, 9 insertions, 6 deletions
diff --git a/src/com/android/gallery3d/filtershow/filters/BaseFiltersManager.java b/src/com/android/gallery3d/filtershow/filters/BaseFiltersManager.java index 1c7294c3a..4186b9337 100644 --- a/src/com/android/gallery3d/filtershow/filters/BaseFiltersManager.java +++ b/src/com/android/gallery3d/filtershow/filters/BaseFiltersManager.java @@ -19,7 +19,6 @@ import android.content.Context; import android.content.res.Resources; import android.util.Log; - import com.android.gallery3d.R; import com.android.gallery3d.filtershow.presets.ImagePreset; @@ -42,8 +41,8 @@ public abstract class BaseFiltersManager implements FiltersManagerInterface { if (filterInstance instanceof ImageFilter) { mFilters.put(filterClass, (ImageFilter) filterInstance); - FilterRepresentation rep = - ((ImageFilter) filterInstance).getDefaultRepresentation(); + FilterRepresentation rep = + ((ImageFilter) filterInstance).getDefaultRepresentation(); if (rep != null) { addRepresentation(rep); } @@ -74,6 +73,7 @@ public abstract class BaseFiltersManager implements FiltersManagerInterface { return mFilters.get(c); } + @Override public ImageFilter getFilterForRepresentation(FilterRepresentation representation) { return mFilters.get(representation.getFilterClass()); } @@ -166,6 +166,7 @@ public abstract class BaseFiltersManager implements FiltersManagerInterface { FilterFxRepresentation fx = new FilterFxRepresentation( context.getString(fxNameid[i]), drawid[i], fxNameid[i]); representations.add(fx); + addRepresentation(fx); } } diff --git a/src/com/android/gallery3d/filtershow/filters/FilterFxRepresentation.java b/src/com/android/gallery3d/filtershow/filters/FilterFxRepresentation.java index 1ceffb4a2..d0ba302c7 100644 --- a/src/com/android/gallery3d/filtershow/filters/FilterFxRepresentation.java +++ b/src/com/android/gallery3d/filtershow/filters/FilterFxRepresentation.java @@ -16,8 +16,6 @@ package com.android.gallery3d.filtershow.filters; -import android.graphics.Bitmap; -import com.android.gallery3d.app.Log; import com.android.gallery3d.filtershow.editors.ImageOnlyEditor; public class FilterFxRepresentation extends FilterRepresentation { @@ -30,7 +28,7 @@ public class FilterFxRepresentation extends FilterRepresentation { public FilterFxRepresentation(String name, int bitmapResource, int nameResource) { super(name); - setSerializationName(SERIALIZATION_NAME); + setSerializationName(SERIALIZATION_NAME + "_" + name); mBitmapResource = bitmapResource; mNameResource = nameResource; @@ -44,6 +42,7 @@ public class FilterFxRepresentation extends FilterRepresentation { setSupportsPartialRendering(true); } + @Override public String toString() { return "FilterFx: " + hashCode() + " : " + getName() + " bitmap rsc: " + mBitmapResource; } @@ -57,6 +56,7 @@ public class FilterFxRepresentation extends FilterRepresentation { return representation; } + @Override public synchronized void useParametersFrom(FilterRepresentation a) { if (a instanceof FilterFxRepresentation) { FilterFxRepresentation representation = (FilterFxRepresentation) a; @@ -81,6 +81,7 @@ public class FilterFxRepresentation extends FilterRepresentation { return false; } + @Override public boolean same(FilterRepresentation representation) { if (!super.same(representation)) { return false; @@ -88,6 +89,7 @@ public class FilterFxRepresentation extends FilterRepresentation { return equals(representation); } + @Override public boolean allowsMultipleInstances() { return true; } |