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
diff --git a/graphics/java/android/renderscript/Mesh.java b/graphics/java/android/renderscript/Mesh.java
index bca4aa3..9ce3fb2 100644
--- a/graphics/java/android/renderscript/Mesh.java
+++ b/graphics/java/android/renderscript/Mesh.java
@@ -91,7 +91,7 @@
Allocation[] mIndexBuffers;
Primitive[] mPrimitives;
- Mesh(int id, RenderScript rs) {
+ Mesh(long id, RenderScript rs) {
super(id, rs);
}
@@ -367,7 +367,7 @@
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 @@
} 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 @@
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;