diff options
author | John Hoford <hoford@google.com> | 2013-04-23 15:55:51 -0700 |
---|---|---|
committer | John Hoford <hoford@google.com> | 2013-04-23 16:03:27 -0700 |
commit | 17218987cfa32cff5dc719cfb88d0e3ce3677f00 (patch) | |
tree | 0b2d8ce58dd4763cf4eb9d04ea0153347f1f954b /src/com/android/gallery3d/filtershow/presets | |
parent | 8600c562b8ed0f636bc966a8aac83dc90326f0fb (diff) | |
download | android_packages_apps_Gallery2-17218987cfa32cff5dc719cfb88d0e3ce3677f00.tar.gz android_packages_apps_Gallery2-17218987cfa32cff5dc719cfb88d0e3ce3677f00.tar.bz2 android_packages_apps_Gallery2-17218987cfa32cff5dc719cfb88d0e3ce3677f00.zip |
interruptible renderer
bug:8632908
Change-Id: I4df59fb0c82370491d953292fd1cd17443054ab3
Diffstat (limited to 'src/com/android/gallery3d/filtershow/presets')
-rw-r--r-- | src/com/android/gallery3d/filtershow/presets/FilterEnvironment.java | 10 | ||||
-rw-r--r-- | src/com/android/gallery3d/filtershow/presets/ImagePreset.java | 3 |
2 files changed, 13 insertions, 0 deletions
diff --git a/src/com/android/gallery3d/filtershow/presets/FilterEnvironment.java b/src/com/android/gallery3d/filtershow/presets/FilterEnvironment.java index 3c53227fc..c454c1ab6 100644 --- a/src/com/android/gallery3d/filtershow/presets/FilterEnvironment.java +++ b/src/com/android/gallery3d/filtershow/presets/FilterEnvironment.java @@ -35,6 +35,16 @@ public class FilterEnvironment { private int mQuality; private FiltersManager mFiltersManager; private CachingPipeline mCachingPipeline; + private volatile boolean mStop = false; + + public synchronized boolean needsStop() { + return mStop; + } + + public synchronized void setStop(boolean stop) { + this.mStop = stop; + } + private HashMap<Long, WeakReference<Bitmap>> bitmapCach = new HashMap<Long, WeakReference<Bitmap>>(); diff --git a/src/com/android/gallery3d/filtershow/presets/ImagePreset.java b/src/com/android/gallery3d/filtershow/presets/ImagePreset.java index bd2f494cd..ca97761ed 100644 --- a/src/com/android/gallery3d/filtershow/presets/ImagePreset.java +++ b/src/com/android/gallery3d/filtershow/presets/ImagePreset.java @@ -472,6 +472,9 @@ public class ImagePreset { representation.synchronizeRepresentation(); } bitmap = environment.applyRepresentation(representation, bitmap); + if (environment.needsStop()) { + return bitmap; + } } } |