diff options
author | Jason Sams <jsams@google.com> | 2012-04-03 15:36:36 -0700 |
---|---|---|
committer | Jason Sams <jsams@google.com> | 2012-04-03 15:36:36 -0700 |
commit | e07694b24f7d12d72b084b6651356681ebd0efd6 (patch) | |
tree | e5cbb853579a105f5910c1c6640358e0cf69b5d9 /graphics/java/android/renderscript/Mesh.java | |
parent | 991c8733c3b990b88edf5cf223aebe3d1c71b7f0 (diff) |
Validate context when using RS objects.
BUG=6035422
Change-Id: I8586be0085b36767289e1f634111c0ff076cec3c
Diffstat (limited to 'graphics/java/android/renderscript/Mesh.java')
-rw-r--r-- | graphics/java/android/renderscript/Mesh.java | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/graphics/java/android/renderscript/Mesh.java b/graphics/java/android/renderscript/Mesh.java index f641117d6e0f..ffbb41df30de 100644 --- a/graphics/java/android/renderscript/Mesh.java +++ b/graphics/java/android/renderscript/Mesh.java @@ -137,15 +137,15 @@ public class Mesh extends BaseObj { @Override void updateFromNative() { super.updateFromNative(); - int vtxCount = mRS.nMeshGetVertexBufferCount(getID()); - int idxCount = mRS.nMeshGetIndexCount(getID()); + int vtxCount = mRS.nMeshGetVertexBufferCount(getID(mRS)); + int idxCount = mRS.nMeshGetIndexCount(getID(mRS)); int[] vtxIDs = new int[vtxCount]; int[] idxIDs = new int[idxCount]; int[] primitives = new int[idxCount]; - mRS.nMeshGetVertices(getID(), vtxIDs, vtxCount); - mRS.nMeshGetIndices(getID(), idxIDs, primitives, idxCount); + mRS.nMeshGetVertices(getID(mRS), vtxIDs, vtxCount); + mRS.nMeshGetIndices(getID(mRS), idxIDs, primitives, idxCount); mVertexBuffers = new Allocation[vtxCount]; mIndexBuffers = new Allocation[idxCount]; @@ -343,7 +343,7 @@ public class Mesh extends BaseObj { alloc = Allocation.createSized(mRS, entry.e, entry.size, mUsage); } vertexBuffers[ct] = alloc; - vtx[ct] = alloc.getID(); + vtx[ct] = alloc.getID(mRS); } for(int ct = 0; ct < mIndexTypes.size(); ct ++) { @@ -354,7 +354,7 @@ public class Mesh extends BaseObj { } else if(entry.e != null) { alloc = Allocation.createSized(mRS, entry.e, entry.size, mUsage); } - int allocID = (alloc == null) ? 0 : alloc.getID(); + int allocID = (alloc == null) ? 0 : alloc.getID(mRS); indexBuffers[ct] = alloc; primitives[ct] = entry.prim; @@ -483,12 +483,12 @@ public class Mesh extends BaseObj { for(int ct = 0; ct < mVertexTypeCount; ct ++) { Entry entry = mVertexTypes[ct]; vertexBuffers[ct] = entry.a; - vtx[ct] = entry.a.getID(); + vtx[ct] = entry.a.getID(mRS); } for(int ct = 0; ct < mIndexTypes.size(); ct ++) { Entry entry = (Entry)mIndexTypes.elementAt(ct); - int allocID = (entry.a == null) ? 0 : entry.a.getID(); + int allocID = (entry.a == null) ? 0 : entry.a.getID(mRS); indexBuffers[ct] = entry.a; primitives[ct] = entry.prim; |