summaryrefslogtreecommitdiffstats
path: root/rs/jni
diff options
context:
space:
mode:
authorJason Sams <jsams@google.com>2015-02-06 17:45:15 -0800
committerJason Sams <jsams@google.com>2015-02-06 17:45:15 -0800
commit46ba27e3fdcf1ce3b940e8b2ec90fcd2c9b7fe43 (patch)
tree9672f7c3f4df7641cfa6eee1ff0898a4bcd95c0e /rs/jni
parent1269ff961000c726247d510762e42b21562b8c2b (diff)
downloadframeworks_base-46ba27e3fdcf1ce3b940e8b2ec90fcd2c9b7fe43.zip
frameworks_base-46ba27e3fdcf1ce3b940e8b2ec90fcd2c9b7fe43.tar.gz
frameworks_base-46ba27e3fdcf1ce3b940e8b2ec90fcd2c9b7fe43.tar.bz2
Implement array types
Change-Id: I1b83f21ea2aeaa4b9f5934aadcb69d4a1c1fea20
Diffstat (limited to 'rs/jni')
-rw-r--r--rs/jni/android_renderscript_RenderScript.cpp34
1 files changed, 34 insertions, 0 deletions
diff --git a/rs/jni/android_renderscript_RenderScript.cpp b/rs/jni/android_renderscript_RenderScript.cpp
index 7387af0..3c16432 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 },