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/ScriptGroup.java b/graphics/java/android/renderscript/ScriptGroup.java
index 1416641..48dba30 100644
--- a/graphics/java/android/renderscript/ScriptGroup.java
+++ b/graphics/java/android/renderscript/ScriptGroup.java
@@ -89,7 +89,7 @@
}
- ScriptGroup(int id, RenderScript rs) {
+ ScriptGroup(long id, RenderScript rs) {
super(id, rs);
}
@@ -380,6 +380,7 @@
* @return ScriptGroup The new ScriptGroup
*/
public ScriptGroup create() {
+ // FIXME: this is broken for 64-bit
if (mNodes.size() == 0) {
throw new RSInvalidStateException("Empty script groups are not allowed");
@@ -400,7 +401,7 @@
Node n = mNodes.get(ct);
for (int ct2=0; ct2 < n.mKernels.size(); ct2++) {
final Script.KernelID kid = n.mKernels.get(ct2);
- kernels[idx++] = kid.getID(mRS);
+ kernels[idx++] = (int)kid.getID(mRS);
boolean hasInput = false;
boolean hasOutput = false;
@@ -434,17 +435,17 @@
for (int ct=0; ct < mLines.size(); ct++) {
ConnectLine cl = mLines.get(ct);
- src[ct] = cl.mFrom.getID(mRS);
+ src[ct] = (int)cl.mFrom.getID(mRS);
if (cl.mToK != null) {
- dstk[ct] = cl.mToK.getID(mRS);
+ dstk[ct] = (int)cl.mToK.getID(mRS);
}
if (cl.mToF != null) {
- dstf[ct] = cl.mToF.getID(mRS);
+ dstf[ct] = (int)cl.mToF.getID(mRS);
}
- types[ct] = cl.mAllocationType.getID(mRS);
+ types[ct] = (int)cl.mAllocationType.getID(mRS);
}
- int id = mRS.nScriptGroupCreate(kernels, src, dstk, dstf, types);
+ long id = mRS.nScriptGroupCreate(kernels, src, dstk, dstf, types);
if (id == 0) {
throw new RSRuntimeException("Object creation error, should not happen.");
}