diff options
author | nicolasroard <nicolasroard@google.com> | 2013-03-21 21:33:22 -0700 |
---|---|---|
committer | nicolasroard <nicolasroard@google.com> | 2013-03-21 21:33:22 -0700 |
commit | cbbaef3e674898c3045486ae4930966c3dff1147 (patch) | |
tree | 90d4188ded60d061bc6ae47dc7f99cb40a6bd4ee /src/com/android/gallery3d/filtershow/filters/ImageFilterFx.java | |
parent | dc19e2f107b02b62f887dc500e107ad8f4a9cb07 (diff) | |
download | android_packages_apps_Snap-cbbaef3e674898c3045486ae4930966c3dff1147.tar.gz android_packages_apps_Snap-cbbaef3e674898c3045486ae4930966c3dff1147.tar.bz2 android_packages_apps_Snap-cbbaef3e674898c3045486ae4930966c3dff1147.zip |
Fix problem applying the Fx filter
Also adds some debug info
bug:8442036
Change-Id: Ife7fd4be664ae011e41969e74c7745da0a7a52f5
Diffstat (limited to 'src/com/android/gallery3d/filtershow/filters/ImageFilterFx.java')
-rw-r--r-- | src/com/android/gallery3d/filtershow/filters/ImageFilterFx.java | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/com/android/gallery3d/filtershow/filters/ImageFilterFx.java b/src/com/android/gallery3d/filtershow/filters/ImageFilterFx.java index 904a601f4..68e8a7c9d 100644 --- a/src/com/android/gallery3d/filtershow/filters/ImageFilterFx.java +++ b/src/com/android/gallery3d/filtershow/filters/ImageFilterFx.java @@ -57,10 +57,15 @@ public class ImageFilterFx extends ImageFilter { int w = bitmap.getWidth(); int h = bitmap.getHeight(); - if (mFxBitmap == null || mFxBitmapId != getParameters().getBitmapResource()) { + int bitmapResourceId = getParameters().getBitmapResource(); + if (bitmapResourceId == 0) { // null filter fx + return bitmap; + } + + if (mFxBitmap == null || mFxBitmapId != bitmapResourceId) { BitmapFactory.Options o = new BitmapFactory.Options(); o.inScaled = false; - mFxBitmapId = getParameters().getBitmapResource(); + mFxBitmapId = bitmapResourceId; if (mFxBitmapId != 0) { mFxBitmap = BitmapFactory.decodeResource(mResources, mFxBitmapId, o); } else { |