diff options
author | Ruben Brunk <rubenbrunk@google.com> | 2013-04-01 16:55:05 -0700 |
---|---|---|
committer | Ruben Brunk <rubenbrunk@google.com> | 2013-04-01 16:55:05 -0700 |
commit | d78df3f7e38648b99c81e72c2010fb019ee9c2eb (patch) | |
tree | e05f2ba410b4c53a2dd859769642b00729fba416 /src | |
parent | a1665151a65c32b3ab3c4190d24bebf2c22cbbb1 (diff) | |
download | android_packages_apps_Snap-d78df3f7e38648b99c81e72c2010fb019ee9c2eb.tar.gz android_packages_apps_Snap-d78df3f7e38648b99c81e72c2010fb019ee9c2eb.tar.bz2 android_packages_apps_Snap-d78df3f7e38648b99c81e72c2010fb019ee9c2eb.zip |
Change panels organization. Also fixes border updates handling.
Change-Id: If96754e821b1e80238d2a04e65f1b57ee9683efe
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/gallery3d/filtershow/presets/ImagePreset.java | 39 |
1 files changed, 28 insertions, 11 deletions
diff --git a/src/com/android/gallery3d/filtershow/presets/ImagePreset.java b/src/com/android/gallery3d/filtershow/presets/ImagePreset.java index b2dd6b711..a35a18a7d 100644 --- a/src/com/android/gallery3d/filtershow/presets/ImagePreset.java +++ b/src/com/android/gallery3d/filtershow/presets/ImagePreset.java @@ -117,15 +117,24 @@ public class ImagePreset { if (filterRepresentation == null) { return null; } - int position = getPositionForRepresentation(filterRepresentation); - if (position == -1) { - return null; - } FilterRepresentation representation = null; - try { - representation = mFilters.elementAt(position).clone(); - } catch (CloneNotSupportedException e) { - e.printStackTrace(); + if ((mBorder != null) + && (mBorder.getFilterClass() == filterRepresentation.getFilterClass())) { + // TODO: instead of special casing for border, we should correctly implements "filters priority set" + representation = mBorder; + } else { + int position = getPositionForRepresentation(filterRepresentation); + if (position == -1) { + return null; + } + representation = mFilters.elementAt(position); + } + if (representation != null) { + try { + representation = representation.clone(); + } catch (CloneNotSupportedException e) { + e.printStackTrace(); + } } return representation; } @@ -138,9 +147,17 @@ public class ImagePreset { if (representation instanceof GeometryMetadata) { setGeometry((GeometryMetadata) representation); } else { - int position = getPositionForRepresentation(representation); - FilterRepresentation old = mFilters.elementAt(position); - old.updateTempParametersFrom(representation); + if ((mBorder != null) + && (mBorder.getFilterClass() == representation.getFilterClass())) { + mBorder.updateTempParametersFrom(representation); + } else { + int position = getPositionForRepresentation(representation); + if (position == -1) { + return; + } + FilterRepresentation old = mFilters.elementAt(position); + old.updateTempParametersFrom(representation); + } } } MasterImage.getImage().invalidatePreview(); |