diff options
| author | Alex Sakhartchouk <alexst@google.com> | 2010-07-01 16:47:40 -0700 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2010-07-01 16:47:40 -0700 |
| commit | 704aba52a8732ac6fffe9551756f86e76864e0a7 (patch) | |
| tree | 20e8d0a291b527ce31dc91dd3a32e32ab69a5ad8 /graphics/jni | |
| parent | e7f49e0d32cf63505837f5f1eea6607686e50842 (diff) | |
| parent | 164aaedf7f24827c3da84acc733325ae985930d6 (diff) | |
| download | frameworks_base-704aba52a8732ac6fffe9551756f86e76864e0a7.zip frameworks_base-704aba52a8732ac6fffe9551756f86e76864e0a7.tar.gz frameworks_base-704aba52a8732ac6fffe9551756f86e76864e0a7.tar.bz2 | |
Merge "Start of mesh API cleanup. Switched all native code to go through Mesh class. Removed SimpleMesh Added java Mesh class Will need to port all existing code to use java Mesh, then remove java SimpleMesh."
Diffstat (limited to 'graphics/jni')
| -rw-r--r-- | graphics/jni/android_renderscript_RenderScript.cpp | 39 |
1 files changed, 35 insertions, 4 deletions
diff --git a/graphics/jni/android_renderscript_RenderScript.cpp b/graphics/jni/android_renderscript_RenderScript.cpp index c61a215..a6d2489 100644 --- a/graphics/jni/android_renderscript_RenderScript.cpp +++ b/graphics/jni/android_renderscript_RenderScript.cpp @@ -1351,6 +1351,33 @@ nLightSetPosition(JNIEnv *_env, jobject _this, jint light, float x, float y, flo // --------------------------------------------------------------------------- static jint +nMeshCreate(JNIEnv *_env, jobject _this, jint vtxCount, jint idxCount) +{ + RsContext con = (RsContext)(_env->GetIntField(_this, gContextId)); + LOG_API("nMeshCreate, con(%p), vtxCount(%i), idxCount(%i)", con, vtxCount, idxCount); + int id = (int)rsMeshCreate(con, vtxCount, idxCount); + return id; +} + +static void +nMeshBindVertex(JNIEnv *_env, jobject _this, jint s, jint alloc, jint slot) +{ + RsContext con = (RsContext)(_env->GetIntField(_this, gContextId)); + LOG_API("nMeshBindVertex, con(%p), Mesh(%p), Alloc(%p), slot(%i)", con, (RsMesh)s, (RsAllocation)alloc, slot); + rsMeshBindVertex(con, (RsMesh)s, (RsAllocation)alloc, slot); +} + +static void +nMeshBindIndex(JNIEnv *_env, jobject _this, jint s, jint alloc, jint primID, jint slot) +{ + RsContext con = (RsContext)(_env->GetIntField(_this, gContextId)); + LOG_API("nMeshBindIndex, con(%p), Mesh(%p), Alloc(%p)", con, (RsMesh)s, (RsAllocation)alloc); + rsMeshBindIndex(con, (RsMesh)s, (RsAllocation)alloc, primID, slot); +} + +// --------------------------------------------------------------------------- + +static jint nSimpleMeshCreate(JNIEnv *_env, jobject _this, jint batchID, jint indexID, jintArray vtxIDs, jint primID) { RsContext con = (RsContext)(_env->GetIntField(_this, gContextId)); @@ -1367,16 +1394,16 @@ static void nSimpleMeshBindVertex(JNIEnv *_env, jobject _this, jint s, jint alloc, jint slot) { RsContext con = (RsContext)(_env->GetIntField(_this, gContextId)); - LOG_API("nSimpleMeshBindVertex, con(%p), SimpleMesh(%p), Alloc(%p), slot(%i)", con, (RsSimpleMesh)s, (RsAllocation)alloc, slot); - rsSimpleMeshBindVertex(con, (RsSimpleMesh)s, (RsAllocation)alloc, slot); + LOG_API("nSimpleMeshBindVertex, con(%p), Mesh(%p), Alloc(%p), slot(%i)", con, (RsMesh)s, (RsAllocation)alloc, slot); + rsSimpleMeshBindVertex(con, (RsMesh)s, (RsAllocation)alloc, slot); } static void nSimpleMeshBindIndex(JNIEnv *_env, jobject _this, jint s, jint alloc) { RsContext con = (RsContext)(_env->GetIntField(_this, gContextId)); - LOG_API("nSimpleMeshBindIndex, con(%p), SimpleMesh(%p), Alloc(%p)", con, (RsSimpleMesh)s, (RsAllocation)alloc); - rsSimpleMeshBindIndex(con, (RsSimpleMesh)s, (RsAllocation)alloc); + LOG_API("nSimpleMeshBindIndex, con(%p), Mesh(%p), Alloc(%p)", con, (RsMesh)s, (RsAllocation)alloc); + rsSimpleMeshBindIndex(con, (RsMesh)s, (RsAllocation)alloc); } // --------------------------------------------------------------------------- @@ -1513,6 +1540,10 @@ static JNINativeMethod methods[] = { {"nSimpleMeshBindVertex", "(III)V", (void*)nSimpleMeshBindVertex }, {"nSimpleMeshBindIndex", "(II)V", (void*)nSimpleMeshBindIndex }, +{"nMeshCreate", "(II)I", (void*)nMeshCreate }, +{"nMeshBindVertex", "(III)V", (void*)nMeshBindVertex }, +{"nMeshBindIndex", "(IIII)V", (void*)nMeshBindIndex }, + }; static int registerFuncs(JNIEnv *_env) |
