diff options
author | Jason Sams <jsams@google.com> | 2015-02-09 22:58:13 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2015-02-09 22:58:13 +0000 |
commit | 2a3cdf57a47140dfa17114338f83e0bb90054ed1 (patch) | |
tree | bcf8ab39d01b1764ed5813a04570cd6e31a16e87 /rs/jni | |
parent | 37e5a941edb0ac5db6a4a4690827fa113c5443b1 (diff) | |
parent | 46ba27e3fdcf1ce3b940e8b2ec90fcd2c9b7fe43 (diff) | |
download | frameworks_base-2a3cdf57a47140dfa17114338f83e0bb90054ed1.zip frameworks_base-2a3cdf57a47140dfa17114338f83e0bb90054ed1.tar.gz frameworks_base-2a3cdf57a47140dfa17114338f83e0bb90054ed1.tar.bz2 |
Merge "Implement array types"
Diffstat (limited to 'rs/jni')
-rw-r--r-- | rs/jni/android_renderscript_RenderScript.cpp | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/rs/jni/android_renderscript_RenderScript.cpp b/rs/jni/android_renderscript_RenderScript.cpp index b25dd41..198cabe 100644 --- a/rs/jni/android_renderscript_RenderScript.cpp +++ b/rs/jni/android_renderscript_RenderScript.cpp @@ -1047,6 +1047,37 @@ nAllocationResize1D(JNIEnv *_env, jobject _this, jlong con, jlong alloc, jint di rsAllocationResize1D((RsContext)con, (RsAllocation)alloc, dimX); } + +static jlong +nAllocationAdapterCreate(JNIEnv *_env, jobject _this, jlong con, jlong basealloc, jlong type) +{ + if (kLogApi) { + ALOGD("nAllocationAdapterCreate, con(%p), base(%p), type(%p)", + (RsContext)con, (RsAllocation)basealloc, (RsElement)type); + } + return (jlong)(uintptr_t) rsAllocationAdapterCreate((RsContext)con, (RsType)type, + (RsAllocation)basealloc); + +} + +static void +nAllocationAdapterOffset(JNIEnv *_env, jobject _this, jlong con, jlong alloc, + jint x, jint y, jint z, jint face, jint lod, + jint a1, jint a2, jint a3, jint a4) +{ + uint32_t params[] = { + (uint32_t)x, (uint32_t)y, (uint32_t)z, (uint32_t)face, + (uint32_t)lod, (uint32_t)a1, (uint32_t)a2, (uint32_t)a3, (uint32_t)a4 + }; + if (kLogApi) { + ALOGD("nAllocationAdapterOffset, con(%p), alloc(%p), x(%i), y(%i), z(%i), face(%i), lod(%i), arrays(%i %i %i %i)", + (RsContext)con, (RsAllocation)alloc, x, y, z, face, lod, a1, a2, a3, a4); + } + rsAllocationAdapterOffset((RsContext)con, (RsAllocation)alloc, + params, sizeof(params)); +} + + // ----------------------------------- static jlong @@ -2028,6 +2059,9 @@ static JNINativeMethod methods[] = { {"rsnAllocationResize1D", "(JJI)V", (void*)nAllocationResize1D }, {"rsnAllocationGenerateMipmaps", "(JJ)V", (void*)nAllocationGenerateMipmaps }, +{"rsnAllocationAdapterCreate", "(JJJ)J", (void*)nAllocationAdapterCreate }, +{"rsnAllocationAdapterOffset", "(JJIIIIIIIII)V", (void*)nAllocationAdapterOffset }, + {"rsnScriptBindAllocation", "(JJJI)V", (void*)nScriptBindAllocation }, {"rsnScriptSetTimeZone", "(JJ[B)V", (void*)nScriptSetTimeZone }, {"rsnScriptInvoke", "(JJI)V", (void*)nScriptInvoke }, |