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/Allocation.java | 30 +- .../android/renderscript/AllocationAdapter.java | 4 +- graphics/java/android/renderscript/BaseObj.java | 10 +- graphics/java/android/renderscript/Element.java | 19 +- .../java/android/renderscript/FieldPacker.java | 3 +- graphics/java/android/renderscript/FileA3D.java | 12 +- graphics/java/android/renderscript/Mesh.java | 18 +- graphics/java/android/renderscript/Path.java | 4 +- graphics/java/android/renderscript/Program.java | 8 +- .../java/android/renderscript/ProgramFragment.java | 12 +- .../renderscript/ProgramFragmentFixedFunction.java | 12 +- .../java/android/renderscript/ProgramRaster.java | 4 +- .../java/android/renderscript/ProgramVertex.java | 12 +- .../renderscript/ProgramVertexFixedFunction.java | 12 +- .../java/android/renderscript/RenderScript.java | 331 +++++++++--------- .../java/android/renderscript/RenderScriptGL.java | 10 +- graphics/java/android/renderscript/Script.java | 18 +- .../java/android/renderscript/ScriptGroup.java | 15 +- .../java/android/renderscript/ScriptIntrinsic.java | 2 +- .../android/renderscript/ScriptIntrinsic3DLUT.java | 4 +- .../android/renderscript/ScriptIntrinsicBlend.java | 4 +- .../android/renderscript/ScriptIntrinsicBlur.java | 4 +- .../renderscript/ScriptIntrinsicColorMatrix.java | 4 +- .../renderscript/ScriptIntrinsicConvolve3x3.java | 4 +- .../renderscript/ScriptIntrinsicConvolve5x5.java | 4 +- .../renderscript/ScriptIntrinsicHistogram.java | 4 +- .../android/renderscript/ScriptIntrinsicLUT.java | 4 +- .../renderscript/ScriptIntrinsicYuvToRGB.java | 4 +- graphics/java/android/renderscript/Type.java | 14 +- graphics/jni/android_renderscript_RenderScript.cpp | 388 ++++++++++----------- 30 files changed, 490 insertions(+), 484 deletions(-) (limited to 'graphics') diff --git a/graphics/java/android/renderscript/Allocation.java b/graphics/java/android/renderscript/Allocation.java index 8e69f56..98fabce 100644 --- a/graphics/java/android/renderscript/Allocation.java +++ b/graphics/java/android/renderscript/Allocation.java @@ -77,8 +77,8 @@ public class Allocation extends BaseObj { int mCurrentDimY; int mCurrentDimZ; int mCurrentCount; - static HashMap mAllocationMap = - new HashMap(); + static HashMap mAllocationMap = + new HashMap(); OnBufferAvailableListener mBufferNotifier; /** @@ -187,7 +187,7 @@ public class Allocation extends BaseObj { } - private int getIDSafe() { + private long getIDSafe() { if (mAdaptedAllocation != null) { return mAdaptedAllocation.getID(mRS); } @@ -243,7 +243,7 @@ public class Allocation extends BaseObj { mBitmap = b; } - Allocation(int id, RenderScript rs, Type t, int usage) { + Allocation(long id, RenderScript rs, Type t, int usage) { super(id, rs); if ((usage & ~(USAGE_SCRIPT | USAGE_GRAPHICS_TEXTURE | @@ -344,7 +344,7 @@ public class Allocation extends BaseObj { @Override void updateFromNative() { super.updateFromNative(); - int typeID = mRS.nAllocationGetType(getID(mRS)); + long typeID = mRS.nAllocationGetType(getID(mRS)); if(typeID != 0) { mType = new Type(typeID, mRS); mType.updateFromNative(); @@ -439,9 +439,11 @@ public class Allocation extends BaseObj { throw new RSIllegalArgumentException("Array size mismatch, allocation sizeX = " + mCurrentCount + ", array length = " + d.length); } + // FIXME: requires 64-bit path + int i[] = new int[d.length]; for (int ct=0; ct < d.length; ct++) { - i[ct] = d[ct].getID(mRS); + i[ct] = (int)d[ct].getID(mRS); } copy1DRangeFromUnchecked(0, mCurrentCount, i); Trace.traceEnd(RenderScript.TRACE_TAG); @@ -1333,7 +1335,7 @@ public class Allocation extends BaseObj { mRS.nAllocationResize1D(getID(mRS), dimX); mRS.finish(); // Necessary because resize is fifoed and update is async. - int typeID = mRS.nAllocationGetType(getID(mRS)); + long typeID = mRS.nAllocationGetType(getID(mRS)); mType = new Type(typeID, mRS); mType.updateFromNative(); updateCacheInfo(mType); @@ -1363,7 +1365,7 @@ public class Allocation extends BaseObj { if (type.getID(rs) == 0) { throw new RSInvalidStateException("Bad Type"); } - int id = rs.nAllocationCreateTyped(type.getID(rs), mips.mID, usage, 0); + long id = rs.nAllocationCreateTyped(type.getID(rs), mips.mID, usage, 0); if (id == 0) { throw new RSRuntimeException("Allocation creation failed."); } @@ -1418,7 +1420,7 @@ public class Allocation extends BaseObj { b.setX(count); Type t = b.create(); - int id = rs.nAllocationCreateTyped(t.getID(rs), MipmapControl.MIPMAP_NONE.mID, usage, 0); + long id = rs.nAllocationCreateTyped(t.getID(rs), MipmapControl.MIPMAP_NONE.mID, usage, 0); if (id == 0) { throw new RSRuntimeException("Allocation creation failed."); } @@ -1502,7 +1504,7 @@ public class Allocation extends BaseObj { if (mips == MipmapControl.MIPMAP_NONE && t.getElement().isCompatible(Element.RGBA_8888(rs)) && usage == (USAGE_SHARED | USAGE_SCRIPT | USAGE_GRAPHICS_TEXTURE)) { - int id = rs.nAllocationCreateBitmapBackedAllocation(t.getID(rs), mips.mID, b, usage); + long id = rs.nAllocationCreateBitmapBackedAllocation(t.getID(rs), mips.mID, b, usage); if (id == 0) { throw new RSRuntimeException("Load failed."); } @@ -1514,7 +1516,7 @@ public class Allocation extends BaseObj { } - int id = rs.nAllocationCreateFromBitmap(t.getID(rs), mips.mID, b, usage); + long id = rs.nAllocationCreateFromBitmap(t.getID(rs), mips.mID, b, usage); if (id == 0) { throw new RSRuntimeException("Load failed."); } @@ -1617,7 +1619,7 @@ public class Allocation extends BaseObj { tb.setMipmaps(mips == MipmapControl.MIPMAP_FULL); Type t = tb.create(); - int id = rs.nAllocationCubeCreateFromBitmap(t.getID(rs), mips.mID, b, usage); + long id = rs.nAllocationCubeCreateFromBitmap(t.getID(rs), mips.mID, b, usage); if(id == 0) { throw new RSRuntimeException("Load failed for bitmap " + b + " element " + e); } @@ -1842,14 +1844,14 @@ public class Allocation extends BaseObj { */ public void setOnBufferAvailableListener(OnBufferAvailableListener callback) { synchronized(mAllocationMap) { - mAllocationMap.put(new Integer(getID(mRS)), this); + mAllocationMap.put(new Long(getID(mRS)), this); mBufferNotifier = callback; } } static void sendBufferNotification(int id) { synchronized(mAllocationMap) { - Allocation a = mAllocationMap.get(new Integer(id)); + Allocation a = mAllocationMap.get(new Long(id)); if ((a != null) && (a.mBufferNotifier != null)) { a.mBufferNotifier.onBufferAvailable(a); diff --git a/graphics/java/android/renderscript/AllocationAdapter.java b/graphics/java/android/renderscript/AllocationAdapter.java index a6645bb..b77d087 100644 --- a/graphics/java/android/renderscript/AllocationAdapter.java +++ b/graphics/java/android/renderscript/AllocationAdapter.java @@ -26,12 +26,12 @@ import android.util.TypedValue; * **/ public class AllocationAdapter extends Allocation { - AllocationAdapter(int id, RenderScript rs, Allocation alloc) { + AllocationAdapter(long id, RenderScript rs, Allocation alloc) { super(id, rs, alloc.mType, alloc.mUsage); mAdaptedAllocation = alloc; } - int getID(RenderScript rs) { + long getID(RenderScript rs) { throw new RSInvalidStateException( "This operation is not supported with adapters at this time."); } diff --git a/graphics/java/android/renderscript/BaseObj.java b/graphics/java/android/renderscript/BaseObj.java index e17d79a..41159b9 100644 --- a/graphics/java/android/renderscript/BaseObj.java +++ b/graphics/java/android/renderscript/BaseObj.java @@ -25,7 +25,7 @@ import android.util.Log; * **/ public class BaseObj { - BaseObj(int id, RenderScript rs) { + BaseObj(long id, RenderScript rs) { rs.validate(); mRS = rs; mID = id; @@ -46,9 +46,9 @@ public class BaseObj { * @param rs Context to verify against internal context for * match. * - * @return int + * @return long */ - int getID(RenderScript rs) { + long getID(RenderScript rs) { mRS.validate(); if (mDestroyed) { throw new RSInvalidStateException("using a destroyed object."); @@ -68,7 +68,7 @@ public class BaseObj { } } - private int mID; + private long mID; private boolean mDestroyed; private String mName; RenderScript mRS; @@ -152,7 +152,7 @@ public class BaseObj { */ @Override public int hashCode() { - return mID; + return (int)((mID & 0xfffffff) ^ (mID >> 32)); } /** diff --git a/graphics/java/android/renderscript/Element.java b/graphics/java/android/renderscript/Element.java index 68badfa..2932770 100644 --- a/graphics/java/android/renderscript/Element.java +++ b/graphics/java/android/renderscript/Element.java @@ -759,7 +759,7 @@ public class Element extends BaseObj { return rs.mElement_MATRIX_2X2; } - Element(int id, RenderScript rs, Element[] e, String[] n, int[] as) { + Element(long id, RenderScript rs, Element[] e, String[] n, int[] as) { super(id, rs); mSize = 0; mVectorSize = 1; @@ -776,7 +776,7 @@ public class Element extends BaseObj { updateVisibleSubElements(); } - Element(int id, RenderScript rs, DataType dt, DataKind dk, boolean norm, int size) { + Element(long id, RenderScript rs, DataType dt, DataKind dk, boolean norm, int size) { super(id, rs); if ((dt != DataType.UNSIGNED_5_6_5) && (dt != DataType.UNSIGNED_4_4_4_4) && @@ -795,7 +795,7 @@ public class Element extends BaseObj { mVectorSize = size; } - Element(int id, RenderScript rs) { + Element(long id, RenderScript rs) { super(id, rs); } @@ -803,6 +803,8 @@ public class Element extends BaseObj { void updateFromNative() { super.updateFromNative(); + // FIXME: updateFromNative is broken in JNI for 64-bit + // we will pack mType; mKind; mNormalized; mVectorSize; NumSubElements int[] dataBuffer = new int[5]; mRS.nElementGetNativeData(getID(mRS), dataBuffer); @@ -853,7 +855,7 @@ public class Element extends BaseObj { DataKind dk = DataKind.USER; boolean norm = false; int vecSize = 1; - int id = rs.nElementCreate(dt.mID, dk.mID, norm, vecSize); + long id = rs.nElementCreate(dt.mID, dk.mID, norm, vecSize); return new Element(id, rs, dt, dk, norm, vecSize); } @@ -890,7 +892,7 @@ public class Element extends BaseObj { case BOOLEAN: { DataKind dk = DataKind.USER; boolean norm = false; - int id = rs.nElementCreate(dt.mID, dk.mID, norm, size); + long id = rs.nElementCreate(dt.mID, dk.mID, norm, size); return new Element(id, rs, dt, dk, norm, size); } @@ -961,7 +963,7 @@ public class Element extends BaseObj { } boolean norm = true; - int id = rs.nElementCreate(dt.mID, dk.mID, norm, size); + long id = rs.nElementCreate(dt.mID, dk.mID, norm, size); return new Element(id, rs, dt, dk, norm, size); } @@ -1088,11 +1090,12 @@ public class Element extends BaseObj { java.lang.System.arraycopy(mElementNames, 0, sin, 0, mCount); java.lang.System.arraycopy(mArraySizes, 0, asin, 0, mCount); + // FIXME: broken for 64-bit int[] ids = new int[ein.length]; for (int ct = 0; ct < ein.length; ct++ ) { - ids[ct] = ein[ct].getID(mRS); + ids[ct] = (int)ein[ct].getID(mRS); } - int id = mRS.nElementCreate2(ids, sin, asin); + long id = mRS.nElementCreate2(ids, sin, asin); return new Element(id, mRS, ein, sin, asin); } } diff --git a/graphics/java/android/renderscript/FieldPacker.java b/graphics/java/android/renderscript/FieldPacker.java index fed97d6..cf20e63 100644 --- a/graphics/java/android/renderscript/FieldPacker.java +++ b/graphics/java/android/renderscript/FieldPacker.java @@ -232,7 +232,8 @@ public class FieldPacker { public void addObj(BaseObj obj) { if (obj != null) { - addI32(obj.getID(null)); + // FIXME: this is fine for 32-bit but needs a path for 64-bit + addI32((int)obj.getID(null)); } else { addI32(0); } diff --git a/graphics/java/android/renderscript/FileA3D.java b/graphics/java/android/renderscript/FileA3D.java index e41f02d..cdcaff7 100644 --- a/graphics/java/android/renderscript/FileA3D.java +++ b/graphics/java/android/renderscript/FileA3D.java @@ -80,7 +80,7 @@ public class FileA3D extends BaseObj { public static class IndexEntry { RenderScript mRS; int mIndex; - int mID; + long mID; String mName; EntryType mEntryType; BaseObj mLoadedObj; @@ -156,7 +156,7 @@ public class FileA3D extends BaseObj { return entry.mLoadedObj; } - IndexEntry(RenderScript rs, int index, int id, String name, EntryType type) { + IndexEntry(RenderScript rs, int index, long id, String name, EntryType type) { mRS = rs; mIndex = index; mID = id; @@ -169,7 +169,7 @@ public class FileA3D extends BaseObj { IndexEntry[] mFileEntries; InputStream mInputStream; - FileA3D(int id, RenderScript rs, InputStream stream) { + FileA3D(long id, RenderScript rs, InputStream stream) { super(id, rs); mInputStream = stream; } @@ -232,7 +232,7 @@ public class FileA3D extends BaseObj { */ static public FileA3D createFromAsset(RenderScript rs, AssetManager mgr, String path) { rs.validate(); - int fileId = rs.nFileA3DCreateFromAsset(mgr, path); + long fileId = rs.nFileA3DCreateFromAsset(mgr, path); if(fileId == 0) { throw new RSRuntimeException("Unable to create a3d file from asset " + path); @@ -252,7 +252,7 @@ public class FileA3D extends BaseObj { * @return a3d file containing renderscript objects */ static public FileA3D createFromFile(RenderScript rs, String path) { - int fileId = rs.nFileA3DCreateFromFile(path); + long fileId = rs.nFileA3DCreateFromFile(path); if(fileId == 0) { throw new RSRuntimeException("Unable to create a3d file from " + path); @@ -295,7 +295,7 @@ public class FileA3D extends BaseObj { throw new RSRuntimeException("Unable to open resource " + id); } - int fileId = 0; + long fileId = 0; if (is instanceof AssetManager.AssetInputStream) { int asset = ((AssetManager.AssetInputStream) is).getAssetInt(); fileId = rs.nFileA3DCreateFromAssetStream(asset); 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 @@ 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; diff --git a/graphics/java/android/renderscript/Path.java b/graphics/java/android/renderscript/Path.java index 9c4d41b..5cc67de 100644 --- a/graphics/java/android/renderscript/Path.java +++ b/graphics/java/android/renderscript/Path.java @@ -41,7 +41,7 @@ public class Path extends BaseObj { float mQuality; boolean mCoverageToAlpha; - Path(int id, RenderScript rs, Primitive p, Allocation vtx, Allocation loop, float q) { + Path(long id, RenderScript rs, Primitive p, Allocation vtx, Allocation loop, float q) { super(id, rs); mVertexBuffer = vtx; mLoopBuffer = loop; @@ -67,7 +67,7 @@ public class Path extends BaseObj { public static Path createStaticPath(RenderScript rs, Primitive p, float quality, Allocation vtx) { - int id = rs.nPathCreate(p.mID, false, vtx.getID(rs), 0, quality); + long id = rs.nPathCreate(p.mID, false, vtx.getID(rs), 0, quality); Path newPath = new Path(id, rs, p, null, null, quality); return newPath; } diff --git a/graphics/java/android/renderscript/Program.java b/graphics/java/android/renderscript/Program.java index bc2ca35..3eb9b75 100644 --- a/graphics/java/android/renderscript/Program.java +++ b/graphics/java/android/renderscript/Program.java @@ -74,7 +74,7 @@ public class Program extends BaseObj { int mTextureCount; String mShader; - Program(int id, RenderScript rs) { + Program(long id, RenderScript rs) { super(id, rs); } @@ -150,7 +150,7 @@ public class Program extends BaseObj { a.getType().getID(mRS) != mConstants[slot].getID(mRS)) { throw new IllegalArgumentException("Allocation type does not match slot type."); } - int id = a != null ? a.getID(mRS) : 0; + long id = a != null ? a.getID(mRS) : 0; mRS.nProgramBindConstants(getID(mRS), slot, id); } @@ -172,7 +172,7 @@ public class Program extends BaseObj { throw new IllegalArgumentException("Cannot bind cubemap to 2d texture slot"); } - int id = va != null ? va.getID(mRS) : 0; + long id = va != null ? va.getID(mRS) : 0; mRS.nProgramBindTexture(getID(mRS), slot, id); } @@ -192,7 +192,7 @@ public class Program extends BaseObj { throw new IllegalArgumentException("Slot ID out of range."); } - int id = vs != null ? vs.getID(mRS) : 0; + long id = vs != null ? vs.getID(mRS) : 0; mRS.nProgramBindSampler(getID(mRS), slot, id); } diff --git a/graphics/java/android/renderscript/ProgramFragment.java b/graphics/java/android/renderscript/ProgramFragment.java index b9ba3fd..5e886a3 100644 --- a/graphics/java/android/renderscript/ProgramFragment.java +++ b/graphics/java/android/renderscript/ProgramFragment.java @@ -39,7 +39,7 @@ import android.util.Log; * **/ public class ProgramFragment extends Program { - ProgramFragment(int id, RenderScript rs) { + ProgramFragment(long id, RenderScript rs) { super(id, rs); } @@ -71,23 +71,23 @@ public class ProgramFragment extends Program { for (int i=0; i < mInputCount; i++) { tmp[idx++] = ProgramParam.INPUT.mID; - tmp[idx++] = mInputs[i].getID(mRS); + tmp[idx++] = (int)mInputs[i].getID(mRS); } for (int i=0; i < mOutputCount; i++) { tmp[idx++] = ProgramParam.OUTPUT.mID; - tmp[idx++] = mOutputs[i].getID(mRS); + tmp[idx++] = (int)mOutputs[i].getID(mRS); } for (int i=0; i < mConstantCount; i++) { tmp[idx++] = ProgramParam.CONSTANT.mID; - tmp[idx++] = mConstants[i].getID(mRS); + tmp[idx++] = (int)mConstants[i].getID(mRS); } for (int i=0; i < mTextureCount; i++) { tmp[idx++] = ProgramParam.TEXTURE_TYPE.mID; - tmp[idx++] = mTextureTypes[i].mID; + tmp[idx++] = (int)mTextureTypes[i].mID; texNames[i] = mTextureNames[i]; } - int id = mRS.nProgramFragmentCreate(mShader, texNames, tmp); + long id = mRS.nProgramFragmentCreate(mShader, texNames, tmp); ProgramFragment pf = new ProgramFragment(id, mRS); initProgram(pf); return pf; diff --git a/graphics/java/android/renderscript/ProgramFragmentFixedFunction.java b/graphics/java/android/renderscript/ProgramFragmentFixedFunction.java index 8ae1777..22aed0a 100644 --- a/graphics/java/android/renderscript/ProgramFragmentFixedFunction.java +++ b/graphics/java/android/renderscript/ProgramFragmentFixedFunction.java @@ -31,7 +31,7 @@ import android.util.Log; * **/ public class ProgramFragmentFixedFunction extends ProgramFragment { - ProgramFragmentFixedFunction(int id, RenderScript rs) { + ProgramFragmentFixedFunction(long id, RenderScript rs) { super(id, rs); } @@ -58,23 +58,23 @@ public class ProgramFragmentFixedFunction extends ProgramFragment { for (int i=0; i < mInputCount; i++) { tmp[idx++] = ProgramParam.INPUT.mID; - tmp[idx++] = mInputs[i].getID(mRS); + tmp[idx++] = (int)mInputs[i].getID(mRS); } for (int i=0; i < mOutputCount; i++) { tmp[idx++] = ProgramParam.OUTPUT.mID; - tmp[idx++] = mOutputs[i].getID(mRS); + tmp[idx++] = (int)mOutputs[i].getID(mRS); } for (int i=0; i < mConstantCount; i++) { tmp[idx++] = ProgramParam.CONSTANT.mID; - tmp[idx++] = mConstants[i].getID(mRS); + tmp[idx++] = (int)mConstants[i].getID(mRS); } for (int i=0; i < mTextureCount; i++) { tmp[idx++] = ProgramParam.TEXTURE_TYPE.mID; - tmp[idx++] = mTextureTypes[i].mID; + tmp[idx++] = (int)mTextureTypes[i].mID; texNames[i] = mTextureNames[i]; } - int id = mRS.nProgramFragmentCreate(mShader, texNames, tmp); + long id = mRS.nProgramFragmentCreate(mShader, texNames, tmp); ProgramFragmentFixedFunction pf = new ProgramFragmentFixedFunction(id, mRS); initProgram(pf); return pf; diff --git a/graphics/java/android/renderscript/ProgramRaster.java b/graphics/java/android/renderscript/ProgramRaster.java index 216cb4e..e294b05 100644 --- a/graphics/java/android/renderscript/ProgramRaster.java +++ b/graphics/java/android/renderscript/ProgramRaster.java @@ -54,7 +54,7 @@ public class ProgramRaster extends BaseObj { boolean mPointSprite; CullMode mCullMode; - ProgramRaster(int id, RenderScript rs) { + ProgramRaster(long id, RenderScript rs) { super(id, rs); mPointSprite = false; @@ -154,7 +154,7 @@ public class ProgramRaster extends BaseObj { */ public ProgramRaster create() { mRS.validate(); - int id = mRS.nProgramRasterCreate(mPointSprite, mCullMode.mID); + long id = mRS.nProgramRasterCreate(mPointSprite, mCullMode.mID); ProgramRaster programRaster = new ProgramRaster(id, mRS); programRaster.mPointSprite = mPointSprite; programRaster.mCullMode = mCullMode; diff --git a/graphics/java/android/renderscript/ProgramVertex.java b/graphics/java/android/renderscript/ProgramVertex.java index 1c5a191..b6886e1 100644 --- a/graphics/java/android/renderscript/ProgramVertex.java +++ b/graphics/java/android/renderscript/ProgramVertex.java @@ -53,7 +53,7 @@ import android.util.Log; **/ public class ProgramVertex extends Program { - ProgramVertex(int id, RenderScript rs) { + ProgramVertex(long id, RenderScript rs) { super(id, rs); } @@ -132,23 +132,23 @@ public class ProgramVertex extends Program { for (int i=0; i < mInputCount; i++) { tmp[idx++] = ProgramParam.INPUT.mID; - tmp[idx++] = mInputs[i].getID(mRS); + tmp[idx++] = (int)mInputs[i].getID(mRS); } for (int i=0; i < mOutputCount; i++) { tmp[idx++] = ProgramParam.OUTPUT.mID; - tmp[idx++] = mOutputs[i].getID(mRS); + tmp[idx++] = (int)mOutputs[i].getID(mRS); } for (int i=0; i < mConstantCount; i++) { tmp[idx++] = ProgramParam.CONSTANT.mID; - tmp[idx++] = mConstants[i].getID(mRS); + tmp[idx++] = (int)mConstants[i].getID(mRS); } for (int i=0; i < mTextureCount; i++) { tmp[idx++] = ProgramParam.TEXTURE_TYPE.mID; - tmp[idx++] = mTextureTypes[i].mID; + tmp[idx++] = (int)mTextureTypes[i].mID; texNames[i] = mTextureNames[i]; } - int id = mRS.nProgramVertexCreate(mShader, texNames, tmp); + long id = mRS.nProgramVertexCreate(mShader, texNames, tmp); ProgramVertex pv = new ProgramVertex(id, mRS); initProgram(pv); return pv; diff --git a/graphics/java/android/renderscript/ProgramVertexFixedFunction.java b/graphics/java/android/renderscript/ProgramVertexFixedFunction.java index ad486f3..c479c77 100644 --- a/graphics/java/android/renderscript/ProgramVertexFixedFunction.java +++ b/graphics/java/android/renderscript/ProgramVertexFixedFunction.java @@ -31,7 +31,7 @@ import android.util.Log; **/ public class ProgramVertexFixedFunction extends ProgramVertex { - ProgramVertexFixedFunction(int id, RenderScript rs) { + ProgramVertexFixedFunction(long id, RenderScript rs) { super(id, rs); } @@ -85,23 +85,23 @@ public class ProgramVertexFixedFunction extends ProgramVertex { for (int i=0; i < mInputCount; i++) { tmp[idx++] = ProgramParam.INPUT.mID; - tmp[idx++] = mInputs[i].getID(mRS); + tmp[idx++] = (int)mInputs[i].getID(mRS); } for (int i=0; i < mOutputCount; i++) { tmp[idx++] = ProgramParam.OUTPUT.mID; - tmp[idx++] = mOutputs[i].getID(mRS); + tmp[idx++] = (int)mOutputs[i].getID(mRS); } for (int i=0; i < mConstantCount; i++) { tmp[idx++] = ProgramParam.CONSTANT.mID; - tmp[idx++] = mConstants[i].getID(mRS); + tmp[idx++] = (int)mConstants[i].getID(mRS); } for (int i=0; i < mTextureCount; i++) { tmp[idx++] = ProgramParam.TEXTURE_TYPE.mID; - tmp[idx++] = mTextureTypes[i].mID; + tmp[idx++] = (int)mTextureTypes[i].mID; texNames[i] = mTextureNames[i]; } - int id = mRS.nProgramVertexCreate(mShader, texNames, tmp); + long id = mRS.nProgramVertexCreate(mShader, texNames, tmp); ProgramVertexFixedFunction pv = new ProgramVertexFixedFunction(id, mRS); initProgram(pv); return pv; diff --git a/graphics/java/android/renderscript/RenderScript.java b/graphics/java/android/renderscript/RenderScript.java index 320192a..147ac15 100644 --- a/graphics/java/android/renderscript/RenderScript.java +++ b/graphics/java/android/renderscript/RenderScript.java @@ -253,18 +253,18 @@ public class RenderScript { rsnContextResume(mContext); } - native void rsnAssignName(long con, int obj, byte[] name); - synchronized void nAssignName(int obj, byte[] name) { + native void rsnAssignName(long con, long obj, byte[] name); + synchronized void nAssignName(long obj, byte[] name) { validate(); rsnAssignName(mContext, obj, name); } - native String rsnGetName(long con, int obj); - synchronized String nGetName(int obj) { + native String rsnGetName(long con, long obj); + synchronized String nGetName(long obj) { validate(); return rsnGetName(mContext, obj); } - native void rsnObjDestroy(long con, int id); - synchronized void nObjDestroy(int id) { + native void rsnObjDestroy(long con, long id); + synchronized void nObjDestroy(long id) { // There is a race condition here. The calling code may be run // by the gc while teardown is occuring. This protects againts // deleting dead objects. @@ -273,141 +273,140 @@ public class RenderScript { } } - native int rsnElementCreate(long con, int type, int kind, boolean norm, int vecSize); - synchronized int nElementCreate(int type, int kind, boolean norm, int vecSize) { + native long rsnElementCreate(long con, long type, int kind, boolean norm, int vecSize); + synchronized long nElementCreate(long type, int kind, boolean norm, int vecSize) { validate(); return rsnElementCreate(mContext, type, kind, norm, vecSize); } - native int rsnElementCreate2(long con, int[] elements, String[] names, int[] arraySizes); - synchronized int nElementCreate2(int[] elements, String[] names, int[] arraySizes) { + native long rsnElementCreate2(long con, int[]elements, String[] names, int[] arraySizes); + synchronized long nElementCreate2(int[] elements, String[] names, int[] arraySizes) { validate(); return rsnElementCreate2(mContext, elements, names, arraySizes); } - native void rsnElementGetNativeData(long con, int id, int[] elementData); - synchronized void nElementGetNativeData(int id, int[] elementData) { + native void rsnElementGetNativeData(long con, long id, int[] elementData); + synchronized void nElementGetNativeData(long id, int[] elementData) { validate(); rsnElementGetNativeData(mContext, id, elementData); } - native void rsnElementGetSubElements(long con, int id, + native void rsnElementGetSubElements(long con, long id, int[] IDs, String[] names, int[] arraySizes); - synchronized void nElementGetSubElements(int id, int[] IDs, String[] names, int[] arraySizes) { + synchronized void nElementGetSubElements(long id, int[] IDs, String[] names, int[] arraySizes) { validate(); rsnElementGetSubElements(mContext, id, IDs, names, arraySizes); } - native int rsnTypeCreate(long con, int eid, int x, int y, int z, boolean mips, boolean faces, int yuv); - synchronized int nTypeCreate(int eid, int x, int y, int z, boolean mips, boolean faces, int yuv) { + native long rsnTypeCreate(long con, long eid, int x, int y, int z, boolean mips, boolean faces, int yuv); + synchronized long nTypeCreate(long eid, int x, int y, int z, boolean mips, boolean faces, int yuv) { validate(); return rsnTypeCreate(mContext, eid, x, y, z, mips, faces, yuv); } - native void rsnTypeGetNativeData(long con, int id, int[] typeData); - synchronized void nTypeGetNativeData(int id, int[] typeData) { + native void rsnTypeGetNativeData(long con, long id, int[] typeData); + synchronized void nTypeGetNativeData(long id, int[] typeData) { validate(); rsnTypeGetNativeData(mContext, id, typeData); } - native int rsnAllocationCreateTyped(long con, int type, int mip, int usage, int pointer); - synchronized int nAllocationCreateTyped(int type, int mip, int usage, int pointer) { + native long rsnAllocationCreateTyped(long con, long type, int mip, int usage, int pointer); + synchronized long nAllocationCreateTyped(long type, int mip, int usage, int pointer) { validate(); return rsnAllocationCreateTyped(mContext, type, mip, usage, pointer); } - native int rsnAllocationCreateFromBitmap(long con, int type, int mip, Bitmap bmp, int usage); - synchronized int nAllocationCreateFromBitmap(int type, int mip, Bitmap bmp, int usage) { + native long rsnAllocationCreateFromBitmap(long con, long type, int mip, Bitmap bmp, int usage); + synchronized long nAllocationCreateFromBitmap(long type, int mip, Bitmap bmp, int usage) { validate(); return rsnAllocationCreateFromBitmap(mContext, type, mip, bmp, usage); } - native int rsnAllocationCreateBitmapBackedAllocation(long con, int type, int mip, Bitmap bmp, int usage); - synchronized int nAllocationCreateBitmapBackedAllocation(int type, int mip, Bitmap bmp, int usage) { + native long rsnAllocationCreateBitmapBackedAllocation(long con, long type, int mip, Bitmap bmp, int usage); + synchronized long nAllocationCreateBitmapBackedAllocation(long type, int mip, Bitmap bmp, int usage) { validate(); return rsnAllocationCreateBitmapBackedAllocation(mContext, type, mip, bmp, usage); } - - native int rsnAllocationCubeCreateFromBitmap(long con, int type, int mip, Bitmap bmp, int usage); - synchronized int nAllocationCubeCreateFromBitmap(int type, int mip, Bitmap bmp, int usage) { + native long rsnAllocationCubeCreateFromBitmap(long con, long type, int mip, Bitmap bmp, int usage); + synchronized long nAllocationCubeCreateFromBitmap(long type, int mip, Bitmap bmp, int usage) { validate(); return rsnAllocationCubeCreateFromBitmap(mContext, type, mip, bmp, usage); } - native int rsnAllocationCreateBitmapRef(long con, int type, Bitmap bmp); - synchronized int nAllocationCreateBitmapRef(int type, Bitmap bmp) { + native long rsnAllocationCreateBitmapRef(long con, long type, Bitmap bmp); + synchronized long nAllocationCreateBitmapRef(long type, Bitmap bmp) { validate(); return rsnAllocationCreateBitmapRef(mContext, type, bmp); } - native int rsnAllocationCreateFromAssetStream(long con, int mips, int assetStream, int usage); - synchronized int nAllocationCreateFromAssetStream(int mips, int assetStream, int usage) { + native long rsnAllocationCreateFromAssetStream(long con, int mips, int assetStream, int usage); + synchronized long nAllocationCreateFromAssetStream(int mips, int assetStream, int usage) { validate(); return rsnAllocationCreateFromAssetStream(mContext, mips, assetStream, usage); } - native void rsnAllocationCopyToBitmap(long con, int alloc, Bitmap bmp); - synchronized void nAllocationCopyToBitmap(int alloc, Bitmap bmp) { + native void rsnAllocationCopyToBitmap(long con, long alloc, Bitmap bmp); + synchronized void nAllocationCopyToBitmap(long alloc, Bitmap bmp) { validate(); rsnAllocationCopyToBitmap(mContext, alloc, bmp); } - native void rsnAllocationSyncAll(long con, int alloc, int src); - synchronized void nAllocationSyncAll(int alloc, int src) { + native void rsnAllocationSyncAll(long con, long alloc, int src); + synchronized void nAllocationSyncAll(long alloc, int src) { validate(); rsnAllocationSyncAll(mContext, alloc, src); } - native Surface rsnAllocationGetSurface(long con, int alloc); - synchronized Surface nAllocationGetSurface(int alloc) { + native Surface rsnAllocationGetSurface(long con, long alloc); + synchronized Surface nAllocationGetSurface(long alloc) { validate(); return rsnAllocationGetSurface(mContext, alloc); } - native void rsnAllocationSetSurface(long con, int alloc, Surface sur); - synchronized void nAllocationSetSurface(int alloc, Surface sur) { + native void rsnAllocationSetSurface(long con, long alloc, Surface sur); + synchronized void nAllocationSetSurface(long alloc, Surface sur) { validate(); rsnAllocationSetSurface(mContext, alloc, sur); } - native void rsnAllocationIoSend(long con, int alloc); - synchronized void nAllocationIoSend(int alloc) { + native void rsnAllocationIoSend(long con, long alloc); + synchronized void nAllocationIoSend(long alloc) { validate(); rsnAllocationIoSend(mContext, alloc); } - native void rsnAllocationIoReceive(long con, int alloc); - synchronized void nAllocationIoReceive(int alloc) { + native void rsnAllocationIoReceive(long con, long alloc); + synchronized void nAllocationIoReceive(long alloc) { validate(); rsnAllocationIoReceive(mContext, alloc); } - native void rsnAllocationGenerateMipmaps(long con, int alloc); - synchronized void nAllocationGenerateMipmaps(int alloc) { + native void rsnAllocationGenerateMipmaps(long con, long alloc); + synchronized void nAllocationGenerateMipmaps(long alloc) { validate(); rsnAllocationGenerateMipmaps(mContext, alloc); } - native void rsnAllocationCopyFromBitmap(long con, int alloc, Bitmap bmp); - synchronized void nAllocationCopyFromBitmap(int alloc, Bitmap bmp) { + native void rsnAllocationCopyFromBitmap(long con, long alloc, Bitmap bmp); + synchronized void nAllocationCopyFromBitmap(long alloc, Bitmap bmp) { validate(); rsnAllocationCopyFromBitmap(mContext, alloc, bmp); } - native void rsnAllocationData1D(long con, int id, int off, int mip, int count, Object d, int sizeBytes, int dt); - synchronized void nAllocationData1D(int id, int off, int mip, int count, Object d, int sizeBytes, Element.DataType dt) { + native void rsnAllocationData1D(long con, long id, int off, int mip, int count, Object d, int sizeBytes, int dt); + synchronized void nAllocationData1D(long id, int off, int mip, int count, Object d, int sizeBytes, Element.DataType dt) { validate(); rsnAllocationData1D(mContext, id, off, mip, count, d, sizeBytes, dt.mID); } - native void rsnAllocationElementData1D(long con, int id, int xoff, int mip, int compIdx, byte[] d, int sizeBytes); - synchronized void nAllocationElementData1D(int id, int xoff, int mip, int compIdx, byte[] d, int sizeBytes) { + native void rsnAllocationElementData1D(long con,long id, int xoff, int mip, int compIdx, byte[] d, int sizeBytes); + synchronized void nAllocationElementData1D(long id, int xoff, int mip, int compIdx, byte[] d, int sizeBytes) { validate(); rsnAllocationElementData1D(mContext, id, xoff, mip, compIdx, d, sizeBytes); } native void rsnAllocationData2D(long con, - int dstAlloc, int dstXoff, int dstYoff, + long dstAlloc, int dstXoff, int dstYoff, int dstMip, int dstFace, int width, int height, - int srcAlloc, int srcXoff, int srcYoff, + long srcAlloc, int srcXoff, int srcYoff, int srcMip, int srcFace); - synchronized void nAllocationData2D(int dstAlloc, int dstXoff, int dstYoff, + synchronized void nAllocationData2D(long dstAlloc, int dstXoff, int dstYoff, int dstMip, int dstFace, int width, int height, - int srcAlloc, int srcXoff, int srcYoff, + long srcAlloc, int srcXoff, int srcYoff, int srcMip, int srcFace) { validate(); rsnAllocationData2D(mContext, @@ -418,30 +417,30 @@ public class RenderScript { srcMip, srcFace); } - native void rsnAllocationData2D(long con, int id, int xoff, int yoff, int mip, int face, + native void rsnAllocationData2D(long con, long id, int xoff, int yoff, int mip, int face, int w, int h, Object d, int sizeBytes, int dt); - synchronized void nAllocationData2D(int id, int xoff, int yoff, int mip, int face, + synchronized void nAllocationData2D(long id, int xoff, int yoff, int mip, int face, int w, int h, Object d, int sizeBytes, Element.DataType dt) { validate(); rsnAllocationData2D(mContext, id, xoff, yoff, mip, face, w, h, d, sizeBytes, dt.mID); } - native void rsnAllocationData2D(long con, int id, int xoff, int yoff, int mip, int face, Bitmap b); - synchronized void nAllocationData2D(int id, int xoff, int yoff, int mip, int face, Bitmap b) { + native void rsnAllocationData2D(long con, long id, int xoff, int yoff, int mip, int face, Bitmap b); + synchronized void nAllocationData2D(long id, int xoff, int yoff, int mip, int face, Bitmap b) { validate(); rsnAllocationData2D(mContext, id, xoff, yoff, mip, face, b); } native void rsnAllocationData3D(long con, - int dstAlloc, int dstXoff, int dstYoff, int dstZoff, + long dstAlloc, int dstXoff, int dstYoff, int dstZoff, int dstMip, int width, int height, int depth, - int srcAlloc, int srcXoff, int srcYoff, int srcZoff, + long srcAlloc, int srcXoff, int srcYoff, int srcZoff, int srcMip); - synchronized void nAllocationData3D(int dstAlloc, int dstXoff, int dstYoff, int dstZoff, + synchronized void nAllocationData3D(long dstAlloc, int dstXoff, int dstYoff, int dstZoff, int dstMip, int width, int height, int depth, - int srcAlloc, int srcXoff, int srcYoff, int srcZoff, + long srcAlloc, int srcXoff, int srcYoff, int srcZoff, int srcMip) { validate(); rsnAllocationData3D(mContext, @@ -450,75 +449,75 @@ public class RenderScript { srcAlloc, srcXoff, srcYoff, srcZoff, srcMip); } - native void rsnAllocationData3D(long con, int id, int xoff, int yoff, int zoff, int mip, + native void rsnAllocationData3D(long con, long id, int xoff, int yoff, int zoff, int mip, int w, int h, int depth, Object d, int sizeBytes, int dt); - synchronized void nAllocationData3D(int id, int xoff, int yoff, int zoff, int mip, + synchronized void nAllocationData3D(long id, int xoff, int yoff, int zoff, int mip, int w, int h, int depth, Object d, int sizeBytes, Element.DataType dt) { validate(); rsnAllocationData3D(mContext, id, xoff, yoff, zoff, mip, w, h, depth, d, sizeBytes, dt.mID); } - native void rsnAllocationRead(long con, int id, Object d, int dt); - synchronized void nAllocationRead(int id, Object d, Element.DataType dt) { + native void rsnAllocationRead(long con, long id, Object d, int dt); + synchronized void nAllocationRead(long id, Object d, Element.DataType dt) { validate(); rsnAllocationRead(mContext, id, d, dt.mID); } - native void rsnAllocationRead1D(long con, int id, int off, int mip, int count, Object d, + native void rsnAllocationRead1D(long con, long id, int off, int mip, int count, Object d, int sizeBytes, int dt); - synchronized void nAllocationRead1D(int id, int off, int mip, int count, Object d, + synchronized void nAllocationRead1D(long id, int off, int mip, int count, Object d, int sizeBytes, Element.DataType dt) { validate(); rsnAllocationRead1D(mContext, id, off, mip, count, d, sizeBytes, dt.mID); } - native void rsnAllocationRead2D(long con, int id, int xoff, int yoff, int mip, int face, + native void rsnAllocationRead2D(long con, long id, int xoff, int yoff, int mip, int face, int w, int h, Object d, int sizeBytes, int dt); - synchronized void nAllocationRead2D(int id, int xoff, int yoff, int mip, int face, + synchronized void nAllocationRead2D(long id, int xoff, int yoff, int mip, int face, int w, int h, Object d, int sizeBytes, Element.DataType dt) { validate(); rsnAllocationRead2D(mContext, id, xoff, yoff, mip, face, w, h, d, sizeBytes, dt.mID); } - native int rsnAllocationGetType(long con, int id); - synchronized int nAllocationGetType(int id) { + native long rsnAllocationGetType(long con, long id); + synchronized long nAllocationGetType(long id) { validate(); return rsnAllocationGetType(mContext, id); } - native void rsnAllocationResize1D(long con, int id, int dimX); - synchronized void nAllocationResize1D(int id, int dimX) { + native void rsnAllocationResize1D(long con, long id, int dimX); + synchronized void nAllocationResize1D(long id, int dimX) { validate(); rsnAllocationResize1D(mContext, id, dimX); } - native int rsnFileA3DCreateFromAssetStream(long con, int assetStream); - synchronized int nFileA3DCreateFromAssetStream(int assetStream) { + native long rsnFileA3DCreateFromAssetStream(long con, int assetStream); + synchronized long nFileA3DCreateFromAssetStream(int assetStream) { validate(); return rsnFileA3DCreateFromAssetStream(mContext, assetStream); } - native int rsnFileA3DCreateFromFile(long con, String path); - synchronized int nFileA3DCreateFromFile(String path) { + native long rsnFileA3DCreateFromFile(long con, String path); + synchronized long nFileA3DCreateFromFile(String path) { validate(); return rsnFileA3DCreateFromFile(mContext, path); } - native int rsnFileA3DCreateFromAsset(long con, AssetManager mgr, String path); - synchronized int nFileA3DCreateFromAsset(AssetManager mgr, String path) { + native long rsnFileA3DCreateFromAsset(long con, AssetManager mgr, String path); + synchronized long nFileA3DCreateFromAsset(AssetManager mgr, String path) { validate(); return rsnFileA3DCreateFromAsset(mContext, mgr, path); } - native int rsnFileA3DGetNumIndexEntries(long con, int fileA3D); - synchronized int nFileA3DGetNumIndexEntries(int fileA3D) { + native int rsnFileA3DGetNumIndexEntries(long con, long fileA3D); + synchronized int nFileA3DGetNumIndexEntries(long fileA3D) { validate(); return rsnFileA3DGetNumIndexEntries(mContext, fileA3D); } - native void rsnFileA3DGetIndexEntries(long con, int fileA3D, int numEntries, int[] IDs, String[] names); - synchronized void nFileA3DGetIndexEntries(int fileA3D, int numEntries, int[] IDs, String[] names) { + native void rsnFileA3DGetIndexEntries(long con, long fileA3D, int numEntries, int[] IDs, String[] names); + synchronized void nFileA3DGetIndexEntries(long fileA3D, int numEntries, int[] IDs, String[] names) { validate(); rsnFileA3DGetIndexEntries(mContext, fileA3D, numEntries, IDs, names); } - native int rsnFileA3DGetEntryByIndex(long con, int fileA3D, int index); - synchronized int nFileA3DGetEntryByIndex(int fileA3D, int index) { + native int rsnFileA3DGetEntryByIndex(long con, long fileA3D, int index); + synchronized int nFileA3DGetEntryByIndex(long fileA3D, int index) { validate(); return rsnFileA3DGetEntryByIndex(mContext, fileA3D, index); } @@ -540,28 +539,28 @@ public class RenderScript { } - native void rsnScriptBindAllocation(long con, int script, int alloc, int slot); - synchronized void nScriptBindAllocation(int script, int alloc, int slot) { + native void rsnScriptBindAllocation(long con, long script, long alloc, int slot); + synchronized void nScriptBindAllocation(long script, long alloc, int slot) { validate(); rsnScriptBindAllocation(mContext, script, alloc, slot); } - native void rsnScriptSetTimeZone(long con, int script, byte[] timeZone); - synchronized void nScriptSetTimeZone(int script, byte[] timeZone) { + native void rsnScriptSetTimeZone(long con, long script, byte[] timeZone); + synchronized void nScriptSetTimeZone(long script, byte[] timeZone) { validate(); rsnScriptSetTimeZone(mContext, script, timeZone); } - native void rsnScriptInvoke(long con, int id, int slot); - synchronized void nScriptInvoke(int id, int slot) { + native void rsnScriptInvoke(long con, long id, int slot); + synchronized void nScriptInvoke(long id, int slot) { validate(); rsnScriptInvoke(mContext, id, slot); } - native void rsnScriptForEach(long con, int id, int slot, int ain, int aout, byte[] params); - native void rsnScriptForEach(long con, int id, int slot, int ain, int aout); - native void rsnScriptForEachClipped(long con, int id, int slot, int ain, int aout, byte[] params, + native void rsnScriptForEach(long con, long id, int slot, long ain, long aout, byte[] params); + native void rsnScriptForEach(long con, long id, int slot, long ain, long aout); + native void rsnScriptForEachClipped(long con, long id, int slot, long ain, long aout, byte[] params, int xstart, int xend, int ystart, int yend, int zstart, int zend); - native void rsnScriptForEachClipped(long con, int id, int slot, int ain, int aout, + native void rsnScriptForEachClipped(long con, long id, int slot, long ain, long aout, int xstart, int xend, int ystart, int yend, int zstart, int zend); - synchronized void nScriptForEach(int id, int slot, int ain, int aout, byte[] params) { + synchronized void nScriptForEach(long id, int slot, long ain, long aout, byte[] params) { validate(); if (params == null) { rsnScriptForEach(mContext, id, slot, ain, aout); @@ -570,7 +569,7 @@ public class RenderScript { } } - synchronized void nScriptForEachClipped(int id, int slot, int ain, int aout, byte[] params, + synchronized void nScriptForEachClipped(long id, int slot, long ain, long aout, byte[] params, int xstart, int xend, int ystart, int yend, int zstart, int zend) { validate(); if (params == null) { @@ -580,73 +579,73 @@ public class RenderScript { } } - native void rsnScriptInvokeV(long con, int id, int slot, byte[] params); - synchronized void nScriptInvokeV(int id, int slot, byte[] params) { + native void rsnScriptInvokeV(long con, long id, int slot, byte[] params); + synchronized void nScriptInvokeV(long id, int slot, byte[] params) { validate(); rsnScriptInvokeV(mContext, id, slot, params); } - native void rsnScriptSetVarI(long con, int id, int slot, int val); - synchronized void nScriptSetVarI(int id, int slot, int val) { + native void rsnScriptSetVarI(long con, long id, int slot, int val); + synchronized void nScriptSetVarI(long id, int slot, int val) { validate(); rsnScriptSetVarI(mContext, id, slot, val); } - native int rsnScriptGetVarI(long con, int id, int slot); - synchronized int nScriptGetVarI(int id, int slot) { + native int rsnScriptGetVarI(long con, long id, int slot); + synchronized int nScriptGetVarI(long id, int slot) { validate(); return rsnScriptGetVarI(mContext, id, slot); } - native void rsnScriptSetVarJ(long con, int id, int slot, long val); - synchronized void nScriptSetVarJ(int id, int slot, long val) { + native void rsnScriptSetVarJ(long con, long id, int slot, long val); + synchronized void nScriptSetVarJ(long id, int slot, long val) { validate(); rsnScriptSetVarJ(mContext, id, slot, val); } - native long rsnScriptGetVarJ(long con, int id, int slot); - synchronized long nScriptGetVarJ(int id, int slot) { + native long rsnScriptGetVarJ(long con, long id, int slot); + synchronized long nScriptGetVarJ(long id, int slot) { validate(); return rsnScriptGetVarJ(mContext, id, slot); } - native void rsnScriptSetVarF(long con, int id, int slot, float val); - synchronized void nScriptSetVarF(int id, int slot, float val) { + native void rsnScriptSetVarF(long con, long id, int slot, float val); + synchronized void nScriptSetVarF(long id, int slot, float val) { validate(); rsnScriptSetVarF(mContext, id, slot, val); } - native float rsnScriptGetVarF(long con, int id, int slot); - synchronized float nScriptGetVarF(int id, int slot) { + native float rsnScriptGetVarF(long con, long id, int slot); + synchronized float nScriptGetVarF(long id, int slot) { validate(); return rsnScriptGetVarF(mContext, id, slot); } - native void rsnScriptSetVarD(long con, int id, int slot, double val); - synchronized void nScriptSetVarD(int id, int slot, double val) { + native void rsnScriptSetVarD(long con, long id, int slot, double val); + synchronized void nScriptSetVarD(long id, int slot, double val) { validate(); rsnScriptSetVarD(mContext, id, slot, val); } - native double rsnScriptGetVarD(long con, int id, int slot); - synchronized double nScriptGetVarD(int id, int slot) { + native double rsnScriptGetVarD(long con, long id, int slot); + synchronized double nScriptGetVarD(long id, int slot) { validate(); return rsnScriptGetVarD(mContext, id, slot); } - native void rsnScriptSetVarV(long con, int id, int slot, byte[] val); - synchronized void nScriptSetVarV(int id, int slot, byte[] val) { + native void rsnScriptSetVarV(long con, long id, int slot, byte[] val); + synchronized void nScriptSetVarV(long id, int slot, byte[] val) { validate(); rsnScriptSetVarV(mContext, id, slot, val); } - native void rsnScriptGetVarV(long con, int id, int slot, byte[] val); - synchronized void nScriptGetVarV(int id, int slot, byte[] val) { + native void rsnScriptGetVarV(long con, long id, int slot, byte[] val); + synchronized void nScriptGetVarV(long id, int slot, byte[] val) { validate(); rsnScriptGetVarV(mContext, id, slot, val); } - native void rsnScriptSetVarVE(long con, int id, int slot, byte[] val, - int e, int[] dims); - synchronized void nScriptSetVarVE(int id, int slot, byte[] val, - int e, int[] dims) { + native void rsnScriptSetVarVE(long con, long id, int slot, byte[] val, + long e, int[] dims); + synchronized void nScriptSetVarVE(long id, int slot, byte[] val, + long e, int[] dims) { validate(); rsnScriptSetVarVE(mContext, id, slot, val, e, dims); } - native void rsnScriptSetVarObj(long con, int id, int slot, int val); - synchronized void nScriptSetVarObj(int id, int slot, int val) { + native void rsnScriptSetVarObj(long con, long id, int slot, long val); + synchronized void nScriptSetVarObj(long id, int slot, long val) { validate(); rsnScriptSetVarObj(mContext, id, slot, val); } @@ -658,44 +657,44 @@ public class RenderScript { return rsnScriptCCreate(mContext, resName, cacheDir, script, length); } - native int rsnScriptIntrinsicCreate(long con, int id, int eid); - synchronized int nScriptIntrinsicCreate(int id, int eid) { + native long rsnScriptIntrinsicCreate(long con, int id, long eid); + synchronized long nScriptIntrinsicCreate(int id, long eid) { validate(); return rsnScriptIntrinsicCreate(mContext, id, eid); } - native int rsnScriptKernelIDCreate(long con, int sid, int slot, int sig); - synchronized int nScriptKernelIDCreate(int sid, int slot, int sig) { + native long rsnScriptKernelIDCreate(long con, long sid, int slot, int sig); + synchronized long nScriptKernelIDCreate(long sid, int slot, int sig) { validate(); return rsnScriptKernelIDCreate(mContext, sid, slot, sig); } - native int rsnScriptFieldIDCreate(long con, int sid, int slot); - synchronized int nScriptFieldIDCreate(int sid, int slot) { + native long rsnScriptFieldIDCreate(long con, long sid, int slot); + synchronized long nScriptFieldIDCreate(long sid, int slot) { validate(); return rsnScriptFieldIDCreate(mContext, sid, slot); } - native int rsnScriptGroupCreate(long con, int[] kernels, int[] src, int[] dstk, int[] dstf, int[] types); - synchronized int nScriptGroupCreate(int[] kernels, int[] src, int[] dstk, int[] dstf, int[] types) { + native long rsnScriptGroupCreate(long con, int[] kernels, int[] src, int[] dstk, int[] dstf, int[] types); + synchronized long nScriptGroupCreate(int[] kernels, int[] src, int[] dstk, int[] dstf, int[] types) { validate(); return rsnScriptGroupCreate(mContext, kernels, src, dstk, dstf, types); } - native void rsnScriptGroupSetInput(long con, int group, int kernel, int alloc); - synchronized void nScriptGroupSetInput(int group, int kernel, int alloc) { + native void rsnScriptGroupSetInput(long con, long group, long kernel, long alloc); + synchronized void nScriptGroupSetInput(long group, long kernel, long alloc) { validate(); rsnScriptGroupSetInput(mContext, group, kernel, alloc); } - native void rsnScriptGroupSetOutput(long con, int group, int kernel, int alloc); - synchronized void nScriptGroupSetOutput(int group, int kernel, int alloc) { + native void rsnScriptGroupSetOutput(long con, long group, long kernel, long alloc); + synchronized void nScriptGroupSetOutput(long group, long kernel, long alloc) { validate(); rsnScriptGroupSetOutput(mContext, group, kernel, alloc); } - native void rsnScriptGroupExecute(long con, int group); - synchronized void nScriptGroupExecute(int group) { + native void rsnScriptGroupExecute(long con, long group); + synchronized void nScriptGroupExecute(long group) { validate(); rsnScriptGroupExecute(mContext, group); } @@ -719,66 +718,66 @@ public class RenderScript { dstMode, depthFunc); } - native int rsnProgramRasterCreate(long con, boolean pointSprite, int cullMode); - synchronized int nProgramRasterCreate(boolean pointSprite, int cullMode) { + native long rsnProgramRasterCreate(long con, boolean pointSprite, int cullMode); + synchronized long nProgramRasterCreate(boolean pointSprite, int cullMode) { validate(); return rsnProgramRasterCreate(mContext, pointSprite, cullMode); } - native void rsnProgramBindConstants(long con, int pv, int slot, int mID); - synchronized void nProgramBindConstants(int pv, int slot, int mID) { + native void rsnProgramBindConstants(long con, long pv, int slot, long mID); + synchronized void nProgramBindConstants(long pv, int slot, long mID) { validate(); rsnProgramBindConstants(mContext, pv, slot, mID); } - native void rsnProgramBindTexture(long con, int vpf, int slot, int a); - synchronized void nProgramBindTexture(int vpf, int slot, int a) { + native void rsnProgramBindTexture(long con, long vpf, int slot, long a); + synchronized void nProgramBindTexture(long vpf, int slot, long a) { validate(); rsnProgramBindTexture(mContext, vpf, slot, a); } - native void rsnProgramBindSampler(long con, int vpf, int slot, int s); - synchronized void nProgramBindSampler(int vpf, int slot, int s) { + native void rsnProgramBindSampler(long con, long vpf, int slot, long s); + synchronized void nProgramBindSampler(long vpf, int slot, long s) { validate(); rsnProgramBindSampler(mContext, vpf, slot, s); } - native int rsnProgramFragmentCreate(long con, String shader, String[] texNames, int[] params); - synchronized int nProgramFragmentCreate(String shader, String[] texNames, int[] params) { + native long rsnProgramFragmentCreate(long con, String shader, String[] texNames, int[] params); + synchronized long nProgramFragmentCreate(String shader, String[] texNames, int[] params) { validate(); return rsnProgramFragmentCreate(mContext, shader, texNames, params); } - native int rsnProgramVertexCreate(long con, String shader, String[] texNames, int[] params); - synchronized int nProgramVertexCreate(String shader, String[] texNames, int[] params) { + native long rsnProgramVertexCreate(long con, String shader, String[] texNames, int[] params); + synchronized long nProgramVertexCreate(String shader, String[] texNames, int[] params) { validate(); return rsnProgramVertexCreate(mContext, shader, texNames, params); } - native int rsnMeshCreate(long con, int[] vtx, int[] idx, int[] prim); - synchronized int nMeshCreate(int[] vtx, int[] idx, int[] prim) { + native long rsnMeshCreate(long con, int[] vtx, int[] idx, int[] prim); + synchronized long nMeshCreate(int[] vtx, int[] idx, int[] prim) { validate(); return rsnMeshCreate(mContext, vtx, idx, prim); } - native int rsnMeshGetVertexBufferCount(long con, int id); - synchronized int nMeshGetVertexBufferCount(int id) { + native int rsnMeshGetVertexBufferCount(long con, long id); + synchronized int nMeshGetVertexBufferCount(long id) { validate(); return rsnMeshGetVertexBufferCount(mContext, id); } - native int rsnMeshGetIndexCount(long con, int id); - synchronized int nMeshGetIndexCount(int id) { + native int rsnMeshGetIndexCount(long con, long id); + synchronized int nMeshGetIndexCount(long id) { validate(); return rsnMeshGetIndexCount(mContext, id); } - native void rsnMeshGetVertices(long con, int id, int[] vtxIds, int vtxIdCount); - synchronized void nMeshGetVertices(int id, int[] vtxIds, int vtxIdCount) { + native void rsnMeshGetVertices(long con, long id, int[] vtxIds, int vtxIdCount); + synchronized void nMeshGetVertices(long id, int[] vtxIds, int vtxIdCount) { validate(); rsnMeshGetVertices(mContext, id, vtxIds, vtxIdCount); } - native void rsnMeshGetIndices(long con, int id, int[] idxIds, int[] primitives, int vtxIdCount); - synchronized void nMeshGetIndices(int id, int[] idxIds, int[] primitives, int vtxIdCount) { + native void rsnMeshGetIndices(long con, long id, int[] idxIds, int[] primitives, int vtxIdCount); + synchronized void nMeshGetIndices(long id, int[] idxIds, int[] primitives, int vtxIdCount) { validate(); rsnMeshGetIndices(mContext, id, idxIds, primitives, vtxIdCount); } - native int rsnPathCreate(long con, int prim, boolean isStatic, int vtx, int loop, float q); - synchronized int nPathCreate(int prim, boolean isStatic, int vtx, int loop, float q) { + native long rsnPathCreate(long con, int prim, boolean isStatic, long vtx, int loop, float q); + synchronized long nPathCreate(int prim, boolean isStatic, long vtx, int loop, float q) { validate(); return rsnPathCreate(mContext, prim, isStatic, vtx, loop, q); } @@ -1209,7 +1208,7 @@ public class RenderScript { return mContext != 0; } - int safeID(BaseObj o) { + long safeID(BaseObj o) { if(o != null) { return o.getID(this); } diff --git a/graphics/java/android/renderscript/RenderScriptGL.java b/graphics/java/android/renderscript/RenderScriptGL.java index bac9c68..c9cbe3e 100644 --- a/graphics/java/android/renderscript/RenderScriptGL.java +++ b/graphics/java/android/renderscript/RenderScriptGL.java @@ -286,7 +286,7 @@ public class RenderScriptGL extends RenderScript { */ public void bindRootScript(Script s) { validate(); - nContextBindRootScript(safeID(s)); + nContextBindRootScript((int)safeID(s)); } /** @@ -298,7 +298,7 @@ public class RenderScriptGL extends RenderScript { */ public void bindProgramStore(ProgramStore p) { validate(); - nContextBindProgramStore(safeID(p)); + nContextBindProgramStore((int)safeID(p)); } /** @@ -310,7 +310,7 @@ public class RenderScriptGL extends RenderScript { */ public void bindProgramFragment(ProgramFragment p) { validate(); - nContextBindProgramFragment(safeID(p)); + nContextBindProgramFragment((int)safeID(p)); } /** @@ -322,7 +322,7 @@ public class RenderScriptGL extends RenderScript { */ public void bindProgramRaster(ProgramRaster p) { validate(); - nContextBindProgramRaster(safeID(p)); + nContextBindProgramRaster((int)safeID(p)); } /** @@ -334,7 +334,7 @@ public class RenderScriptGL extends RenderScript { */ public void bindProgramVertex(ProgramVertex p) { validate(); - nContextBindProgramVertex(safeID(p)); + nContextBindProgramVertex((int)safeID(p)); } } diff --git a/graphics/java/android/renderscript/Script.java b/graphics/java/android/renderscript/Script.java index 0026e0e..5ab18f7 100644 --- a/graphics/java/android/renderscript/Script.java +++ b/graphics/java/android/renderscript/Script.java @@ -36,7 +36,7 @@ public class Script extends BaseObj { Script mScript; int mSlot; int mSig; - KernelID(int id, RenderScript rs, Script s, int slot, int sig) { + KernelID(long id, RenderScript rs, Script s, int slot, int sig) { super(id, rs); mScript = s; mSlot = slot; @@ -54,7 +54,7 @@ public class Script extends BaseObj { return k; } - int id = mRS.nScriptKernelIDCreate(getID(mRS), slot, sig); + long id = mRS.nScriptKernelIDCreate(getID(mRS), slot, sig); if (id == 0) { throw new RSDriverException("Failed to create KernelID"); } @@ -75,7 +75,7 @@ public class Script extends BaseObj { public static final class FieldID extends BaseObj { Script mScript; int mSlot; - FieldID(int id, RenderScript rs, Script s, int slot) { + FieldID(long id, RenderScript rs, Script s, int slot) { super(id, rs); mScript = s; mSlot = slot; @@ -92,7 +92,7 @@ public class Script extends BaseObj { return f; } - int id = mRS.nScriptFieldIDCreate(getID(mRS), slot); + long id = mRS.nScriptFieldIDCreate(getID(mRS), slot); if (id == 0) { throw new RSDriverException("Failed to create FieldID"); } @@ -132,11 +132,11 @@ public class Script extends BaseObj { throw new RSIllegalArgumentException( "At least one of ain or aout is required to be non-null."); } - int in_id = 0; + long in_id = 0; if (ain != null) { in_id = ain.getID(mRS); } - int out_id = 0; + long out_id = 0; if (aout != null) { out_id = aout.getID(mRS); } @@ -161,11 +161,11 @@ public class Script extends BaseObj { forEach(slot, ain, aout, v); return; } - int in_id = 0; + long in_id = 0; if (ain != null) { in_id = ain.getID(mRS); } - int out_id = 0; + long out_id = 0; if (aout != null) { out_id = aout.getID(mRS); } @@ -176,7 +176,7 @@ public class Script extends BaseObj { mRS.nScriptForEachClipped(getID(mRS), slot, in_id, out_id, params, sc.xstart, sc.xend, sc.ystart, sc.yend, sc.zstart, sc.zend); } - Script(int id, RenderScript rs) { + Script(long id, RenderScript rs) { super(id, rs); } 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 @@ 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."); } diff --git a/graphics/java/android/renderscript/ScriptIntrinsic.java b/graphics/java/android/renderscript/ScriptIntrinsic.java index 096268a..8719e01 100644 --- a/graphics/java/android/renderscript/ScriptIntrinsic.java +++ b/graphics/java/android/renderscript/ScriptIntrinsic.java @@ -25,7 +25,7 @@ package android.renderscript; * Not intended for direct use. **/ public abstract class ScriptIntrinsic extends Script { - ScriptIntrinsic(int id, RenderScript rs) { + ScriptIntrinsic(long id, RenderScript rs) { super(id, rs); } } diff --git a/graphics/java/android/renderscript/ScriptIntrinsic3DLUT.java b/graphics/java/android/renderscript/ScriptIntrinsic3DLUT.java index 34540a1..96ec875 100644 --- a/graphics/java/android/renderscript/ScriptIntrinsic3DLUT.java +++ b/graphics/java/android/renderscript/ScriptIntrinsic3DLUT.java @@ -30,7 +30,7 @@ public final class ScriptIntrinsic3DLUT extends ScriptIntrinsic { private Allocation mLUT; private Element mElement; - private ScriptIntrinsic3DLUT(int id, RenderScript rs, Element e) { + private ScriptIntrinsic3DLUT(long id, RenderScript rs, Element e) { super(id, rs); mElement = e; } @@ -46,7 +46,7 @@ public final class ScriptIntrinsic3DLUT extends ScriptIntrinsic { * @return ScriptIntrinsic3DLUT */ public static ScriptIntrinsic3DLUT create(RenderScript rs, Element e) { - int id = rs.nScriptIntrinsicCreate(8, e.getID(rs)); + long id = rs.nScriptIntrinsicCreate(8, e.getID(rs)); if (!e.isCompatible(Element.U8_4(rs))) { throw new RSIllegalArgumentException("Element must be compatible with uchar4."); diff --git a/graphics/java/android/renderscript/ScriptIntrinsicBlend.java b/graphics/java/android/renderscript/ScriptIntrinsicBlend.java index 0e05bc8..40f1a3e 100644 --- a/graphics/java/android/renderscript/ScriptIntrinsicBlend.java +++ b/graphics/java/android/renderscript/ScriptIntrinsicBlend.java @@ -21,7 +21,7 @@ package android.renderscript; * Intrinsic kernels for blending two {@link android.renderscript.Allocation} objects. **/ public class ScriptIntrinsicBlend extends ScriptIntrinsic { - ScriptIntrinsicBlend(int id, RenderScript rs) { + ScriptIntrinsicBlend(long id, RenderScript rs) { super(id, rs); } @@ -35,7 +35,7 @@ public class ScriptIntrinsicBlend extends ScriptIntrinsic { */ public static ScriptIntrinsicBlend create(RenderScript rs, Element e) { // 7 comes from RS_SCRIPT_INTRINSIC_ID_BLEND in rsDefines.h - int id = rs.nScriptIntrinsicCreate(7, e.getID(rs)); + long id = rs.nScriptIntrinsicCreate(7, e.getID(rs)); return new ScriptIntrinsicBlend(id, rs); } diff --git a/graphics/java/android/renderscript/ScriptIntrinsicBlur.java b/graphics/java/android/renderscript/ScriptIntrinsicBlur.java index aaf5ffc..d1a6fed 100644 --- a/graphics/java/android/renderscript/ScriptIntrinsicBlur.java +++ b/graphics/java/android/renderscript/ScriptIntrinsicBlur.java @@ -30,7 +30,7 @@ public final class ScriptIntrinsicBlur extends ScriptIntrinsic { private final float[] mValues = new float[9]; private Allocation mInput; - private ScriptIntrinsicBlur(int id, RenderScript rs) { + private ScriptIntrinsicBlur(long id, RenderScript rs) { super(id, rs); } @@ -49,7 +49,7 @@ public final class ScriptIntrinsicBlur extends ScriptIntrinsic { if ((!e.isCompatible(Element.U8_4(rs))) && (!e.isCompatible(Element.U8(rs)))) { throw new RSIllegalArgumentException("Unsuported element type."); } - int id = rs.nScriptIntrinsicCreate(5, e.getID(rs)); + long id = rs.nScriptIntrinsicCreate(5, e.getID(rs)); ScriptIntrinsicBlur sib = new ScriptIntrinsicBlur(id, rs); sib.setRadius(5.f); return sib; diff --git a/graphics/java/android/renderscript/ScriptIntrinsicColorMatrix.java b/graphics/java/android/renderscript/ScriptIntrinsicColorMatrix.java index 32c3d15..601db17 100644 --- a/graphics/java/android/renderscript/ScriptIntrinsicColorMatrix.java +++ b/graphics/java/android/renderscript/ScriptIntrinsicColorMatrix.java @@ -43,7 +43,7 @@ public final class ScriptIntrinsicColorMatrix extends ScriptIntrinsic { private final Matrix4f mMatrix = new Matrix4f(); private final Float4 mAdd = new Float4(); - private ScriptIntrinsicColorMatrix(int id, RenderScript rs) { + private ScriptIntrinsicColorMatrix(long id, RenderScript rs) { super(id, rs); } @@ -75,7 +75,7 @@ public final class ScriptIntrinsicColorMatrix extends ScriptIntrinsic { * @return ScriptIntrinsicColorMatrix */ public static ScriptIntrinsicColorMatrix create(RenderScript rs) { - int id = rs.nScriptIntrinsicCreate(2, 0); + long id = rs.nScriptIntrinsicCreate(2, 0); return new ScriptIntrinsicColorMatrix(id, rs); } diff --git a/graphics/java/android/renderscript/ScriptIntrinsicConvolve3x3.java b/graphics/java/android/renderscript/ScriptIntrinsicConvolve3x3.java index 5d3c1d3..25f3ee8 100644 --- a/graphics/java/android/renderscript/ScriptIntrinsicConvolve3x3.java +++ b/graphics/java/android/renderscript/ScriptIntrinsicConvolve3x3.java @@ -26,7 +26,7 @@ public final class ScriptIntrinsicConvolve3x3 extends ScriptIntrinsic { private final float[] mValues = new float[9]; private Allocation mInput; - private ScriptIntrinsicConvolve3x3(int id, RenderScript rs) { + private ScriptIntrinsicConvolve3x3(long id, RenderScript rs) { super(id, rs); } @@ -61,7 +61,7 @@ public final class ScriptIntrinsicConvolve3x3 extends ScriptIntrinsic { !e.isCompatible(Element.F32_4(rs))) { throw new RSIllegalArgumentException("Unsuported element type."); } - int id = rs.nScriptIntrinsicCreate(1, e.getID(rs)); + long id = rs.nScriptIntrinsicCreate(1, e.getID(rs)); ScriptIntrinsicConvolve3x3 si = new ScriptIntrinsicConvolve3x3(id, rs); si.setCoefficients(f); return si; diff --git a/graphics/java/android/renderscript/ScriptIntrinsicConvolve5x5.java b/graphics/java/android/renderscript/ScriptIntrinsicConvolve5x5.java index ad09f95..71ea4cb 100644 --- a/graphics/java/android/renderscript/ScriptIntrinsicConvolve5x5.java +++ b/graphics/java/android/renderscript/ScriptIntrinsicConvolve5x5.java @@ -26,7 +26,7 @@ public final class ScriptIntrinsicConvolve5x5 extends ScriptIntrinsic { private final float[] mValues = new float[25]; private Allocation mInput; - private ScriptIntrinsicConvolve5x5(int id, RenderScript rs) { + private ScriptIntrinsicConvolve5x5(long id, RenderScript rs) { super(id, rs); } @@ -62,7 +62,7 @@ public final class ScriptIntrinsicConvolve5x5 extends ScriptIntrinsic { throw new RSIllegalArgumentException("Unsuported element type."); } - int id = rs.nScriptIntrinsicCreate(4, e.getID(rs)); + long id = rs.nScriptIntrinsicCreate(4, e.getID(rs)); return new ScriptIntrinsicConvolve5x5(id, rs); } diff --git a/graphics/java/android/renderscript/ScriptIntrinsicHistogram.java b/graphics/java/android/renderscript/ScriptIntrinsicHistogram.java index adc2d95..42e4d04 100644 --- a/graphics/java/android/renderscript/ScriptIntrinsicHistogram.java +++ b/graphics/java/android/renderscript/ScriptIntrinsicHistogram.java @@ -28,7 +28,7 @@ import android.util.Log; public final class ScriptIntrinsicHistogram extends ScriptIntrinsic { private Allocation mOut; - private ScriptIntrinsicHistogram(int id, RenderScript rs) { + private ScriptIntrinsicHistogram(long id, RenderScript rs) { super(id, rs); } @@ -52,7 +52,7 @@ public final class ScriptIntrinsicHistogram extends ScriptIntrinsic { (!e.isCompatible(Element.U8(rs)))) { throw new RSIllegalArgumentException("Unsuported element type."); } - int id = rs.nScriptIntrinsicCreate(9, e.getID(rs)); + long id = rs.nScriptIntrinsicCreate(9, e.getID(rs)); ScriptIntrinsicHistogram sib = new ScriptIntrinsicHistogram(id, rs); return sib; } diff --git a/graphics/java/android/renderscript/ScriptIntrinsicLUT.java b/graphics/java/android/renderscript/ScriptIntrinsicLUT.java index 0f7ab38..c45c015 100644 --- a/graphics/java/android/renderscript/ScriptIntrinsicLUT.java +++ b/graphics/java/android/renderscript/ScriptIntrinsicLUT.java @@ -30,7 +30,7 @@ public final class ScriptIntrinsicLUT extends ScriptIntrinsic { private final byte mCache[] = new byte[1024]; private boolean mDirty = true; - private ScriptIntrinsicLUT(int id, RenderScript rs) { + private ScriptIntrinsicLUT(long id, RenderScript rs) { super(id, rs); mTables = Allocation.createSized(rs, Element.U8(rs), 1024); for (int ct=0; ct < 256; ct++) { @@ -53,7 +53,7 @@ public final class ScriptIntrinsicLUT extends ScriptIntrinsic { * @return ScriptIntrinsicLUT */ public static ScriptIntrinsicLUT create(RenderScript rs, Element e) { - int id = rs.nScriptIntrinsicCreate(3, e.getID(rs)); + long id = rs.nScriptIntrinsicCreate(3, e.getID(rs)); return new ScriptIntrinsicLUT(id, rs); } diff --git a/graphics/java/android/renderscript/ScriptIntrinsicYuvToRGB.java b/graphics/java/android/renderscript/ScriptIntrinsicYuvToRGB.java index 845625d..f942982 100644 --- a/graphics/java/android/renderscript/ScriptIntrinsicYuvToRGB.java +++ b/graphics/java/android/renderscript/ScriptIntrinsicYuvToRGB.java @@ -27,7 +27,7 @@ package android.renderscript; public final class ScriptIntrinsicYuvToRGB extends ScriptIntrinsic { private Allocation mInput; - ScriptIntrinsicYuvToRGB(int id, RenderScript rs) { + ScriptIntrinsicYuvToRGB(long id, RenderScript rs) { super(id, rs); } @@ -43,7 +43,7 @@ public final class ScriptIntrinsicYuvToRGB extends ScriptIntrinsic { */ public static ScriptIntrinsicYuvToRGB create(RenderScript rs, Element e) { // 6 comes from RS_SCRIPT_INTRINSIC_YUV_TO_RGB in rsDefines.h - int id = rs.nScriptIntrinsicCreate(6, e.getID(rs)); + long id = rs.nScriptIntrinsicCreate(6, e.getID(rs)); ScriptIntrinsicYuvToRGB si = new ScriptIntrinsicYuvToRGB(id, rs); return si; } diff --git a/graphics/java/android/renderscript/Type.java b/graphics/java/android/renderscript/Type.java index db4b577..7283814 100644 --- a/graphics/java/android/renderscript/Type.java +++ b/graphics/java/android/renderscript/Type.java @@ -190,16 +190,18 @@ public class Type extends BaseObj { } - Type(int id, RenderScript rs) { + Type(long id, RenderScript rs) { super(id, rs); } @Override void updateFromNative() { + // FIXME: rsaTypeGetNativeData needs 32-bit and 64-bit paths + // We have 6 integer to obtain mDimX; mDimY; mDimZ; // mDimLOD; mDimFaces; mElement; int[] dataBuffer = new int[6]; - mRS.nTypeGetNativeData(getID(mRS), dataBuffer); + mRS.nTypeGetNativeData((int)getID(mRS), dataBuffer); mDimX = dataBuffer[0]; mDimY = dataBuffer[1]; @@ -230,7 +232,7 @@ public class Type extends BaseObj { throw new RSInvalidStateException("Dimension must be >= 1."); } - int id = rs.nTypeCreate(e.getID(rs), dimX, 0, 0, false, false, 0); + long id = rs.nTypeCreate(e.getID(rs), dimX, 0, 0, false, false, 0); Type t = new Type(id, rs); t.mElement = e; t.mDimX = dimX; @@ -254,7 +256,7 @@ public class Type extends BaseObj { throw new RSInvalidStateException("Dimension must be >= 1."); } - int id = rs.nTypeCreate(e.getID(rs), dimX, dimY, 0, false, false, 0); + long id = rs.nTypeCreate(e.getID(rs), dimX, dimY, 0, false, false, 0); Type t = new Type(id, rs); t.mElement = e; t.mDimX = dimX; @@ -280,7 +282,7 @@ public class Type extends BaseObj { throw new RSInvalidStateException("Dimension must be >= 1."); } - int id = rs.nTypeCreate(e.getID(rs), dimX, dimY, dimZ, false, false, 0); + long id = rs.nTypeCreate(e.getID(rs), dimX, dimY, dimZ, false, false, 0); Type t = new Type(id, rs); t.mElement = e; t.mDimX = dimX; @@ -411,7 +413,7 @@ public class Type extends BaseObj { } } - int id = mRS.nTypeCreate(mElement.getID(mRS), + long id = mRS.nTypeCreate(mElement.getID(mRS), mDimX, mDimY, mDimZ, mDimMipmaps, mDimFaces, mYuv); Type t = new Type(id, mRS); t.mElement = mElement; diff --git a/graphics/jni/android_renderscript_RenderScript.cpp b/graphics/jni/android_renderscript_RenderScript.cpp index 6703fac..619e737 100644 --- a/graphics/jni/android_renderscript_RenderScript.cpp +++ b/graphics/jni/android_renderscript_RenderScript.cpp @@ -186,7 +186,7 @@ nContextFinish(JNIEnv *_env, jobject _this, jlong con) } static void -nAssignName(JNIEnv *_env, jobject _this, jlong con, jint obj, jbyteArray str) +nAssignName(JNIEnv *_env, jobject _this, jlong con, jlong obj, jbyteArray str) { LOG_API("nAssignName, con(%p), obj(%p)", con, (void *)obj); jint len = _env->GetArrayLength(str); @@ -196,7 +196,7 @@ nAssignName(JNIEnv *_env, jobject _this, jlong con, jint obj, jbyteArray str) } static jstring -nGetName(JNIEnv *_env, jobject _this, jlong con, jint obj) +nGetName(JNIEnv *_env, jobject _this, jlong con, jlong obj) { LOG_API("nGetName, con(%p), obj(%p)", con, (void *)obj); const char *name = NULL; @@ -208,7 +208,7 @@ nGetName(JNIEnv *_env, jobject _this, jlong con, jint obj) } static void -nObjDestroy(JNIEnv *_env, jobject _this, jlong con, jint obj) +nObjDestroy(JNIEnv *_env, jobject _this, jlong con, jlong obj) { LOG_API("nObjDestroy, con(%p) obj(%p)", con, (void *)obj); rsObjDestroy((RsContext)con, (void *)obj); @@ -403,14 +403,14 @@ nContextSendMessage(JNIEnv *_env, jobject _this, jlong con, jint id, jintArray d -static jint -nElementCreate(JNIEnv *_env, jobject _this, jlong con, jint type, jint kind, jboolean norm, jint size) +static jlong +nElementCreate(JNIEnv *_env, jobject _this, jlong con, jlong type, jint kind, jboolean norm, jint size) { LOG_API("nElementCreate, con(%p), type(%i), kind(%i), norm(%i), size(%i)", con, type, kind, norm, size); - return (jint)rsElementCreate((RsContext)con, (RsDataType)type, (RsDataKind)kind, norm, size); + return (jlong)rsElementCreate((RsContext)con, (RsDataType)type, (RsDataKind)kind, norm, size); } -static jint +static jlong nElementCreate2(JNIEnv *_env, jobject _this, jlong con, jintArray _ids, jobjectArray _names, jintArray _arraySizes) { @@ -425,7 +425,7 @@ nElementCreate2(JNIEnv *_env, jobject _this, jlong con, const char **nameArray = names.c_str(); size_t *sizeArray = names.c_str_len(); - jint id = (jint)rsElementCreate2((RsContext)con, + jlong id = (jlong)rsElementCreate2((RsContext)con, (RsElement *)ids, fieldCount, nameArray, fieldCount * sizeof(size_t), sizeArray, (const uint32_t *)arraySizes, fieldCount); @@ -436,7 +436,7 @@ nElementCreate2(JNIEnv *_env, jobject _this, jlong con, } static void -nElementGetNativeData(JNIEnv *_env, jobject _this, jlong con, jint id, jintArray _elementData) +nElementGetNativeData(JNIEnv *_env, jobject _this, jlong con, jlong id, jintArray _elementData) { int dataSize = _env->GetArrayLength(_elementData); LOG_API("nElementGetNativeData, con(%p)", con); @@ -454,7 +454,7 @@ nElementGetNativeData(JNIEnv *_env, jobject _this, jlong con, jint id, jintArray static void -nElementGetSubElements(JNIEnv *_env, jobject _this, jlong con, jint id, +nElementGetSubElements(JNIEnv *_env, jobject _this, jlong con, jlong id, jintArray _IDs, jobjectArray _names, jintArray _arraySizes) @@ -481,19 +481,18 @@ nElementGetSubElements(JNIEnv *_env, jobject _this, jlong con, jint id, // ----------------------------------- -static int -nTypeCreate(JNIEnv *_env, jobject _this, jlong con, RsElement eid, +static jlong +nTypeCreate(JNIEnv *_env, jobject _this, jlong con, jlong eid, jint dimx, jint dimy, jint dimz, jboolean mips, jboolean faces, jint yuv) { LOG_API("nTypeCreate, con(%p) eid(%p), x(%i), y(%i), z(%i), mips(%i), faces(%i), yuv(%i)", con, eid, dimx, dimy, dimz, mips, faces, yuv); - jint id = (jint)rsTypeCreate((RsContext)con, (RsElement)eid, dimx, dimy, dimz, mips, faces, yuv); - return (jint)id; + return (jlong)rsTypeCreate((RsContext)con, (RsElement)eid, dimx, dimy, dimz, mips, faces, yuv); } static void -nTypeGetNativeData(JNIEnv *_env, jobject _this, jlong con, jint id, jintArray _typeData) +nTypeGetNativeData(JNIEnv *_env, jobject _this, jlong con, jlong id, jintArray _typeData) { // We are packing 6 items: mDimX; mDimY; mDimZ; // mDimLOD; mDimFaces; mElement; into typeData @@ -512,22 +511,22 @@ nTypeGetNativeData(JNIEnv *_env, jobject _this, jlong con, jint id, jintArray _t // ----------------------------------- -static jint -nAllocationCreateTyped(JNIEnv *_env, jobject _this, jlong con, jint type, jint mips, jint usage, jint pointer) +static jlong +nAllocationCreateTyped(JNIEnv *_env, jobject _this, jlong con, jlong type, jint mips, jint usage, jint pointer) { LOG_API("nAllocationCreateTyped, con(%p), type(%p), mip(%i), usage(%i), ptr(%p)", con, (RsElement)type, mips, usage, (void *)pointer); return (jint) rsAllocationCreateTyped((RsContext)con, (RsType)type, (RsAllocationMipmapControl)mips, (uint32_t)usage, (uint32_t)pointer); } static void -nAllocationSyncAll(JNIEnv *_env, jobject _this, jlong con, jint a, jint bits) +nAllocationSyncAll(JNIEnv *_env, jobject _this, jlong con, jlong a, jint bits) { LOG_API("nAllocationSyncAll, con(%p), a(%p), bits(0x%08x)", con, (RsAllocation)a, bits); rsAllocationSyncAll((RsContext)con, (RsAllocation)a, (RsAllocationUsageType)bits); } static jobject -nAllocationGetSurface(JNIEnv *_env, jobject _this, jlong con, jint a) +nAllocationGetSurface(JNIEnv *_env, jobject _this, jlong con, jlong a) { LOG_API("nAllocationGetSurface, con(%p), a(%p)", con, (RsAllocation)a); @@ -540,7 +539,7 @@ nAllocationGetSurface(JNIEnv *_env, jobject _this, jlong con, jint a) } static void -nAllocationSetSurface(JNIEnv *_env, jobject _this, jlong con, RsAllocation alloc, jobject sur) +nAllocationSetSurface(JNIEnv *_env, jobject _this, jlong con, jlong alloc, jobject sur) { LOG_API("nAllocationSetSurface, con(%p), alloc(%p), surface(%p)", con, alloc, (Surface *)sur); @@ -550,33 +549,33 @@ nAllocationSetSurface(JNIEnv *_env, jobject _this, jlong con, RsAllocation alloc s = android_view_Surface_getSurface(_env, sur); } - rsAllocationSetSurface((RsContext)con, alloc, static_cast(s.get())); + rsAllocationSetSurface((RsContext)con, (RsAllocation)alloc, static_cast(s.get())); } static void -nAllocationIoSend(JNIEnv *_env, jobject _this, jlong con, RsAllocation alloc) +nAllocationIoSend(JNIEnv *_env, jobject _this, jlong con, jlong alloc) { LOG_API("nAllocationIoSend, con(%p), alloc(%p)", con, alloc); - rsAllocationIoSend((RsContext)con, alloc); + rsAllocationIoSend((RsContext)con, (RsAllocation)alloc); } static void -nAllocationIoReceive(JNIEnv *_env, jobject _this, jlong con, RsAllocation alloc) +nAllocationIoReceive(JNIEnv *_env, jobject _this, jlong con, jlong alloc) { LOG_API("nAllocationIoReceive, con(%p), alloc(%p)", con, alloc); - rsAllocationIoReceive((RsContext)con, alloc); + rsAllocationIoReceive((RsContext)con, (RsAllocation)alloc); } static void -nAllocationGenerateMipmaps(JNIEnv *_env, jobject _this, jlong con, jint alloc) +nAllocationGenerateMipmaps(JNIEnv *_env, jobject _this, jlong con, jlong alloc) { LOG_API("nAllocationGenerateMipmaps, con(%p), a(%p)", con, (RsAllocation)alloc); rsAllocationGenerateMipmaps((RsContext)con, (RsAllocation)alloc); } -static int -nAllocationCreateFromBitmap(JNIEnv *_env, jobject _this, jlong con, jint type, jint mip, jobject jbitmap, jint usage) +static jlong +nAllocationCreateFromBitmap(JNIEnv *_env, jobject _this, jlong con, jlong type, jint mip, jobject jbitmap, jint usage) { SkBitmap const * nativeBitmap = (SkBitmap const *)_env->GetIntField(jbitmap, gNativeBitmapID); @@ -584,15 +583,15 @@ nAllocationCreateFromBitmap(JNIEnv *_env, jobject _this, jlong con, jint type, j bitmap.lockPixels(); const void* ptr = bitmap.getPixels(); - jint id = (jint)rsAllocationCreateFromBitmap((RsContext)con, + jlong id = (jlong)rsAllocationCreateFromBitmap((RsContext)con, (RsType)type, (RsAllocationMipmapControl)mip, ptr, bitmap.getSize(), usage); bitmap.unlockPixels(); return id; } -static int -nAllocationCreateBitmapBackedAllocation(JNIEnv *_env, jobject _this, jlong con, jint type, jint mip, jobject jbitmap, jint usage) +static jlong +nAllocationCreateBitmapBackedAllocation(JNIEnv *_env, jobject _this, jlong con, jlong type, jint mip, jobject jbitmap, jint usage) { SkBitmap const * nativeBitmap = (SkBitmap const *)_env->GetIntField(jbitmap, gNativeBitmapID); @@ -600,15 +599,15 @@ nAllocationCreateBitmapBackedAllocation(JNIEnv *_env, jobject _this, jlong con, bitmap.lockPixels(); const void* ptr = bitmap.getPixels(); - jint id = (jint)rsAllocationCreateTyped((RsContext)con, + jlong id = (jlong)rsAllocationCreateTyped((RsContext)con, (RsType)type, (RsAllocationMipmapControl)mip, (uint32_t)usage, (size_t)ptr); bitmap.unlockPixels(); return id; } -static int -nAllocationCubeCreateFromBitmap(JNIEnv *_env, jobject _this, jlong con, jint type, jint mip, jobject jbitmap, jint usage) +static jlong +nAllocationCubeCreateFromBitmap(JNIEnv *_env, jobject _this, jlong con, jlong type, jint mip, jobject jbitmap, jint usage) { SkBitmap const * nativeBitmap = (SkBitmap const *)_env->GetIntField(jbitmap, gNativeBitmapID); @@ -616,7 +615,7 @@ nAllocationCubeCreateFromBitmap(JNIEnv *_env, jobject _this, jlong con, jint typ bitmap.lockPixels(); const void* ptr = bitmap.getPixels(); - jint id = (jint)rsAllocationCubeCreateFromBitmap((RsContext)con, + jlong id = (jlong)rsAllocationCubeCreateFromBitmap((RsContext)con, (RsType)type, (RsAllocationMipmapControl)mip, ptr, bitmap.getSize(), usage); bitmap.unlockPixels(); @@ -624,7 +623,7 @@ nAllocationCubeCreateFromBitmap(JNIEnv *_env, jobject _this, jlong con, jint typ } static void -nAllocationCopyFromBitmap(JNIEnv *_env, jobject _this, jlong con, jint alloc, jobject jbitmap) +nAllocationCopyFromBitmap(JNIEnv *_env, jobject _this, jlong con, jlong alloc, jobject jbitmap) { SkBitmap const * nativeBitmap = (SkBitmap const *)_env->GetIntField(jbitmap, gNativeBitmapID); @@ -641,7 +640,7 @@ nAllocationCopyFromBitmap(JNIEnv *_env, jobject _this, jlong con, jint alloc, jo } static void -nAllocationCopyToBitmap(JNIEnv *_env, jobject _this, jlong con, jint alloc, jobject jbitmap) +nAllocationCopyToBitmap(JNIEnv *_env, jobject _this, jlong con, jlong alloc, jobject jbitmap) { SkBitmap const * nativeBitmap = (SkBitmap const *)_env->GetIntField(jbitmap, gNativeBitmapID); @@ -662,7 +661,7 @@ static void ReleaseBitmapCallback(void *bmp) static void -nAllocationData1D(JNIEnv *_env, jobject _this, jlong con, jint _alloc, jint offset, jint lod, +nAllocationData1D(JNIEnv *_env, jobject _this, jlong con, jlong _alloc, jint offset, jint lod, jint count, jobject data, int sizeBytes, int dataType) { RsAllocation *alloc = (RsAllocation *)_alloc; @@ -673,7 +672,7 @@ nAllocationData1D(JNIEnv *_env, jobject _this, jlong con, jint _alloc, jint offs static void // native void rsnAllocationElementData1D(int con, int id, int xoff, int compIdx, byte[] d, int sizeBytes); -nAllocationElementData1D(JNIEnv *_env, jobject _this, jlong con, jint alloc, jint offset, jint lod, jint compIdx, jbyteArray data, int sizeBytes) +nAllocationElementData1D(JNIEnv *_env, jobject _this, jlong con, jlong alloc, jint offset, jint lod, jint compIdx, jbyteArray data, int sizeBytes) { jint len = _env->GetArrayLength(data); LOG_API("nAllocationElementData1D, con(%p), alloc(%p), offset(%i), comp(%i), len(%i), sizeBytes(%i)", con, (RsAllocation)alloc, offset, compIdx, len, sizeBytes); @@ -683,7 +682,7 @@ nAllocationElementData1D(JNIEnv *_env, jobject _this, jlong con, jint alloc, jin } static void -nAllocationData2D(JNIEnv *_env, jobject _this, jlong con, jint _alloc, jint xoff, jint yoff, jint lod, jint _face, +nAllocationData2D(JNIEnv *_env, jobject _this, jlong con, jlong _alloc, jint xoff, jint yoff, jint lod, jint _face, jint w, jint h, jobject data, int sizeBytes, int dataType) { RsAllocation *alloc = (RsAllocation *)_alloc; @@ -695,10 +694,10 @@ nAllocationData2D(JNIEnv *_env, jobject _this, jlong con, jint _alloc, jint xoff static void nAllocationData2D_alloc(JNIEnv *_env, jobject _this, jlong con, - jint dstAlloc, jint dstXoff, jint dstYoff, + jlong dstAlloc, jint dstXoff, jint dstYoff, jint dstMip, jint dstFace, jint width, jint height, - jint srcAlloc, jint srcXoff, jint srcYoff, + jlong srcAlloc, jint srcXoff, jint srcYoff, jint srcMip, jint srcFace) { LOG_API("nAllocation2DData_s, con(%p), dstAlloc(%p), dstXoff(%i), dstYoff(%i)," @@ -718,7 +717,7 @@ nAllocationData2D_alloc(JNIEnv *_env, jobject _this, jlong con, } static void -nAllocationData3D(JNIEnv *_env, jobject _this, jlong con, jint _alloc, jint xoff, jint yoff, jint zoff, jint lod, +nAllocationData3D(JNIEnv *_env, jobject _this, jlong con, jlong _alloc, jint xoff, jint yoff, jint zoff, jint lod, jint w, jint h, jint d, jobject data, int sizeBytes, int dataType) { RsAllocation *alloc = (RsAllocation *)_alloc; @@ -729,10 +728,10 @@ nAllocationData3D(JNIEnv *_env, jobject _this, jlong con, jint _alloc, jint xoff static void nAllocationData3D_alloc(JNIEnv *_env, jobject _this, jlong con, - jint dstAlloc, jint dstXoff, jint dstYoff, jint dstZoff, + jlong dstAlloc, jint dstXoff, jint dstYoff, jint dstZoff, jint dstMip, jint width, jint height, jint depth, - jint srcAlloc, jint srcXoff, jint srcYoff, jint srcZoff, + jlong srcAlloc, jint srcXoff, jint srcYoff, jint srcZoff, jint srcMip) { LOG_API("nAllocationData3D_alloc, con(%p), dstAlloc(%p), dstXoff(%i), dstYoff(%i)," @@ -751,7 +750,7 @@ nAllocationData3D_alloc(JNIEnv *_env, jobject _this, jlong con, static void -nAllocationRead(JNIEnv *_env, jobject _this, jlong con, jint _alloc, jobject data, int dataType) +nAllocationRead(JNIEnv *_env, jobject _this, jlong con, jlong _alloc, jobject data, int dataType) { RsAllocation *alloc = (RsAllocation *)_alloc; LOG_API("nAllocationRead, con(%p), alloc(%p)", con, (RsAllocation)alloc); @@ -759,7 +758,7 @@ nAllocationRead(JNIEnv *_env, jobject _this, jlong con, jint _alloc, jobject dat } static void -nAllocationRead1D(JNIEnv *_env, jobject _this, jlong con, jint _alloc, jint offset, jint lod, +nAllocationRead1D(JNIEnv *_env, jobject _this, jlong con, jlong _alloc, jint offset, jint lod, jint count, jobject data, int sizeBytes, int dataType) { RsAllocation *alloc = (RsAllocation *)_alloc; @@ -769,7 +768,7 @@ nAllocationRead1D(JNIEnv *_env, jobject _this, jlong con, jint _alloc, jint offs } static void -nAllocationRead2D(JNIEnv *_env, jobject _this, jlong con, jint _alloc, jint xoff, jint yoff, jint lod, jint _face, +nAllocationRead2D(JNIEnv *_env, jobject _this, jlong con, jlong _alloc, jint xoff, jint yoff, jint lod, jint _face, jint w, jint h, jobject data, int sizeBytes, int dataType) { RsAllocation *alloc = (RsAllocation *)_alloc; @@ -779,15 +778,15 @@ nAllocationRead2D(JNIEnv *_env, jobject _this, jlong con, jint _alloc, jint xoff PER_ARRAY_TYPE(0, rsAllocation2DRead, (RsContext)con, alloc, xoff, yoff, lod, face, w, h, ptr, sizeBytes, 0); } -static jint -nAllocationGetType(JNIEnv *_env, jobject _this, jlong con, jint a) +static jlong +nAllocationGetType(JNIEnv *_env, jobject _this, jlong con, jlong a) { LOG_API("nAllocationGetType, con(%p), a(%p)", con, (RsAllocation)a); - return (jint) rsaAllocationGetType((RsContext)con, (RsAllocation)a); + return (jlong) rsaAllocationGetType((RsContext)con, (RsAllocation)a); } static void -nAllocationResize1D(JNIEnv *_env, jobject _this, jlong con, jint alloc, jint dimX) +nAllocationResize1D(JNIEnv *_env, jobject _this, jlong con, jlong alloc, jint dimX) { LOG_API("nAllocationResize1D, con(%p), alloc(%p), sizeX(%i)", con, (RsAllocation)alloc, dimX); rsAllocationResize1D((RsContext)con, (RsAllocation)alloc, dimX); @@ -795,18 +794,18 @@ nAllocationResize1D(JNIEnv *_env, jobject _this, jlong con, jint alloc, jint dim // ----------------------------------- -static int -nFileA3DCreateFromAssetStream(JNIEnv *_env, jobject _this, jlong con, jint native_asset) +static jlong +nFileA3DCreateFromAssetStream(JNIEnv *_env, jobject _this, jlong con, jlong native_asset) { ALOGV("______nFileA3D %u", (uint32_t) native_asset); Asset* asset = reinterpret_cast(native_asset); - jint id = (jint)rsaFileA3DCreateFromMemory((RsContext)con, asset->getBuffer(false), asset->getLength()); + jlong id = (jlong)rsaFileA3DCreateFromMemory((RsContext)con, asset->getBuffer(false), asset->getLength()); return id; } -static int +static jlong nFileA3DCreateFromAsset(JNIEnv *_env, jobject _this, jlong con, jobject _assetMgr, jstring _path) { AssetManager* mgr = assetManagerForJavaObject(_env, _assetMgr); @@ -820,21 +819,21 @@ nFileA3DCreateFromAsset(JNIEnv *_env, jobject _this, jlong con, jobject _assetMg return 0; } - jint id = (jint)rsaFileA3DCreateFromAsset((RsContext)con, asset); + jlong id = (jlong)rsaFileA3DCreateFromAsset((RsContext)con, asset); return id; } -static int +static jlong nFileA3DCreateFromFile(JNIEnv *_env, jobject _this, jlong con, jstring fileName) { AutoJavaStringToUTF8 fileNameUTF(_env, fileName); - jint id = (jint)rsaFileA3DCreateFromFile((RsContext)con, fileNameUTF.c_str()); + jlong id = (jlong)rsaFileA3DCreateFromFile((RsContext)con, fileNameUTF.c_str()); return id; } -static int -nFileA3DGetNumIndexEntries(JNIEnv *_env, jobject _this, jlong con, jint fileA3D) +static jint +nFileA3DGetNumIndexEntries(JNIEnv *_env, jobject _this, jlong con, jlong fileA3D) { int32_t numEntries = 0; rsaFileA3DGetNumIndexEntries((RsContext)con, &numEntries, (RsFile)fileA3D); @@ -842,7 +841,7 @@ nFileA3DGetNumIndexEntries(JNIEnv *_env, jobject _this, jlong con, jint fileA3D) } static void -nFileA3DGetIndexEntries(JNIEnv *_env, jobject _this, jlong con, jint fileA3D, jint numEntries, jintArray _ids, jobjectArray _entries) +nFileA3DGetIndexEntries(JNIEnv *_env, jobject _this, jlong con, jlong fileA3D, jint numEntries, jintArray _ids, jobjectArray _entries) { ALOGV("______nFileA3D %u", (uint32_t) fileA3D); RsFileIndexEntry *fileEntries = (RsFileIndexEntry*)malloc((uint32_t)numEntries * sizeof(RsFileIndexEntry)); @@ -858,7 +857,7 @@ nFileA3DGetIndexEntries(JNIEnv *_env, jobject _this, jlong con, jint fileA3D, ji } static int -nFileA3DGetEntryByIndex(JNIEnv *_env, jobject _this, jlong con, jint fileA3D, jint index) +nFileA3DGetEntryByIndex(JNIEnv *_env, jobject _this, jlong con, jlong fileA3D, jint index) { ALOGV("______nFileA3D %u", (uint32_t) fileA3D); jint id = (jint)rsaFileA3DGetEntryByIndex((RsContext)con, (uint32_t)index, (RsFile)fileA3D); @@ -919,21 +918,21 @@ nFontCreateFromAsset(JNIEnv *_env, jobject _this, jlong con, jobject _assetMgr, // ----------------------------------- static void -nScriptBindAllocation(JNIEnv *_env, jobject _this, jlong con, jint script, jint alloc, jint slot) +nScriptBindAllocation(JNIEnv *_env, jobject _this, jlong con, jlong script, jlong alloc, jint slot) { LOG_API("nScriptBindAllocation, con(%p), script(%p), alloc(%p), slot(%i)", con, (RsScript)script, (RsAllocation)alloc, slot); rsScriptBindAllocation((RsContext)con, (RsScript)script, (RsAllocation)alloc, slot); } static void -nScriptSetVarI(JNIEnv *_env, jobject _this, jlong con, jint script, jint slot, jint val) +nScriptSetVarI(JNIEnv *_env, jobject _this, jlong con, jlong script, jint slot, jint val) { LOG_API("nScriptSetVarI, con(%p), s(%p), slot(%i), val(%i)", con, (void *)script, slot, val); rsScriptSetVarI((RsContext)con, (RsScript)script, slot, val); } static jint -nScriptGetVarI(JNIEnv *_env, jobject _this, jlong con, jint script, jint slot) +nScriptGetVarI(JNIEnv *_env, jobject _this, jlong con, jlong script, jint slot) { LOG_API("nScriptGetVarI, con(%p), s(%p), slot(%i)", con, (void *)script, slot); int value = 0; @@ -942,21 +941,21 @@ nScriptGetVarI(JNIEnv *_env, jobject _this, jlong con, jint script, jint slot) } static void -nScriptSetVarObj(JNIEnv *_env, jobject _this, jlong con, jint script, jint slot, jint val) +nScriptSetVarObj(JNIEnv *_env, jobject _this, jlong con, jlong script, jint slot, jlong val) { LOG_API("nScriptSetVarObj, con(%p), s(%p), slot(%i), val(%i)", con, (void *)script, slot, val); rsScriptSetVarObj((RsContext)con, (RsScript)script, slot, (RsObjectBase)val); } static void -nScriptSetVarJ(JNIEnv *_env, jobject _this, jlong con, jint script, jint slot, jlong val) +nScriptSetVarJ(JNIEnv *_env, jobject _this, jlong con, jlong script, jint slot, jlong val) { LOG_API("nScriptSetVarJ, con(%p), s(%p), slot(%i), val(%lli)", con, (void *)script, slot, val); rsScriptSetVarJ((RsContext)con, (RsScript)script, slot, val); } static jlong -nScriptGetVarJ(JNIEnv *_env, jobject _this, jlong con, jint script, jint slot) +nScriptGetVarJ(JNIEnv *_env, jobject _this, jlong con, jlong script, jint slot) { LOG_API("nScriptGetVarJ, con(%p), s(%p), slot(%i)", con, (void *)script, slot); jlong value = 0; @@ -965,14 +964,14 @@ nScriptGetVarJ(JNIEnv *_env, jobject _this, jlong con, jint script, jint slot) } static void -nScriptSetVarF(JNIEnv *_env, jobject _this, jlong con, jint script, jint slot, float val) +nScriptSetVarF(JNIEnv *_env, jobject _this, jlong con, jlong script, jint slot, float val) { LOG_API("nScriptSetVarF, con(%p), s(%p), slot(%i), val(%f)", con, (void *)script, slot, val); rsScriptSetVarF((RsContext)con, (RsScript)script, slot, val); } static jfloat -nScriptGetVarF(JNIEnv *_env, jobject _this, jlong con, jint script, jint slot) +nScriptGetVarF(JNIEnv *_env, jobject _this, jlong con, jlong script, jint slot) { LOG_API("nScriptGetVarF, con(%p), s(%p), slot(%i)", con, (void *)script, slot); jfloat value = 0; @@ -981,14 +980,14 @@ nScriptGetVarF(JNIEnv *_env, jobject _this, jlong con, jint script, jint slot) } static void -nScriptSetVarD(JNIEnv *_env, jobject _this, jlong con, jint script, jint slot, double val) +nScriptSetVarD(JNIEnv *_env, jobject _this, jlong con, jlong script, jint slot, double val) { LOG_API("nScriptSetVarD, con(%p), s(%p), slot(%i), val(%lf)", con, (void *)script, slot, val); rsScriptSetVarD((RsContext)con, (RsScript)script, slot, val); } static jdouble -nScriptGetVarD(JNIEnv *_env, jobject _this, jlong con, jint script, jint slot) +nScriptGetVarD(JNIEnv *_env, jobject _this, jlong con, jlong script, jint slot) { LOG_API("nScriptGetVarD, con(%p), s(%p), slot(%i)", con, (void *)script, slot); jdouble value = 0; @@ -997,7 +996,7 @@ nScriptGetVarD(JNIEnv *_env, jobject _this, jlong con, jint script, jint slot) } static void -nScriptSetVarV(JNIEnv *_env, jobject _this, jlong con, jint script, jint slot, jbyteArray data) +nScriptSetVarV(JNIEnv *_env, jobject _this, jlong con, jlong script, jint slot, jbyteArray data) { LOG_API("nScriptSetVarV, con(%p), s(%p), slot(%i)", con, (void *)script, slot); jint len = _env->GetArrayLength(data); @@ -1007,7 +1006,7 @@ nScriptSetVarV(JNIEnv *_env, jobject _this, jlong con, jint script, jint slot, j } static void -nScriptGetVarV(JNIEnv *_env, jobject _this, jlong con, jint script, jint slot, jbyteArray data) +nScriptGetVarV(JNIEnv *_env, jobject _this, jlong con, jlong script, jint slot, jbyteArray data) { LOG_API("nScriptSetVarV, con(%p), s(%p), slot(%i)", con, (void *)script, slot); jint len = _env->GetArrayLength(data); @@ -1017,7 +1016,7 @@ nScriptGetVarV(JNIEnv *_env, jobject _this, jlong con, jint script, jint slot, j } static void -nScriptSetVarVE(JNIEnv *_env, jobject _this, jlong con, jint script, jint slot, jbyteArray data, jint elem, jintArray dims) +nScriptSetVarVE(JNIEnv *_env, jobject _this, jlong con, jlong script, jint slot, jbyteArray data, jlong elem, jintArray dims) { LOG_API("nScriptSetVarVE, con(%p), s(%p), slot(%i)", con, (void *)script, slot); jint len = _env->GetArrayLength(data); @@ -1032,7 +1031,7 @@ nScriptSetVarVE(JNIEnv *_env, jobject _this, jlong con, jint script, jint slot, static void -nScriptSetTimeZone(JNIEnv *_env, jobject _this, jlong con, jint script, jbyteArray timeZone) +nScriptSetTimeZone(JNIEnv *_env, jobject _this, jlong con, jlong script, jbyteArray timeZone) { LOG_API("nScriptCSetTimeZone, con(%p), s(%p), timeZone(%s)", con, (void *)script, (const char *)timeZone); @@ -1048,14 +1047,14 @@ nScriptSetTimeZone(JNIEnv *_env, jobject _this, jlong con, jint script, jbyteArr } static void -nScriptInvoke(JNIEnv *_env, jobject _this, jlong con, jint obj, jint slot) +nScriptInvoke(JNIEnv *_env, jobject _this, jlong con, jlong obj, jint slot) { LOG_API("nScriptInvoke, con(%p), script(%p)", con, (void *)obj); rsScriptInvoke((RsContext)con, (RsScript)obj, slot); } static void -nScriptInvokeV(JNIEnv *_env, jobject _this, jlong con, jint script, jint slot, jbyteArray data) +nScriptInvokeV(JNIEnv *_env, jobject _this, jlong con, jlong script, jint slot, jbyteArray data) { LOG_API("nScriptInvokeV, con(%p), s(%p), slot(%i)", con, (void *)script, slot); jint len = _env->GetArrayLength(data); @@ -1066,14 +1065,14 @@ nScriptInvokeV(JNIEnv *_env, jobject _this, jlong con, jint script, jint slot, j static void nScriptForEach(JNIEnv *_env, jobject _this, jlong con, - jint script, jint slot, jint ain, jint aout) + jlong script, jint slot, jlong ain, jlong aout) { LOG_API("nScriptForEach, con(%p), s(%p), slot(%i)", con, (void *)script, slot); rsScriptForEach((RsContext)con, (RsScript)script, slot, (RsAllocation)ain, (RsAllocation)aout, NULL, 0, NULL, 0); } static void nScriptForEachV(JNIEnv *_env, jobject _this, jlong con, - jint script, jint slot, jint ain, jint aout, jbyteArray params) + jlong script, jint slot, jlong ain, jlong aout, jbyteArray params) { LOG_API("nScriptForEach, con(%p), s(%p), slot(%i)", con, (void *)script, slot); jint len = _env->GetArrayLength(params); @@ -1084,7 +1083,7 @@ nScriptForEachV(JNIEnv *_env, jobject _this, jlong con, static void nScriptForEachClipped(JNIEnv *_env, jobject _this, jlong con, - jint script, jint slot, jint ain, jint aout, + jlong script, jint slot, jlong ain, jlong aout, jint xstart, jint xend, jint ystart, jint yend, jint zstart, jint zend) { @@ -1104,7 +1103,7 @@ nScriptForEachClipped(JNIEnv *_env, jobject _this, jlong con, static void nScriptForEachClippedV(JNIEnv *_env, jobject _this, jlong con, - jint script, jint slot, jint ain, jint aout, + jlong script, jint slot, jlong ain, jlong aout, jbyteArray params, jint xstart, jint xend, jint ystart, jint yend, jint zstart, jint zend) { @@ -1176,28 +1175,28 @@ exit: return ret; } -static jint -nScriptIntrinsicCreate(JNIEnv *_env, jobject _this, jlong con, jint id, jint eid) +static jlong +nScriptIntrinsicCreate(JNIEnv *_env, jobject _this, jlong con, jint id, jlong eid) { LOG_API("nScriptIntrinsicCreate, con(%p) id(%i) element(%p)", con, id, (void *)eid); - return (jint)rsScriptIntrinsicCreate((RsContext)con, id, (RsElement)eid); + return (jlong)rsScriptIntrinsicCreate((RsContext)con, id, (RsElement)eid); } -static jint -nScriptKernelIDCreate(JNIEnv *_env, jobject _this, jlong con, jint sid, jint slot, jint sig) +static jlong +nScriptKernelIDCreate(JNIEnv *_env, jobject _this, jlong con, jlong sid, jint slot, jint sig) { LOG_API("nScriptKernelIDCreate, con(%p) script(%p), slot(%i), sig(%i)", con, (void *)sid, slot, sig); return (jint)rsScriptKernelIDCreate((RsContext)con, (RsScript)sid, slot, sig); } -static jint -nScriptFieldIDCreate(JNIEnv *_env, jobject _this, jlong con, jint sid, jint slot) +static jlong +nScriptFieldIDCreate(JNIEnv *_env, jobject _this, jlong con, jlong sid, jint slot) { LOG_API("nScriptFieldIDCreate, con(%p) script(%p), slot(%i)", con, (void *)sid, slot); return (jint)rsScriptFieldIDCreate((RsContext)con, (RsScript)sid, slot); } -static jint +static jlong nScriptGroupCreate(JNIEnv *_env, jobject _this, jlong con, jintArray _kernels, jintArray _src, jintArray _dstk, jintArray _dstf, jintArray _types) { @@ -1230,7 +1229,7 @@ nScriptGroupCreate(JNIEnv *_env, jobject _this, jlong con, jintArray _kernels, j } static void -nScriptGroupSetInput(JNIEnv *_env, jobject _this, jlong con, jint gid, jint kid, jint alloc) +nScriptGroupSetInput(JNIEnv *_env, jobject _this, jlong con, jlong gid, jlong kid, jlong alloc) { LOG_API("nScriptGroupSetInput, con(%p) group(%p), kernelId(%p), alloc(%p)", con, (void *)gid, (void *)kid, (void *)alloc); @@ -1238,7 +1237,7 @@ nScriptGroupSetInput(JNIEnv *_env, jobject _this, jlong con, jint gid, jint kid, } static void -nScriptGroupSetOutput(JNIEnv *_env, jobject _this, jlong con, jint gid, jint kid, jint alloc) +nScriptGroupSetOutput(JNIEnv *_env, jobject _this, jlong con, jlong gid, jlong kid, jlong alloc) { LOG_API("nScriptGroupSetOutput, con(%p) group(%p), kernelId(%p), alloc(%p)", con, (void *)gid, (void *)kid, (void *)alloc); @@ -1246,7 +1245,7 @@ nScriptGroupSetOutput(JNIEnv *_env, jobject _this, jlong con, jint gid, jint kid } static void -nScriptGroupExecute(JNIEnv *_env, jobject _this, jlong con, jint gid) +nScriptGroupExecute(JNIEnv *_env, jobject _this, jlong con, jlong gid) { LOG_API("nScriptGroupSetOutput, con(%p) group(%p)", con, (void *)gid); rsScriptGroupExecute((RsContext)con, (RsScriptGroup)gid); @@ -1270,21 +1269,21 @@ nProgramStoreCreate(JNIEnv *_env, jobject _this, jlong con, // --------------------------------------------------------------------------- static void -nProgramBindConstants(JNIEnv *_env, jobject _this, jlong con, jint vpv, jint slot, jint a) +nProgramBindConstants(JNIEnv *_env, jobject _this, jlong con, jlong vpv, jint slot, jlong a) { LOG_API("nProgramBindConstants, con(%p), vpf(%p), sloat(%i), a(%p)", con, (RsProgramVertex)vpv, slot, (RsAllocation)a); rsProgramBindConstants((RsContext)con, (RsProgram)vpv, slot, (RsAllocation)a); } static void -nProgramBindTexture(JNIEnv *_env, jobject _this, jlong con, jint vpf, jint slot, jint a) +nProgramBindTexture(JNIEnv *_env, jobject _this, jlong con, jlong vpf, jint slot, jlong a) { LOG_API("nProgramBindTexture, con(%p), vpf(%p), slot(%i), a(%p)", con, (RsProgramFragment)vpf, slot, (RsAllocation)a); rsProgramBindTexture((RsContext)con, (RsProgramFragment)vpf, slot, (RsAllocation)a); } static void -nProgramBindSampler(JNIEnv *_env, jobject _this, jlong con, jint vpf, jint slot, jint a) +nProgramBindSampler(JNIEnv *_env, jobject _this, jlong con, jlong vpf, jint slot, jlong a) { LOG_API("nProgramBindSampler, con(%p), vpf(%p), slot(%i), a(%p)", con, (RsProgramFragment)vpf, slot, (RsSampler)a); rsProgramBindSampler((RsContext)con, (RsProgramFragment)vpf, slot, (RsSampler)a); @@ -1292,7 +1291,7 @@ nProgramBindSampler(JNIEnv *_env, jobject _this, jlong con, jint vpf, jint slot, // --------------------------------------------------------------------------- -static jint +static jlong nProgramFragmentCreate(JNIEnv *_env, jobject _this, jlong con, jstring shader, jobjectArray texNames, jintArray params) { @@ -1307,7 +1306,7 @@ nProgramFragmentCreate(JNIEnv *_env, jobject _this, jlong con, jstring shader, LOG_API("nProgramFragmentCreate, con(%p), paramLen(%i)", con, paramLen); - jint ret = (jint)rsProgramFragmentCreate((RsContext)con, shaderUTF.c_str(), shaderUTF.length(), + jlong ret = (jlong)rsProgramFragmentCreate((RsContext)con, shaderUTF.c_str(), shaderUTF.length(), nameArray, texCount, sizeArray, (uint32_t *)paramPtr, paramLen); @@ -1318,7 +1317,7 @@ nProgramFragmentCreate(JNIEnv *_env, jobject _this, jlong con, jstring shader, // --------------------------------------------------------------------------- -static jint +static jlong nProgramVertexCreate(JNIEnv *_env, jobject _this, jlong con, jstring shader, jobjectArray texNames, jintArray params) { @@ -1333,7 +1332,7 @@ nProgramVertexCreate(JNIEnv *_env, jobject _this, jlong con, jstring shader, const char ** nameArray = names.c_str(); size_t* sizeArray = names.c_str_len(); - jint ret = (jint)rsProgramVertexCreate((RsContext)con, shaderUTF.c_str(), shaderUTF.length(), + jlong ret = (jlong)rsProgramVertexCreate((RsContext)con, shaderUTF.c_str(), shaderUTF.length(), nameArray, texCount, sizeArray, (uint32_t *)paramPtr, paramLen); @@ -1343,7 +1342,7 @@ nProgramVertexCreate(JNIEnv *_env, jobject _this, jlong con, jstring shader, // --------------------------------------------------------------------------- -static jint +static jlong nProgramRasterCreate(JNIEnv *_env, jobject _this, jlong con, jboolean pointSprite, jint cull) { LOG_API("nProgramRasterCreate, con(%p), pointSprite(%i), cull(%i)", con, pointSprite, cull); @@ -1407,18 +1406,17 @@ nSamplerCreate(JNIEnv *_env, jobject _this, jlong con, jint magFilter, jint minF // --------------------------------------------------------------------------- -//native int rsnPathCreate(int con, int prim, boolean isStatic, int vtx, int loop, float q); -static jint -nPathCreate(JNIEnv *_env, jobject _this, jlong con, jint prim, jboolean isStatic, jint _vtx, jint _loop, jfloat q) { +static jlong +nPathCreate(JNIEnv *_env, jobject _this, jlong con, jint prim, jboolean isStatic, jlong _vtx, jint _loop, jfloat q) { LOG_API("nPathCreate, con(%p)", con); - int id = (int)rsPathCreate((RsContext)con, (RsPathPrimitive)prim, isStatic, - (RsAllocation)_vtx, - (RsAllocation)_loop, q); + jlong id = (jlong)rsPathCreate((RsContext)con, (RsPathPrimitive)prim, isStatic, + (RsAllocation)_vtx, + (RsAllocation)_loop, q); return id; } -static jint +static jlong nMeshCreate(JNIEnv *_env, jobject _this, jlong con, jintArray _vtx, jintArray _idx, jintArray _prim) { LOG_API("nMeshCreate, con(%p)", con); @@ -1442,7 +1440,7 @@ nMeshCreate(JNIEnv *_env, jobject _this, jlong con, jintArray _vtx, jintArray _i } static jint -nMeshGetVertexBufferCount(JNIEnv *_env, jobject _this, jlong con, jint mesh) +nMeshGetVertexBufferCount(JNIEnv *_env, jobject _this, jlong con, jlong mesh) { LOG_API("nMeshGetVertexBufferCount, con(%p), Mesh(%p)", con, (RsMesh)mesh); jint vtxCount = 0; @@ -1451,7 +1449,7 @@ nMeshGetVertexBufferCount(JNIEnv *_env, jobject _this, jlong con, jint mesh) } static jint -nMeshGetIndexCount(JNIEnv *_env, jobject _this, jlong con, jint mesh) +nMeshGetIndexCount(JNIEnv *_env, jobject _this, jlong con, jlong mesh) { LOG_API("nMeshGetIndexCount, con(%p), Mesh(%p)", con, (RsMesh)mesh); jint idxCount = 0; @@ -1460,7 +1458,7 @@ nMeshGetIndexCount(JNIEnv *_env, jobject _this, jlong con, jint mesh) } static void -nMeshGetVertices(JNIEnv *_env, jobject _this, jlong con, jint mesh, jintArray _ids, int numVtxIDs) +nMeshGetVertices(JNIEnv *_env, jobject _this, jlong con, jlong mesh, jintArray _ids, int numVtxIDs) { LOG_API("nMeshGetVertices, con(%p), Mesh(%p)", con, (RsMesh)mesh); @@ -1475,7 +1473,7 @@ nMeshGetVertices(JNIEnv *_env, jobject _this, jlong con, jint mesh, jintArray _i } static void -nMeshGetIndices(JNIEnv *_env, jobject _this, jlong con, jint mesh, jintArray _idxIds, jintArray _primitives, int numIndices) +nMeshGetIndices(JNIEnv *_env, jobject _this, jlong con, jlong mesh, jintArray _idxIds, jintArray _primitives, int numIndices) { LOG_API("nMeshGetVertices, con(%p), Mesh(%p)", con, (RsMesh)mesh); @@ -1523,94 +1521,94 @@ static JNINativeMethod methods[] = { {"rsnContextPause", "(J)V", (void*)nContextPause }, {"rsnContextResume", "(J)V", (void*)nContextResume }, {"rsnContextSendMessage", "(JI[I)V", (void*)nContextSendMessage }, -{"rsnAssignName", "(JI[B)V", (void*)nAssignName }, -{"rsnGetName", "(JI)Ljava/lang/String;", (void*)nGetName }, -{"rsnObjDestroy", "(JI)V", (void*)nObjDestroy }, +{"rsnAssignName", "(JJ[B)V", (void*)nAssignName }, +{"rsnGetName", "(JJ)Ljava/lang/String;", (void*)nGetName }, +{"rsnObjDestroy", "(JJ)V", (void*)nObjDestroy }, -{"rsnFileA3DCreateFromFile", "(JLjava/lang/String;)I", (void*)nFileA3DCreateFromFile }, -{"rsnFileA3DCreateFromAssetStream", "(JI)I", (void*)nFileA3DCreateFromAssetStream }, -{"rsnFileA3DCreateFromAsset", "(JLandroid/content/res/AssetManager;Ljava/lang/String;)I", (void*)nFileA3DCreateFromAsset }, -{"rsnFileA3DGetNumIndexEntries", "(JI)I", (void*)nFileA3DGetNumIndexEntries }, -{"rsnFileA3DGetIndexEntries", "(JII[I[Ljava/lang/String;)V", (void*)nFileA3DGetIndexEntries }, -{"rsnFileA3DGetEntryByIndex", "(JII)I", (void*)nFileA3DGetEntryByIndex }, +{"rsnFileA3DCreateFromFile", "(JLjava/lang/String;)J", (void*)nFileA3DCreateFromFile }, +{"rsnFileA3DCreateFromAssetStream", "(JI)J", (void*)nFileA3DCreateFromAssetStream }, +{"rsnFileA3DCreateFromAsset", "(JLandroid/content/res/AssetManager;Ljava/lang/String;)J", (void*)nFileA3DCreateFromAsset }, +{"rsnFileA3DGetNumIndexEntries", "(JJ)I", (void*)nFileA3DGetNumIndexEntries }, +{"rsnFileA3DGetIndexEntries", "(JJI[I[Ljava/lang/String;)V", (void*)nFileA3DGetIndexEntries }, +{"rsnFileA3DGetEntryByIndex", "(JJI)I", (void*)nFileA3DGetEntryByIndex }, {"rsnFontCreateFromFile", "(JLjava/lang/String;FI)I", (void*)nFontCreateFromFile }, {"rsnFontCreateFromAssetStream", "(JLjava/lang/String;FII)I", (void*)nFontCreateFromAssetStream }, {"rsnFontCreateFromAsset", "(JLandroid/content/res/AssetManager;Ljava/lang/String;FI)I", (void*)nFontCreateFromAsset }, -{"rsnElementCreate", "(JIIZI)I", (void*)nElementCreate }, -{"rsnElementCreate2", "(J[I[Ljava/lang/String;[I)I", (void*)nElementCreate2 }, -{"rsnElementGetNativeData", "(JI[I)V", (void*)nElementGetNativeData }, -{"rsnElementGetSubElements", "(JI[I[Ljava/lang/String;[I)V", (void*)nElementGetSubElements }, - -{"rsnTypeCreate", "(JIIIIZZI)I", (void*)nTypeCreate }, -{"rsnTypeGetNativeData", "(JI[I)V", (void*)nTypeGetNativeData }, - -{"rsnAllocationCreateTyped", "(JIIII)I", (void*)nAllocationCreateTyped }, -{"rsnAllocationCreateFromBitmap", "(JIILandroid/graphics/Bitmap;I)I", (void*)nAllocationCreateFromBitmap }, -{"rsnAllocationCreateBitmapBackedAllocation", "(JIILandroid/graphics/Bitmap;I)I", (void*)nAllocationCreateBitmapBackedAllocation }, -{"rsnAllocationCubeCreateFromBitmap","(JIILandroid/graphics/Bitmap;I)I", (void*)nAllocationCubeCreateFromBitmap }, - -{"rsnAllocationCopyFromBitmap", "(JILandroid/graphics/Bitmap;)V", (void*)nAllocationCopyFromBitmap }, -{"rsnAllocationCopyToBitmap", "(JILandroid/graphics/Bitmap;)V", (void*)nAllocationCopyToBitmap }, - -{"rsnAllocationSyncAll", "(JII)V", (void*)nAllocationSyncAll }, -{"rsnAllocationGetSurface", "(JI)Landroid/view/Surface;", (void*)nAllocationGetSurface }, -{"rsnAllocationSetSurface", "(JILandroid/view/Surface;)V", (void*)nAllocationSetSurface }, -{"rsnAllocationIoSend", "(JI)V", (void*)nAllocationIoSend }, -{"rsnAllocationIoReceive", "(JI)V", (void*)nAllocationIoReceive }, -{"rsnAllocationData1D", "(JIIIILjava/lang/Object;II)V", (void*)nAllocationData1D }, -{"rsnAllocationElementData1D", "(JIIII[BI)V", (void*)nAllocationElementData1D }, -{"rsnAllocationData2D", "(JIIIIIIILjava/lang/Object;II)V", (void*)nAllocationData2D }, -{"rsnAllocationData2D", "(JIIIIIIIIIIII)V", (void*)nAllocationData2D_alloc }, -{"rsnAllocationData3D", "(JIIIIIIIILjava/lang/Object;II)V", (void*)nAllocationData3D }, -{"rsnAllocationData3D", "(JIIIIIIIIIIIII)V", (void*)nAllocationData3D_alloc }, -{"rsnAllocationRead", "(JILjava/lang/Object;I)V", (void*)nAllocationRead }, -{"rsnAllocationRead1D", "(JIIIILjava/lang/Object;II)V", (void*)nAllocationRead1D }, -{"rsnAllocationRead2D", "(JIIIIIIILjava/lang/Object;II)V", (void*)nAllocationRead2D }, -{"rsnAllocationGetType", "(JI)I", (void*)nAllocationGetType}, -{"rsnAllocationResize1D", "(JII)V", (void*)nAllocationResize1D }, -{"rsnAllocationGenerateMipmaps", "(JI)V", (void*)nAllocationGenerateMipmaps }, - -{"rsnScriptBindAllocation", "(JIII)V", (void*)nScriptBindAllocation }, -{"rsnScriptSetTimeZone", "(JI[B)V", (void*)nScriptSetTimeZone }, -{"rsnScriptInvoke", "(JII)V", (void*)nScriptInvoke }, -{"rsnScriptInvokeV", "(JII[B)V", (void*)nScriptInvokeV }, -{"rsnScriptForEach", "(JIIII)V", (void*)nScriptForEach }, -{"rsnScriptForEach", "(JIIII[B)V", (void*)nScriptForEachV }, -{"rsnScriptForEachClipped", "(JIIIIIIIIII)V", (void*)nScriptForEachClipped }, -{"rsnScriptForEachClipped", "(JIIII[BIIIIII)V", (void*)nScriptForEachClippedV }, -{"rsnScriptSetVarI", "(JIII)V", (void*)nScriptSetVarI }, -{"rsnScriptGetVarI", "(JII)I", (void*)nScriptGetVarI }, -{"rsnScriptSetVarJ", "(JIIJ)V", (void*)nScriptSetVarJ }, -{"rsnScriptGetVarJ", "(JII)J", (void*)nScriptGetVarJ }, -{"rsnScriptSetVarF", "(JIIF)V", (void*)nScriptSetVarF }, -{"rsnScriptGetVarF", "(JII)F", (void*)nScriptGetVarF }, -{"rsnScriptSetVarD", "(JIID)V", (void*)nScriptSetVarD }, -{"rsnScriptGetVarD", "(JII)D", (void*)nScriptGetVarD }, -{"rsnScriptSetVarV", "(JII[B)V", (void*)nScriptSetVarV }, -{"rsnScriptGetVarV", "(JII[B)V", (void*)nScriptGetVarV }, -{"rsnScriptSetVarVE", "(JII[BI[I)V", (void*)nScriptSetVarVE }, -{"rsnScriptSetVarObj", "(JIII)V", (void*)nScriptSetVarObj }, +{"rsnElementCreate", "(JJIZI)J", (void*)nElementCreate }, +{"rsnElementCreate2", "(J[I[Ljava/lang/String;[I)J", (void*)nElementCreate2 }, +{"rsnElementGetNativeData", "(JJ[I)V", (void*)nElementGetNativeData }, +{"rsnElementGetSubElements", "(JJ[I[Ljava/lang/String;[I)V", (void*)nElementGetSubElements }, + +{"rsnTypeCreate", "(JJIIIZZI)J", (void*)nTypeCreate }, +{"rsnTypeGetNativeData", "(JJ[I)V", (void*)nTypeGetNativeData }, + +{"rsnAllocationCreateTyped", "(JJIII)J", (void*)nAllocationCreateTyped }, +{"rsnAllocationCreateFromBitmap", "(JJILandroid/graphics/Bitmap;I)J", (void*)nAllocationCreateFromBitmap }, +{"rsnAllocationCreateBitmapBackedAllocation", "(JJILandroid/graphics/Bitmap;I)J", (void*)nAllocationCreateBitmapBackedAllocation }, +{"rsnAllocationCubeCreateFromBitmap","(JJILandroid/graphics/Bitmap;I)J", (void*)nAllocationCubeCreateFromBitmap }, + +{"rsnAllocationCopyFromBitmap", "(JJLandroid/graphics/Bitmap;)V", (void*)nAllocationCopyFromBitmap }, +{"rsnAllocationCopyToBitmap", "(JJLandroid/graphics/Bitmap;)V", (void*)nAllocationCopyToBitmap }, + +{"rsnAllocationSyncAll", "(JJI)V", (void*)nAllocationSyncAll }, +{"rsnAllocationGetSurface", "(JJ)Landroid/view/Surface;", (void*)nAllocationGetSurface }, +{"rsnAllocationSetSurface", "(JJLandroid/view/Surface;)V", (void*)nAllocationSetSurface }, +{"rsnAllocationIoSend", "(JJ)V", (void*)nAllocationIoSend }, +{"rsnAllocationIoReceive", "(JJ)V", (void*)nAllocationIoReceive }, +{"rsnAllocationData1D", "(JJIIILjava/lang/Object;II)V", (void*)nAllocationData1D }, +{"rsnAllocationElementData1D", "(JJIII[BI)V", (void*)nAllocationElementData1D }, +{"rsnAllocationData2D", "(JJIIIIIILjava/lang/Object;II)V", (void*)nAllocationData2D }, +{"rsnAllocationData2D", "(JJIIIIIIJIIII)V", (void*)nAllocationData2D_alloc }, +{"rsnAllocationData3D", "(JJIIIIIIILjava/lang/Object;II)V", (void*)nAllocationData3D }, +{"rsnAllocationData3D", "(JJIIIIIIIJIIII)V", (void*)nAllocationData3D_alloc }, +{"rsnAllocationRead", "(JJLjava/lang/Object;I)V", (void*)nAllocationRead }, +{"rsnAllocationRead1D", "(JJIIILjava/lang/Object;II)V", (void*)nAllocationRead1D }, +{"rsnAllocationRead2D", "(JJIIIIIILjava/lang/Object;II)V", (void*)nAllocationRead2D }, +{"rsnAllocationGetType", "(JJ)J", (void*)nAllocationGetType}, +{"rsnAllocationResize1D", "(JJI)V", (void*)nAllocationResize1D }, +{"rsnAllocationGenerateMipmaps", "(JJ)V", (void*)nAllocationGenerateMipmaps }, + +{"rsnScriptBindAllocation", "(JJJI)V", (void*)nScriptBindAllocation }, +{"rsnScriptSetTimeZone", "(JJ[B)V", (void*)nScriptSetTimeZone }, +{"rsnScriptInvoke", "(JJI)V", (void*)nScriptInvoke }, +{"rsnScriptInvokeV", "(JJI[B)V", (void*)nScriptInvokeV }, +{"rsnScriptForEach", "(JJIJJ)V", (void*)nScriptForEach }, +{"rsnScriptForEach", "(JJIJJ[B)V", (void*)nScriptForEachV }, +{"rsnScriptForEachClipped", "(JJIJJIIIIII)V", (void*)nScriptForEachClipped }, +{"rsnScriptForEachClipped", "(JJIJJ[BIIIIII)V", (void*)nScriptForEachClippedV }, +{"rsnScriptSetVarI", "(JJII)V", (void*)nScriptSetVarI }, +{"rsnScriptGetVarI", "(JJI)I", (void*)nScriptGetVarI }, +{"rsnScriptSetVarJ", "(JJIJ)V", (void*)nScriptSetVarJ }, +{"rsnScriptGetVarJ", "(JJI)J", (void*)nScriptGetVarJ }, +{"rsnScriptSetVarF", "(JJIF)V", (void*)nScriptSetVarF }, +{"rsnScriptGetVarF", "(JJI)F", (void*)nScriptGetVarF }, +{"rsnScriptSetVarD", "(JJID)V", (void*)nScriptSetVarD }, +{"rsnScriptGetVarD", "(JJI)D", (void*)nScriptGetVarD }, +{"rsnScriptSetVarV", "(JJI[B)V", (void*)nScriptSetVarV }, +{"rsnScriptGetVarV", "(JJI[B)V", (void*)nScriptGetVarV }, +{"rsnScriptSetVarVE", "(JJI[BJ[I)V", (void*)nScriptSetVarVE }, +{"rsnScriptSetVarObj", "(JJIJ)V", (void*)nScriptSetVarObj }, {"rsnScriptCCreate", "(JLjava/lang/String;Ljava/lang/String;[BI)I", (void*)nScriptCCreate }, -{"rsnScriptIntrinsicCreate", "(JII)I", (void*)nScriptIntrinsicCreate }, -{"rsnScriptKernelIDCreate", "(JIII)I", (void*)nScriptKernelIDCreate }, -{"rsnScriptFieldIDCreate", "(JII)I", (void*)nScriptFieldIDCreate }, -{"rsnScriptGroupCreate", "(J[I[I[I[I[I)I", (void*)nScriptGroupCreate }, -{"rsnScriptGroupSetInput", "(JIII)V", (void*)nScriptGroupSetInput }, -{"rsnScriptGroupSetOutput", "(JIII)V", (void*)nScriptGroupSetOutput }, -{"rsnScriptGroupExecute", "(JI)V", (void*)nScriptGroupExecute }, +{"rsnScriptIntrinsicCreate", "(JIJ)J", (void*)nScriptIntrinsicCreate }, +{"rsnScriptKernelIDCreate", "(JJII)J", (void*)nScriptKernelIDCreate }, +{"rsnScriptFieldIDCreate", "(JJI)J", (void*)nScriptFieldIDCreate }, +{"rsnScriptGroupCreate", "(J[I[I[I[I[I)J", (void*)nScriptGroupCreate }, +{"rsnScriptGroupSetInput", "(JJJJ)V", (void*)nScriptGroupSetInput }, +{"rsnScriptGroupSetOutput", "(JJJJ)V", (void*)nScriptGroupSetOutput }, +{"rsnScriptGroupExecute", "(JJ)V", (void*)nScriptGroupExecute }, {"rsnProgramStoreCreate", "(JZZZZZZIII)I", (void*)nProgramStoreCreate }, -{"rsnProgramBindConstants", "(JIII)V", (void*)nProgramBindConstants }, -{"rsnProgramBindTexture", "(JIII)V", (void*)nProgramBindTexture }, -{"rsnProgramBindSampler", "(JIII)V", (void*)nProgramBindSampler }, +{"rsnProgramBindConstants", "(JJIJ)V", (void*)nProgramBindConstants }, +{"rsnProgramBindTexture", "(JJIJ)V", (void*)nProgramBindTexture }, +{"rsnProgramBindSampler", "(JJIJ)V", (void*)nProgramBindSampler }, -{"rsnProgramFragmentCreate", "(JLjava/lang/String;[Ljava/lang/String;[I)I", (void*)nProgramFragmentCreate }, -{"rsnProgramRasterCreate", "(JZI)I", (void*)nProgramRasterCreate }, -{"rsnProgramVertexCreate", "(JLjava/lang/String;[Ljava/lang/String;[I)I", (void*)nProgramVertexCreate }, +{"rsnProgramFragmentCreate", "(JLjava/lang/String;[Ljava/lang/String;[I)J", (void*)nProgramFragmentCreate }, +{"rsnProgramRasterCreate", "(JZI)J", (void*)nProgramRasterCreate }, +{"rsnProgramVertexCreate", "(JLjava/lang/String;[Ljava/lang/String;[I)J", (void*)nProgramVertexCreate }, {"rsnContextBindRootScript", "(JI)V", (void*)nContextBindRootScript }, {"rsnContextBindProgramStore", "(JI)V", (void*)nContextBindProgramStore }, @@ -1620,13 +1618,13 @@ static JNINativeMethod methods[] = { {"rsnSamplerCreate", "(JIIIIIF)I", (void*)nSamplerCreate }, -{"rsnPathCreate", "(JIZIIF)I", (void*)nPathCreate }, -{"rsnMeshCreate", "(J[I[I[I)I", (void*)nMeshCreate }, +{"rsnPathCreate", "(JIZJIF)J", (void*)nPathCreate }, +{"rsnMeshCreate", "(J[I[I[I)J", (void*)nMeshCreate }, -{"rsnMeshGetVertexBufferCount", "(JI)I", (void*)nMeshGetVertexBufferCount }, -{"rsnMeshGetIndexCount", "(JI)I", (void*)nMeshGetIndexCount }, -{"rsnMeshGetVertices", "(JI[II)V", (void*)nMeshGetVertices }, -{"rsnMeshGetIndices", "(JI[I[II)V", (void*)nMeshGetIndices }, +{"rsnMeshGetVertexBufferCount", "(JJ)I", (void*)nMeshGetVertexBufferCount }, +{"rsnMeshGetIndexCount", "(JJ)I", (void*)nMeshGetIndexCount }, +{"rsnMeshGetVertices", "(JJ[II)V", (void*)nMeshGetVertices }, +{"rsnMeshGetIndices", "(JJ[I[II)V", (void*)nMeshGetIndices }, }; -- cgit v1.1