diff options
author | Alex Sakhartchouk <alexst@google.com> | 2010-07-01 16:14:06 -0700 |
---|---|---|
committer | Alex Sakhartchouk <alexst@google.com> | 2010-07-01 16:14:12 -0700 |
commit | 164aaedf7f24827c3da84acc733325ae985930d6 (patch) | |
tree | 20e8d0a291b527ce31dc91dd3a32e32ab69a5ad8 /graphics/jni | |
parent | 738639ccd0f12b06d17df3d3b3ee68f506311331 (diff) | |
download | frameworks_base-164aaedf7f24827c3da84acc733325ae985930d6.zip frameworks_base-164aaedf7f24827c3da84acc733325ae985930d6.tar.gz frameworks_base-164aaedf7f24827c3da84acc733325ae985930d6.tar.bz2 |
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.
Change-Id: Idb9c03d0b06b4ef87db28dffcffa1881d39120e5
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) |