summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authornicolasroard <nicolasroard@google.com>2013-03-19 20:13:33 -0700
committernicolasroard <nicolasroard@google.com>2013-03-19 20:13:33 -0700
commit3bd74269f760dd35e8efcbe904284679202ff365 (patch)
tree635d01f7bea15445126f0fd5088cf1d05c2da943 /src
parent09d311c58be3825ba5fb9d4d42d7952fc6c1bbac (diff)
downloadandroid_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')
-rw-r--r--src/com/android/gallery3d/filtershow/filters/ImageFilterRS.java8
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;
}