diff options
author | nicolasroard <nicolasroard@google.com> | 2013-03-19 20:13:33 -0700 |
---|---|---|
committer | nicolasroard <nicolasroard@google.com> | 2013-03-19 20:13:33 -0700 |
commit | 3bd74269f760dd35e8efcbe904284679202ff365 (patch) | |
tree | 635d01f7bea15445126f0fd5088cf1d05c2da943 /src/com/android/gallery3d/filtershow | |
parent | 09d311c58be3825ba5fb9d4d42d7952fc6c1bbac (diff) | |
download | android_packages_apps_Snap-3bd74269f760dd35e8efcbe904284679202ff365.tar.gz android_packages_apps_Snap-3bd74269f760dd35e8efcbe904284679202ff365.tar.bz2 android_packages_apps_Snap-3bd74269f760dd35e8efcbe904284679202ff365.zip |
Add accessor for filters to the source bitmap passed to apply()
Change-Id: I2900c5b799592c388daa9049093ef8c80fa4f5c6
Diffstat (limited to 'src/com/android/gallery3d/filtershow')
-rw-r--r-- | src/com/android/gallery3d/filtershow/filters/ImageFilterRS.java | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/com/android/gallery3d/filtershow/filters/ImageFilterRS.java b/src/com/android/gallery3d/filtershow/filters/ImageFilterRS.java index 246192c2d..499170a35 100644 --- a/src/com/android/gallery3d/filtershow/filters/ImageFilterRS.java +++ b/src/com/android/gallery3d/filtershow/filters/ImageFilterRS.java @@ -39,6 +39,12 @@ public abstract class ImageFilterRS extends ImageFilter { private static final Bitmap.Config BITMAP_CONFIG = Bitmap.Config.ARGB_8888; + private volatile Bitmap mSourceBitmap = null; + + public Bitmap getSourceBitmap() { + return mSourceBitmap; + } + // This must be used inside block synchronized on ImageFilterRS class object protected void prepare(Bitmap bitmap, float scaleFactor, int quality) { if (mOutPixelsAllocation == null || mInPixelsAllocation == null || @@ -87,6 +93,7 @@ public abstract class ImageFilterRS extends ImageFilter { Log.w(LOGTAG, "Cannot apply before calling createRenderScriptContext"); return bitmap; } + mSourceBitmap = bitmap; prepare(bitmap, scaleFactor, quality); runFilter(); update(bitmap); @@ -101,6 +108,7 @@ public abstract class ImageFilterRS extends ImageFilter { displayLowMemoryToast(); Log.e(LOGTAG, "not enough memory for filter " + getName(), e); } + mSourceBitmap = null; return bitmap; } |