diff options
author | Jason Sams <rjsams@android.com> | 2009-12-15 13:27:04 -0800 |
---|---|---|
committer | Jason Sams <rjsams@android.com> | 2009-12-15 13:27:04 -0800 |
commit | 7e5ab3b177b10fee304d011b3a4b9ee03e2b18b5 (patch) | |
tree | 87e037e70a81ed8d250eff1c20ae8f799c62c7c6 /graphics/jni | |
parent | b686ec70445226d3f865b6e838b3f2cdf034ca31 (diff) | |
download | frameworks_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.cpp | 19 |
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 }, |