diff options
author | Jason Sams <rjsams@android.com> | 2010-08-31 13:50:42 -0700 |
---|---|---|
committer | Jason Sams <rjsams@android.com> | 2010-08-31 15:31:11 -0700 |
commit | 49bdaf0293408159df18a1d8540360f9623c40f7 (patch) | |
tree | c9d4d560963c563e98967b327221c5d98505c71f /graphics/jni | |
parent | 522ea25f2be384fd027ce2f644ee647fd8d80634 (diff) | |
download | frameworks_base-49bdaf0293408159df18a1d8540360f9623c40f7.zip frameworks_base-49bdaf0293408159df18a1d8540360f9623c40f7.tar.gz frameworks_base-49bdaf0293408159df18a1d8540360f9623c40f7.tar.bz2 |
SubElementData data upload functions.
Change-Id: I5f8c738b5457ae7f6085fc4cd331cf3d13ad75cf
Diffstat (limited to 'graphics/jni')
-rw-r--r-- | graphics/jni/android_renderscript_RenderScript.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/graphics/jni/android_renderscript_RenderScript.cpp b/graphics/jni/android_renderscript_RenderScript.cpp index 81f08e9..23b71b0 100644 --- a/graphics/jni/android_renderscript_RenderScript.cpp +++ b/graphics/jni/android_renderscript_RenderScript.cpp @@ -649,6 +649,17 @@ nAllocationSubData1D_f(JNIEnv *_env, jobject _this, RsContext con, jint alloc, j } static void +// native void rsnAllocationSubElementData1D(int con, int id, int xoff, int compIdx, byte[] d, int sizeBytes); +nAllocationSubElementData1D(JNIEnv *_env, jobject _this, RsContext con, jint alloc, jint offset, jint compIdx, jbyteArray data, int sizeBytes) +{ + jint len = _env->GetArrayLength(data); + LOG_API("nAllocationSubElementData1D, con(%p), alloc(%p), offset(%i), comp(%i), len(%i), sizeBytes(%i)", con, (RsAllocation)alloc, offset, compIdx, len, sizeBytes); + jbyte *ptr = _env->GetByteArrayElements(data, NULL); + rsAllocation1DSubElementData(con, (RsAllocation)alloc, offset, ptr, compIdx, sizeBytes); + _env->ReleaseByteArrayElements(data, ptr, JNI_ABORT); +} + +static void nAllocationSubData2D_i(JNIEnv *_env, jobject _this, RsContext con, jint alloc, jint xoff, jint yoff, jint w, jint h, jintArray data, int sizeBytes) { jint len = _env->GetArrayLength(data); @@ -1401,6 +1412,7 @@ static JNINativeMethod methods[] = { {"rsnAllocationSubData1D", "(IIII[SI)V", (void*)nAllocationSubData1D_s }, {"rsnAllocationSubData1D", "(IIII[BI)V", (void*)nAllocationSubData1D_b }, {"rsnAllocationSubData1D", "(IIII[FI)V", (void*)nAllocationSubData1D_f }, +{"rsnAllocationSubElementData1D", "(IIII[BI)V", (void*)nAllocationSubElementData1D }, {"rsnAllocationSubData2D", "(IIIIII[II)V", (void*)nAllocationSubData2D_i }, {"rsnAllocationSubData2D", "(IIIIII[FI)V", (void*)nAllocationSubData2D_f }, {"rsnAllocationRead", "(II[I)V", (void*)nAllocationRead_i }, |