summaryrefslogtreecommitdiff
path: root/graphics/java/android/renderscript/Mesh.java
diff options
context:
space:
mode:
authorTim Murray <timmurray@google.com>2013-11-19 12:45:54 -0800
committerTim Murray <timmurray@google.com>2013-11-20 10:18:04 -0800
commit460a04971c494fec39ffcb38e873bb8fdd82d113 (patch)
treeb1567d93e44eec510a0c3adcd9bacd6f2542a860 /graphics/java/android/renderscript/Mesh.java
parenteff663f391fa4f119685d5c14489b94661ea126f (diff)
Convert Java/JNI to 64-bit, part 2.
This changes BaseObj to support 64-bit IDs. There are a few caveats: 1. Since it is deprecated, RSG will not support 64-bit. 2. Currently, methods that pass arrays of IDs to the driver are not supported in 64-bit. This will be fixed in a later CL. bug 11332320 Change-Id: If0dbecc8b285e260f767e441e05088b6a1b749a2
Diffstat (limited to 'graphics/java/android/renderscript/Mesh.java')
-rw-r--r--graphics/java/android/renderscript/Mesh.java18
1 files changed, 9 insertions, 9 deletions
diff --git a/graphics/java/android/renderscript/Mesh.java b/graphics/java/android/renderscript/Mesh.java
index bca4aa326143..9ce3fb256f6f 100644
--- a/graphics/java/android/renderscript/Mesh.java
+++ b/graphics/java/android/renderscript/Mesh.java
@@ -91,7 +91,7 @@ public class Mesh extends BaseObj {
Allocation[] mIndexBuffers;
Primitive[] mPrimitives;
- Mesh(int id, RenderScript rs) {
+ Mesh(long id, RenderScript rs) {
super(id, rs);
}
@@ -367,7 +367,7 @@ public class Mesh extends BaseObj {
alloc = Allocation.createSized(mRS, entry.e, entry.size, mUsage);
}
vertexBuffers[ct] = alloc;
- vtx[ct] = alloc.getID(mRS);
+ vtx[ct] = (int)alloc.getID(mRS);
}
for(int ct = 0; ct < mIndexTypes.size(); ct ++) {
@@ -378,15 +378,15 @@ 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(mRS);
+ long allocID = (alloc == null) ? 0 : alloc.getID(mRS);
indexBuffers[ct] = alloc;
primitives[ct] = entry.prim;
- idx[ct] = allocID;
+ idx[ct] = (int)allocID;
prim[ct] = entry.prim.mID;
}
- int id = mRS.nMeshCreate(vtx, idx, prim);
+ long id = mRS.nMeshCreate(vtx, idx, prim);
Mesh newMesh = new Mesh(id, mRS);
newMesh.mVertexBuffers = vertexBuffers;
newMesh.mIndexBuffers = indexBuffers;
@@ -517,20 +517,20 @@ 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(mRS);
+ vtx[ct] = (int)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(mRS);
+ long allocID = (entry.a == null) ? 0 : entry.a.getID(mRS);
indexBuffers[ct] = entry.a;
primitives[ct] = entry.prim;
- idx[ct] = allocID;
+ idx[ct] = (int)allocID;
prim[ct] = entry.prim.mID;
}
- int id = mRS.nMeshCreate(vtx, idx, prim);
+ long id = mRS.nMeshCreate(vtx, idx, prim);
Mesh newMesh = new Mesh(id, mRS);
newMesh.mVertexBuffers = vertexBuffers;
newMesh.mIndexBuffers = indexBuffers;