diff options
author | Jason Sams <jsams@google.com> | 2012-07-26 16:56:01 -0700 |
---|---|---|
committer | Jason Sams <jsams@google.com> | 2012-07-27 14:33:50 -0700 |
commit | 3655e44d8b291128e79a7a9b5277b6da217144fc (patch) | |
tree | ca49f70761b9d5c7666453bf9c0132befbdf46d7 /graphics/jni | |
parent | 0590c1b64f8d73da3ccb582d5a865d4918b40733 (diff) | |
download | frameworks_base-3655e44d8b291128e79a7a9b5277b6da217144fc.zip frameworks_base-3655e44d8b291128e79a7a9b5277b6da217144fc.tar.gz frameworks_base-3655e44d8b291128e79a7a9b5277b6da217144fc.tar.bz2 |
Fix readback lengths
Change-Id: I4c5f29af03ed3babceef741aa3a982244cfc65d1
Diffstat (limited to 'graphics/jni')
-rw-r--r-- | graphics/jni/android_renderscript_RenderScript.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/graphics/jni/android_renderscript_RenderScript.cpp b/graphics/jni/android_renderscript_RenderScript.cpp index 8c8ff4d..09f6952 100644 --- a/graphics/jni/android_renderscript_RenderScript.cpp +++ b/graphics/jni/android_renderscript_RenderScript.cpp @@ -718,7 +718,7 @@ nAllocationRead_i(JNIEnv *_env, jobject _this, RsContext con, jint alloc, jintAr LOG_API("nAllocationRead_i, con(%p), alloc(%p), len(%i)", con, (RsAllocation)alloc, len); jint *ptr = _env->GetIntArrayElements(data, NULL); jsize length = _env->GetArrayLength(data); - rsAllocationRead(con, (RsAllocation)alloc, ptr, length); + rsAllocationRead(con, (RsAllocation)alloc, ptr, length * sizeof(int)); _env->ReleaseIntArrayElements(data, ptr, 0); } @@ -729,7 +729,7 @@ nAllocationRead_s(JNIEnv *_env, jobject _this, RsContext con, jint alloc, jshort LOG_API("nAllocationRead_i, con(%p), alloc(%p), len(%i)", con, (RsAllocation)alloc, len); jshort *ptr = _env->GetShortArrayElements(data, NULL); jsize length = _env->GetArrayLength(data); - rsAllocationRead(con, (RsAllocation)alloc, ptr, length); + rsAllocationRead(con, (RsAllocation)alloc, ptr, length * sizeof(short)); _env->ReleaseShortArrayElements(data, ptr, 0); } @@ -740,7 +740,7 @@ nAllocationRead_b(JNIEnv *_env, jobject _this, RsContext con, jint alloc, jbyteA LOG_API("nAllocationRead_i, con(%p), alloc(%p), len(%i)", con, (RsAllocation)alloc, len); jbyte *ptr = _env->GetByteArrayElements(data, NULL); jsize length = _env->GetArrayLength(data); - rsAllocationRead(con, (RsAllocation)alloc, ptr, length); + rsAllocationRead(con, (RsAllocation)alloc, ptr, length * sizeof(char)); _env->ReleaseByteArrayElements(data, ptr, 0); } @@ -751,7 +751,7 @@ nAllocationRead_f(JNIEnv *_env, jobject _this, RsContext con, jint alloc, jfloat LOG_API("nAllocationRead_f, con(%p), alloc(%p), len(%i)", con, (RsAllocation)alloc, len); jfloat *ptr = _env->GetFloatArrayElements(data, NULL); jsize length = _env->GetArrayLength(data); - rsAllocationRead(con, (RsAllocation)alloc, ptr, length); + rsAllocationRead(con, (RsAllocation)alloc, ptr, length * sizeof(float)); _env->ReleaseFloatArrayElements(data, ptr, 0); } |