From 460a04971c494fec39ffcb38e873bb8fdd82d113 Mon Sep 17 00:00:00 2001 From: Tim Murray Date: Tue, 19 Nov 2013 12:45:54 -0800 Subject: 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 --- graphics/java/android/renderscript/ScriptGroup.java | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'graphics/java/android/renderscript/ScriptGroup.java') diff --git a/graphics/java/android/renderscript/ScriptGroup.java b/graphics/java/android/renderscript/ScriptGroup.java index 14166410e275..48dba308af2f 100644 --- a/graphics/java/android/renderscript/ScriptGroup.java +++ b/graphics/java/android/renderscript/ScriptGroup.java @@ -89,7 +89,7 @@ public final class ScriptGroup extends BaseObj { } - ScriptGroup(int id, RenderScript rs) { + ScriptGroup(long id, RenderScript rs) { super(id, rs); } @@ -380,6 +380,7 @@ public final class ScriptGroup extends BaseObj { * @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 @@ public final class ScriptGroup extends BaseObj { 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 @@ public final class ScriptGroup extends BaseObj { 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."); } -- cgit v1.2.3