summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/com/android/gallery3d/filtershow/filters/IconUtilities.java5
-rw-r--r--src/com/android/gallery3d/filtershow/filters/ImageFilterFx.java19
2 files changed, 20 insertions, 4 deletions
diff --git a/src/com/android/gallery3d/filtershow/filters/IconUtilities.java b/src/com/android/gallery3d/filtershow/filters/IconUtilities.java
index 38211f3c9..e2a01472d 100644
--- a/src/com/android/gallery3d/filtershow/filters/IconUtilities.java
+++ b/src/com/android/gallery3d/filtershow/filters/IconUtilities.java
@@ -64,8 +64,9 @@ public class IconUtilities {
int h = bitmap.getHeight();
int fxw = fxBitmap.getWidth();
int fxh = fxBitmap.getHeight();
-
- nativeApplyFilter(bitmap, w, h, fxBitmap, fxw, fxh);
+ int start = 0;
+ int end = w * h * 4;
+ nativeApplyFilter(bitmap, w, h, fxBitmap, fxw, fxh, start, end);
return bitmap;
}
};
diff --git a/src/com/android/gallery3d/filtershow/filters/ImageFilterFx.java b/src/com/android/gallery3d/filtershow/filters/ImageFilterFx.java
index 51c66127b..19bea593b 100644
--- a/src/com/android/gallery3d/filtershow/filters/ImageFilterFx.java
+++ b/src/com/android/gallery3d/filtershow/filters/ImageFilterFx.java
@@ -51,7 +51,9 @@ public class ImageFilterFx extends ImageFilter {
return mParameters;
}
- native protected void nativeApplyFilter(Bitmap bitmap, int w, int h,Bitmap fxBitmap, int fxw, int fxh);
+ native protected void nativeApplyFilter(Bitmap bitmap, int w, int h,
+ Bitmap fxBitmap, int fxw, int fxh,
+ int start, int end);
@Override
public Bitmap apply(Bitmap bitmap, float scaleFactor, int quality) {
@@ -85,7 +87,20 @@ public class ImageFilterFx extends ImageFilter {
int fxw = mFxBitmap.getWidth();
int fxh = mFxBitmap.getHeight();
- nativeApplyFilter(bitmap, w, h, mFxBitmap, fxw, fxh);
+ int stride = w * 4;
+ int max = stride * h;
+ int increment = stride * 256; // 256 lines
+ for (int i = 0; i < max; i += increment) {
+ int start = i;
+ int end = i + increment;
+ if (end > max) {
+ end = max;
+ }
+ if (!getEnvironment().needsStop()) {
+ nativeApplyFilter(bitmap, w, h, mFxBitmap, fxw, fxh, start, end);
+ }
+ }
+
return bitmap;
}