summaryrefslogtreecommitdiffstats
path: root/graphics/jni
diff options
context:
space:
mode:
authorJason Sams <rjsams@android.com>2009-12-15 13:27:04 -0800
committerJason Sams <rjsams@android.com>2009-12-15 13:27:04 -0800
commit7e5ab3b177b10fee304d011b3a4b9ee03e2b18b5 (patch)
tree87e037e70a81ed8d250eff1c20ae8f799c62c7c6 /graphics/jni
parentb686ec70445226d3f865b6e838b3f2cdf034ca31 (diff)
downloadframeworks_base-7e5ab3b177b10fee304d011b3a4b9ee03e2b18b5.zip
frameworks_base-7e5ab3b177b10fee304d011b3a4b9ee03e2b18b5.tar.gz
frameworks_base-7e5ab3b177b10fee304d011b3a4b9ee03e2b18b5.tar.bz2
Continue es2 shader dev
Conflicts: graphics/java/android/renderscript/Program.java graphics/java/android/renderscript/ProgramVertex.java
Diffstat (limited to 'graphics/jni')
-rw-r--r--graphics/jni/android_renderscript_RenderScript.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/graphics/jni/android_renderscript_RenderScript.cpp b/graphics/jni/android_renderscript_RenderScript.cpp
index 1fa15a8..8bacefc 100644
--- a/graphics/jni/android_renderscript_RenderScript.cpp
+++ b/graphics/jni/android_renderscript_RenderScript.cpp
@@ -1115,6 +1115,24 @@ nProgramFragmentCreate(JNIEnv *_env, jobject _this, jint slot, jboolean enable)
return (jint)rsProgramFragmentCreate(con);
}
+static jint
+nProgramFragmentCreate2(JNIEnv *_env, jobject _this, jstring shader, jintArray params)
+{
+ RsContext con = (RsContext)(_env->GetIntField(_this, gContextId));
+ const char* shaderUTF = _env->GetStringUTFChars(shader, NULL);
+ jint shaderLen = _env->GetStringUTFLength(shader);
+ jint *paramPtr = _env->GetIntArrayElements(params, NULL);
+ jint paramLen = _env->GetArrayLength(params);
+
+ LOG_API("nProgramFragmentCreate2, con(%p), shaderLen(%i), paramLen(%i)", con, shaderLen, paramLen);
+
+ jint ret = (jint)rsProgramFragmentCreate2(con, shaderUTF, shaderLen, (uint32_t *)paramPtr, paramLen);
+ _env->ReleaseStringUTFChars(shader, shaderUTF);
+ _env->ReleaseIntArrayElements(params, paramPtr, JNI_ABORT);
+ return ret;
+}
+
+
// ---------------------------------------------------------------------------
static jint
@@ -1444,6 +1462,7 @@ static JNINativeMethod methods[] = {
{"nProgramFragmentSetSlot", "(IZII)V", (void*)nProgramFragmentSetSlot },
{"nProgramFragmentSetShader", "(Ljava/lang/String;)V", (void*)nProgramFragmentSetShader },
{"nProgramFragmentCreate", "()I", (void*)nProgramFragmentCreate },
+{"nProgramFragmentCreate2", "(Ljava/lang/String;[I)I", (void*)nProgramFragmentCreate2 },
{"nProgramRasterCreate", "(IIZZZ)I", (void*)nProgramRasterCreate },
{"nProgramRasterSetPointSize", "(IF)V", (void*)nProgramRasterSetPointSize },