summaryrefslogtreecommitdiffstats
path: root/src/com/android/gallery3d/filtershow/filters/ImageFilterRS.java
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
commit269d2c8602e8893b0bf399324b2072783ba0f37c (patch)
tree82dcd9a6f329c9f6bfd5f3be20f00e6f3d0a8769 /src/com/android/gallery3d/filtershow/filters/ImageFilterRS.java
parent8898eaabfa0cdf70e00078d2dea810f9aab4dfd1 (diff)
downloadandroid_packages_apps_Gallery2-269d2c8602e8893b0bf399324b2072783ba0f37c.tar.gz
android_packages_apps_Gallery2-269d2c8602e8893b0bf399324b2072783ba0f37c.tar.bz2
android_packages_apps_Gallery2-269d2c8602e8893b0bf399324b2072783ba0f37c.zip
Add accessor for filters to the source bitmap passed to apply()
Change-Id: I2900c5b799592c388daa9049093ef8c80fa4f5c6
Diffstat (limited to 'src/com/android/gallery3d/filtershow/filters/ImageFilterRS.java')
-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;
}