diff options
author | Tim Murray <timmurray@google.com> | 2013-11-19 12:45:54 -0800 |
---|---|---|
committer | Tim Murray <timmurray@google.com> | 2013-11-20 10:18:04 -0800 |
commit | 460a04971c494fec39ffcb38e873bb8fdd82d113 (patch) | |
tree | b1567d93e44eec510a0c3adcd9bacd6f2542a860 /graphics/java/android/renderscript | |
parent | eff663f391fa4f119685d5c14489b94661ea126f (diff) | |
download | frameworks_base-460a04971c494fec39ffcb38e873bb8fdd82d113.zip frameworks_base-460a04971c494fec39ffcb38e873bb8fdd82d113.tar.gz frameworks_base-460a04971c494fec39ffcb38e873bb8fdd82d113.tar.bz2 |
Convert Java/JNI to 64-bit, part 2.
This changes BaseObj to support 64-bit IDs. There are a few caveats:
1. Since it is deprecated, RSG will not support 64-bit.
2. Currently, methods that pass arrays of IDs to the driver are not supported in 64-bit. This will be fixed in a later CL.
bug 11332320
Change-Id: If0dbecc8b285e260f767e441e05088b6a1b749a2
Diffstat (limited to 'graphics/java/android/renderscript')
29 files changed, 297 insertions, 289 deletions
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<Integer, Allocation> mAllocationMap = - new HashMap<Integer, Allocation>(); + static HashMap<Long, Allocation> mAllocationMap = + new HashMap<Long, Allocation>(); 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; |