summaryrefslogtreecommitdiffstats
path: root/src/com/android/gallery3d/filtershow/FilterShowActivity.java
diff options
context:
space:
mode:
authornicolasroard <nicolasroard@google.com>2013-01-29 13:57:42 -0800
committernicolasroard <nicolasroard@google.com>2013-01-30 15:43:01 -0800
commit518d1193692fadaf91a2f5b174735d45bda2c4ab (patch)
treef89f3859c880f8dddb164a5e1db5caaed0397b70 /src/com/android/gallery3d/filtershow/FilterShowActivity.java
parent45e42d25b8fa11f9b9615244a8f0bc68de2e4a8c (diff)
downloadandroid_packages_apps_Snap-518d1193692fadaf91a2f5b174735d45bda2c4ab.tar.gz
android_packages_apps_Snap-518d1193692fadaf91a2f5b174735d45bda2c4ab.tar.bz2
android_packages_apps_Snap-518d1193692fadaf91a2f5b174735d45bda2c4ab.zip
Clean up invalidate / redraw loop
Move the recopy to the main thread Change-Id: I8c94179e292f5679b7c817b6bd5000ee384b83ce
Diffstat (limited to 'src/com/android/gallery3d/filtershow/FilterShowActivity.java')
-rw-r--r--src/com/android/gallery3d/filtershow/FilterShowActivity.java10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/com/android/gallery3d/filtershow/FilterShowActivity.java b/src/com/android/gallery3d/filtershow/FilterShowActivity.java
index 654175210..fd4eef01c 100644
--- a/src/com/android/gallery3d/filtershow/FilterShowActivity.java
+++ b/src/com/android/gallery3d/filtershow/FilterShowActivity.java
@@ -960,15 +960,13 @@ public class FilterShowActivity extends Activity implements OnItemClickListener,
}
ImagePreset oldPreset = mMasterImage.getPreset();
ImagePreset copy = new ImagePreset(oldPreset);
- mMasterImage.setPreset(copy, true);
- // TODO: use a numerical constant instead.
- ImagePreset current = mMasterImage.getPreset();
- ImageFilter existingFilter = current.getFilter(filter.getName());
+ ImageFilter existingFilter = copy.getFilter(filter.getName());
if (existingFilter == null) {
- current.add(filter);
+ copy.add(filter);
}
- existingFilter = current.getFilter(filter.getName());
+ existingFilter = copy.getFilter(filter.getName());
+ mMasterImage.setPreset(copy, true);
mMasterImage.setCurrentFilter(existingFilter);
invalidateViews();
}