diff options
author | Alex Sakhartchouk <alexst@google.com> | 2011-10-18 11:08:31 -0700 |
---|---|---|
committer | Alex Sakhartchouk <alexst@google.com> | 2011-10-18 11:08:31 -0700 |
commit | 7d5f5e7c8943e043a422ad51c85d4e1684c37e28 (patch) | |
tree | eee61debd73ac054eb1e95259e6e8e16c426df5a /graphics/jni | |
parent | a744ead977b2beda89091abf295bcda860bf88b2 (diff) | |
download | frameworks_base-7d5f5e7c8943e043a422ad51c85d4e1684c37e28.zip frameworks_base-7d5f5e7c8943e043a422ad51c85d4e1684c37e28.tar.gz frameworks_base-7d5f5e7c8943e043a422ad51c85d4e1684c37e28.tar.bz2 |
adding getters to Sampler ProgramRaster, ProgramStore, Element.
Element adds ability to get subelement info. Tests for new stuff.
Change-Id: I4a77b91e4e0e73c95ab28b42c50732a64e71e7b9
Diffstat (limited to 'graphics/jni')
-rw-r--r-- | graphics/jni/android_renderscript_RenderScript.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/graphics/jni/android_renderscript_RenderScript.cpp b/graphics/jni/android_renderscript_RenderScript.cpp index ec1f8de..af03ee2 100644 --- a/graphics/jni/android_renderscript_RenderScript.cpp +++ b/graphics/jni/android_renderscript_RenderScript.cpp @@ -371,23 +371,29 @@ nElementGetNativeData(JNIEnv *_env, jobject _this, RsContext con, jint id, jintA static void -nElementGetSubElements(JNIEnv *_env, jobject _this, RsContext con, jint id, jintArray _IDs, jobjectArray _names) +nElementGetSubElements(JNIEnv *_env, jobject _this, RsContext con, jint id, + jintArray _IDs, + jobjectArray _names, + jintArray _arraySizes) { int dataSize = _env->GetArrayLength(_IDs); LOG_API("nElementGetSubElements, con(%p)", con); uint32_t *ids = (uint32_t *)malloc((uint32_t)dataSize * sizeof(uint32_t)); const char **names = (const char **)malloc((uint32_t)dataSize * sizeof(const char *)); + uint32_t *arraySizes = (uint32_t *)malloc((uint32_t)dataSize * sizeof(uint32_t)); - rsaElementGetSubElements(con, (RsElement)id, ids, names, (uint32_t)dataSize); + rsaElementGetSubElements(con, (RsElement)id, ids, names, arraySizes, (uint32_t)dataSize); for(jint i = 0; i < dataSize; i++) { _env->SetObjectArrayElement(_names, i, _env->NewStringUTF(names[i])); _env->SetIntArrayRegion(_IDs, i, 1, (const jint*)&ids[i]); + _env->SetIntArrayRegion(_arraySizes, i, 1, (const jint*)&arraySizes[i]); } free(ids); free(names); + free(arraySizes); } // ----------------------------------- @@ -1239,7 +1245,7 @@ static JNINativeMethod methods[] = { {"rsnElementCreate", "(IIIZI)I", (void*)nElementCreate }, {"rsnElementCreate2", "(I[I[Ljava/lang/String;[I)I", (void*)nElementCreate2 }, {"rsnElementGetNativeData", "(II[I)V", (void*)nElementGetNativeData }, -{"rsnElementGetSubElements", "(II[I[Ljava/lang/String;)V", (void*)nElementGetSubElements }, +{"rsnElementGetSubElements", "(II[I[Ljava/lang/String;[I)V", (void*)nElementGetSubElements }, {"rsnTypeCreate", "(IIIIIZZ)I", (void*)nTypeCreate }, {"rsnTypeGetNativeData", "(II[I)V", (void*)nTypeGetNativeData }, |