summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRuben Brunk <rubenbrunk@google.com>2013-04-02 00:00:01 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2013-04-02 00:00:01 +0000
commit3d52d5e335bb29298d32c31f1506eac7516d1424 (patch)
treec2da3fc3d2354b4ff5cb7d97c6e35187f751f3db
parent952c5124e1a2fe35d3803018e8d06f297e0ec123 (diff)
parentd78df3f7e38648b99c81e72c2010fb019ee9c2eb (diff)
downloadandroid_packages_apps_Snap-3d52d5e335bb29298d32c31f1506eac7516d1424.tar.gz
android_packages_apps_Snap-3d52d5e335bb29298d32c31f1506eac7516d1424.tar.bz2
android_packages_apps_Snap-3d52d5e335bb29298d32c31f1506eac7516d1424.zip
Merge "Change panels organization. Also fixes border updates handling." into gb-ub-photos-bryce
-rw-r--r--src/com/android/gallery3d/filtershow/presets/ImagePreset.java39
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();