From 0e0c0885aed99a119052a792becb5a0c5a93632d Mon Sep 17 00:00:00 2001 From: Ashok Bhat Date: Tue, 4 Feb 2014 14:57:58 +0000 Subject: AArch64: Use long for pointers in RS Java/JNI code Changes include [x] Some JNI functions, with return type jlong, casts pointer to jint before returning it. This has been fixed. [x] Minor JNI function prototype changes where formal paramter type has been changed to a JNI type (int to jint for example). [x] long is used for ScriptC, Sampler, Font, ProgramStore handles as they can be 64-bit. [x] A new hidden constructor ScriptC(long, RenderScript) has been added. This should eventually replace public API method ScriptC(int, RenderScript). [x] Font and FileA3D use getNativeAsset instead of getAssetInt to get Asset Handles. The getAssetInt method will be deprecated in favor of getNativeAsset, as the former does not support 64-bit. [x] rsnPathCreate method accepts loop as an int. This should be long as the underlying RS function assumes this to be a pointer. Change-Id: I919d857e5933febe63966049da83de9f9adee6f5 Signed-off-by: Ashok Bhat --- rs/java/android/renderscript/ScriptC.java | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'rs/java/android/renderscript/ScriptC.java') diff --git a/rs/java/android/renderscript/ScriptC.java b/rs/java/android/renderscript/ScriptC.java index b0a5759325af..cdb2b0811c68 100644 --- a/rs/java/android/renderscript/ScriptC.java +++ b/rs/java/android/renderscript/ScriptC.java @@ -45,7 +45,17 @@ public class ScriptC extends Script { protected ScriptC(int id, RenderScript rs) { super(id, rs); } - + /** + * Only intended for use by the generated derived classes. + * + * @param id + * @param rs + * + * @hide + */ + protected ScriptC(long id, RenderScript rs) { + super(id, rs); + } /** * Only intended for use by the generated derived classes. * @@ -56,7 +66,7 @@ public class ScriptC extends Script { */ protected ScriptC(RenderScript rs, Resources resources, int resourceID) { super(0, rs); - int id = internalCreate(rs, resources, resourceID); + long id = internalCreate(rs, resources, resourceID); if (id == 0) { throw new RSRuntimeException("Loading of ScriptC script failed."); } @@ -70,7 +80,7 @@ public class ScriptC extends Script { static String mCachePath; - private static synchronized int internalCreate(RenderScript rs, Resources resources, int resourceID) { + private static synchronized long internalCreate(RenderScript rs, Resources resources, int resourceID) { byte[] pgm; int pgmLength; InputStream is = resources.openRawResource(resourceID); -- cgit v1.2.3