summaryrefslogtreecommitdiffstats
path: root/graphics/jni
diff options
context:
space:
mode:
authorJason Sams <rjsams@android.com>2009-09-16 15:04:38 -0700
committerJason Sams <rjsams@android.com>2009-09-16 15:04:38 -0700
commitbe2e84193f709419634de4cc3ba0e67acf6976f3 (patch)
tree5c940265dd0a42ef6072c03ec463a6961a6fb4d3 /graphics/jni
parent91a5d831d6e2311d4129cb6086a67ab66874992c (diff)
downloadframeworks_base-be2e84193f709419634de4cc3ba0e67acf6976f3.zip
frameworks_base-be2e84193f709419634de4cc3ba0e67acf6976f3.tar.gz
frameworks_base-be2e84193f709419634de4cc3ba0e67acf6976f3.tar.bz2
Implement renderscript Invokables.
Diffstat (limited to 'graphics/jni')
-rw-r--r--graphics/jni/android_renderscript_RenderScript.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/graphics/jni/android_renderscript_RenderScript.cpp b/graphics/jni/android_renderscript_RenderScript.cpp
index 90b5958..eae6f24 100644
--- a/graphics/jni/android_renderscript_RenderScript.cpp
+++ b/graphics/jni/android_renderscript_RenderScript.cpp
@@ -891,6 +891,29 @@ nScriptSetType(JNIEnv *_env, jobject _this, jint type, jboolean writable, jstrin
}
static void
+nScriptSetInvoke(JNIEnv *_env, jobject _this, jstring _str, jint slot)
+{
+ RsContext con = (RsContext)(_env->GetIntField(_this, gContextId));
+ LOG_API("nScriptSetInvoke, con(%p)", con);
+ const char* n = NULL;
+ if (_str) {
+ n = _env->GetStringUTFChars(_str, NULL);
+ }
+ rsScriptSetInvoke(con, n, slot);
+ if (n) {
+ _env->ReleaseStringUTFChars(_str, n);
+ }
+}
+
+static void
+nScriptInvoke(JNIEnv *_env, jobject _this, jint obj, jint slot)
+{
+ RsContext con = (RsContext)(_env->GetIntField(_this, gContextId));
+ LOG_API("nScriptInvoke, con(%p), script(%p)", con, (void *)obj);
+ rsScriptInvoke(con, (RsScript)obj, slot);
+}
+
+static void
nScriptSetRoot(JNIEnv *_env, jobject _this, jboolean isRoot)
{
RsContext con = (RsContext)(_env->GetIntField(_this, gContextId));
@@ -1366,6 +1389,8 @@ static JNINativeMethod methods[] = {
{"nScriptSetTimeZone", "(I[B)V", (void*)nScriptSetTimeZone },
{"nScriptSetType", "(IZLjava/lang/String;I)V", (void*)nScriptSetType },
{"nScriptSetRoot", "(Z)V", (void*)nScriptSetRoot },
+{"nScriptSetInvokable", "(Ljava/lang/String;I)V", (void*)nScriptSetInvoke },
+{"nScriptInvoke", "(II)V", (void*)nScriptInvoke },
{"nScriptCBegin", "()V", (void*)nScriptCBegin },
{"nScriptCSetScript", "([BII)V", (void*)nScriptCSetScript },