summaryrefslogtreecommitdiffstats
path: root/jni
diff options
context:
space:
mode:
authornicolasroard <nicolasroard@google.com>2013-07-02 20:21:31 (GMT)
committernicolasroard <nicolasroard@google.com>2013-07-02 20:22:38 (GMT)
commita337253c886df37f37341c4cd7b708bfcdee4a9d (patch)
tree42cf5aecb7d91e6f93565d4f038881f2fd5b90f3 /jni
parent3cd424299cf350f071df0cb5dbdc7107a745695c (diff)
downloadandroid_packages_apps_Snap-a337253c886df37f37341c4cd7b708bfcdee4a9d.zip
android_packages_apps_Snap-a337253c886df37f37341c4cd7b708bfcdee4a9d.tar.gz
android_packages_apps_Snap-a337253c886df37f37341c4cd7b708bfcdee4a9d.tar.bz2
Add stop check in ImageFilterFX
speed up switching / interrupting of rendering. Change-Id: I3ef4b1d16047b00a062c86d72cdfff2bfe9817a2
Diffstat (limited to 'jni')
-rw-r--r--jni/filters/fx.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/jni/filters/fx.c b/jni/filters/fx.c
index 24fa5e0..c3c9cbd 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];