From a337253c886df37f37341c4cd7b708bfcdee4a9d Mon Sep 17 00:00:00 2001 From: nicolasroard Date: Tue, 2 Jul 2013 13:21:31 -0700 Subject: Add stop check in ImageFilterFX speed up switching / interrupting of rendering. Change-Id: I3ef4b1d16047b00a062c86d72cdfff2bfe9817a2 --- jni/filters/fx.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'jni') diff --git a/jni/filters/fx.c b/jni/filters/fx.c index 24fa5e0d7..c3c9cbdc6 100644 --- a/jni/filters/fx.c +++ b/jni/filters/fx.c @@ -29,7 +29,9 @@ __inline__ int interp(unsigned char *src, int p , int *off ,float dr,float dg, return (int)frbg ; } -void JNIFUNCF(ImageFilterFx, nativeApplyFilter, jobject bitmap, jint width, jint height, jobject lutbitmap,jint lutwidth, jint lutheight ) +void JNIFUNCF(ImageFilterFx, nativeApplyFilter, jobject bitmap, jint width, jint height, + jobject lutbitmap, jint lutwidth, jint lutheight, + jint start, jint end) { char* destination = 0; char* lut = 0; @@ -58,9 +60,7 @@ void JNIFUNCF(ImageFilterFx, nativeApplyFilter, jobject bitmap, jint width, jint float scale_B = (lutdim_b-1.f)/256.f; int i; - int len = width * height * STEP; - - for (i = 0; i < len; i+=STEP) + for (i = start; i < end; i+= STEP) { int r = rgb[RED]; int g = rgb[GREEN]; -- cgit v1.2.3