diff options
author | Ashok Bhat <ashok.bhat@arm.com> | 2014-02-04 14:57:58 +0000 |
---|---|---|
committer | David Butcher <david.butcher@arm.com> | 2014-02-05 11:26:38 +0000 |
commit | 0e0c0885aed99a119052a792becb5a0c5a93632d (patch) | |
tree | 8d8740c998f7ab145266cb91b87a87384672d71b /rs/java/android/renderscript/Font.java | |
parent | bc80e40b160596c262fee0ee4df4b9f15cc14e89 (diff) | |
download | frameworks_base-0e0c0885aed99a119052a792becb5a0c5a93632d.zip frameworks_base-0e0c0885aed99a119052a792becb5a0c5a93632d.tar.gz frameworks_base-0e0c0885aed99a119052a792becb5a0c5a93632d.tar.bz2 |
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 <ashok.bhat@arm.com>
Diffstat (limited to 'rs/java/android/renderscript/Font.java')
-rw-r--r-- | rs/java/android/renderscript/Font.java | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/rs/java/android/renderscript/Font.java b/rs/java/android/renderscript/Font.java index 0375d2b..cfd11c0 100644 --- a/rs/java/android/renderscript/Font.java +++ b/rs/java/android/renderscript/Font.java @@ -151,7 +151,7 @@ public class Font extends BaseObj { return "DroidSans.ttf"; } - Font(int id, RenderScript rs) { + Font(long id, RenderScript rs) { super(id, rs); } @@ -162,7 +162,7 @@ public class Font extends BaseObj { static public Font createFromFile(RenderScript rs, Resources res, String path, float pointSize) { rs.validate(); int dpi = res.getDisplayMetrics().densityDpi; - int fontId = rs.nFontCreateFromFile(path, pointSize, dpi); + long fontId = rs.nFontCreateFromFile(path, pointSize, dpi); if(fontId == 0) { throw new RSRuntimeException("Unable to create font from file " + path); @@ -187,7 +187,7 @@ public class Font extends BaseObj { AssetManager mgr = res.getAssets(); int dpi = res.getDisplayMetrics().densityDpi; - int fontId = rs.nFontCreateFromAsset(mgr, path, pointSize, dpi); + long fontId = rs.nFontCreateFromAsset(mgr, path, pointSize, dpi); if(fontId == 0) { throw new RSRuntimeException("Unable to create font from asset " + path); } @@ -211,9 +211,9 @@ public class Font extends BaseObj { int dpi = res.getDisplayMetrics().densityDpi; - int fontId = 0; + long fontId = 0; if (is instanceof AssetManager.AssetInputStream) { - int asset = ((AssetManager.AssetInputStream) is).getAssetInt(); + long asset = ((AssetManager.AssetInputStream) is).getNativeAsset(); fontId = rs.nFontCreateFromAssetStream(name, pointSize, dpi, asset); } else { throw new RSRuntimeException("Unsupported asset stream created"); |