summaryrefslogtreecommitdiffstats
path: root/src/com/android/gallery3d/filtershow/filters
diff options
context:
space:
mode:
authorztenghui <ztenghui@google.com>2013-07-16 17:07:23 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2013-07-16 17:07:23 +0000
commitdda606af6d6a18c31b1da3f8885e06b51982b601 (patch)
tree8d5cd1e34137ec1ec87982fa32b635e76bef9dfc /src/com/android/gallery3d/filtershow/filters
parentce8eff82eb694626e8c53049501b4af2297a6c48 (diff)
parentb279681ff115205aee81eb52ee8793fd709f0908 (diff)
downloadandroid_packages_apps_Gallery2-dda606af6d6a18c31b1da3f8885e06b51982b601.tar.gz
android_packages_apps_Gallery2-dda606af6d6a18c31b1da3f8885e06b51982b601.tar.bz2
android_packages_apps_Gallery2-dda606af6d6a18c31b1da3f8885e06b51982b601.zip
Merge "Add equality check into FilterCurveRep" into gb-ub-photos-carlsbad
Diffstat (limited to 'src/com/android/gallery3d/filtershow/filters')
-rw-r--r--src/com/android/gallery3d/filtershow/filters/FilterCurvesRepresentation.java23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/com/android/gallery3d/filtershow/filters/FilterCurvesRepresentation.java b/src/com/android/gallery3d/filtershow/filters/FilterCurvesRepresentation.java
index a71aa8863..569ead957 100644
--- a/src/com/android/gallery3d/filtershow/filters/FilterCurvesRepresentation.java
+++ b/src/com/android/gallery3d/filtershow/filters/FilterCurvesRepresentation.java
@@ -58,6 +58,7 @@ public class FilterCurvesRepresentation extends FilterRepresentation {
mSplines = spline;
}
+ @Override
public boolean isNil() {
for (int i = 0; i < MAX_SPLINE_NUMBER; i++) {
if (getSpline(i) != null && !getSpline(i).isOriginal()) {
@@ -67,6 +68,27 @@ public class FilterCurvesRepresentation extends FilterRepresentation {
return true;
}
+ @Override
+ public boolean equals(FilterRepresentation representation) {
+ if (!super.equals(representation)) {
+ return false;
+ }
+
+ if (!(representation instanceof FilterCurvesRepresentation)) {
+ return false;
+ } else {
+ FilterCurvesRepresentation curve =
+ (FilterCurvesRepresentation) representation;
+ for (int i = 0; i < MAX_SPLINE_NUMBER; i++) {
+ if (!getSpline(i).sameValues(curve.getSpline(i))) {
+ return false;
+ }
+ }
+ }
+ // Every spline matches, therefore they are the same.
+ return true;
+ }
+
public void reset() {
Spline spline = new Spline();
@@ -81,6 +103,7 @@ public class FilterCurvesRepresentation extends FilterRepresentation {
public void setSpline(int splineIndex, Spline s) {
mSplines[splineIndex] = s;
}
+
public Spline getSpline(int splineIndex) {
return mSplines[splineIndex];
}