summaryrefslogtreecommitdiffstats
path: root/graphics/jni
diff options
context:
space:
mode:
authorAshok Bhat <ashok.bhat@arm.com>2014-01-20 20:08:01 +0000
committerNarayan Kamath <narayan@google.com>2014-01-28 17:40:38 +0000
commita0398430fcf365fba6e42ad0bdca2fbf45ed6fe0 (patch)
treef263a4baa0ab7b4e7e0101075f1e85768b3d7ba1 /graphics/jni
parent1ff4293e33f98e6dc19e4f154cb497af9bd88c9d (diff)
downloadframeworks_base-a0398430fcf365fba6e42ad0bdca2fbf45ed6fe0.zip
frameworks_base-a0398430fcf365fba6e42ad0bdca2fbf45ed6fe0.tar.gz
frameworks_base-a0398430fcf365fba6e42ad0bdca2fbf45ed6fe0.tar.bz2
AArch64: Make graphics classes 64-bit compatible
Changes in this patch include [x] Long is used to store native pointers as they can be 64-bit. [x] Some minor changes have been done to conform with standard JNI practice (e.g. use of jint instead of int in JNI function prototypes) [x] AssetAtlasManager is not completely 64-bit compatible yet. Specifically mAtlasMap member has to be converted to hold native pointer using long. Added a TODO to AssetAtlasManager.java to indicate the change required. Change-Id: I940433f601c6db998c1a8ffff338f5361200d5ed Signed-off-by: Ashok Bhat <ashok.bhat@arm.com> Signed-off-by: Craig Barber <craig.barber@arm.com> Signed-off-by: Kévin PETIT <kevin.petit@arm.com> Signed-off-by: Marcus Oakland <marcus.oakland@arm.com>
Diffstat (limited to 'graphics/jni')
-rw-r--r--graphics/jni/android_renderscript_RenderScript.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/graphics/jni/android_renderscript_RenderScript.cpp b/graphics/jni/android_renderscript_RenderScript.cpp
index a4221dc..aa16951 100644
--- a/graphics/jni/android_renderscript_RenderScript.cpp
+++ b/graphics/jni/android_renderscript_RenderScript.cpp
@@ -116,7 +116,7 @@ static void _nInit(JNIEnv *_env, jclass _this)
gContextId = _env->GetFieldID(_this, "mContext", "I");
jclass bitmapClass = _env->FindClass("android/graphics/Bitmap");
- gNativeBitmapID = _env->GetFieldID(bitmapClass, "mNativeBitmap", "I");
+ gNativeBitmapID = _env->GetFieldID(bitmapClass, "mNativeBitmap", "J");
}
// ---------------------------------------------------------------------------
@@ -522,7 +522,7 @@ static int
nAllocationCreateFromBitmap(JNIEnv *_env, jobject _this, RsContext con, jint type, jint mip, jobject jbitmap, jint usage)
{
SkBitmap const * nativeBitmap =
- (SkBitmap const *)_env->GetIntField(jbitmap, gNativeBitmapID);
+ (SkBitmap const *)_env->GetLongField(jbitmap, gNativeBitmapID);
const SkBitmap& bitmap(*nativeBitmap);
bitmap.lockPixels();
@@ -538,7 +538,7 @@ static int
nAllocationCreateBitmapBackedAllocation(JNIEnv *_env, jobject _this, RsContext con, jint type, jint mip, jobject jbitmap, jint usage)
{
SkBitmap const * nativeBitmap =
- (SkBitmap const *)_env->GetIntField(jbitmap, gNativeBitmapID);
+ (SkBitmap const *)_env->GetLongField(jbitmap, gNativeBitmapID);
const SkBitmap& bitmap(*nativeBitmap);
bitmap.lockPixels();
@@ -554,7 +554,7 @@ static int
nAllocationCubeCreateFromBitmap(JNIEnv *_env, jobject _this, RsContext con, jint type, jint mip, jobject jbitmap, jint usage)
{
SkBitmap const * nativeBitmap =
- (SkBitmap const *)_env->GetIntField(jbitmap, gNativeBitmapID);
+ (SkBitmap const *)_env->GetLongField(jbitmap, gNativeBitmapID);
const SkBitmap& bitmap(*nativeBitmap);
bitmap.lockPixels();
@@ -570,7 +570,7 @@ static void
nAllocationCopyFromBitmap(JNIEnv *_env, jobject _this, RsContext con, jint alloc, jobject jbitmap)
{
SkBitmap const * nativeBitmap =
- (SkBitmap const *)_env->GetIntField(jbitmap, gNativeBitmapID);
+ (SkBitmap const *)_env->GetLongField(jbitmap, gNativeBitmapID);
const SkBitmap& bitmap(*nativeBitmap);
int w = bitmap.width();
int h = bitmap.height();
@@ -587,7 +587,7 @@ static void
nAllocationCopyToBitmap(JNIEnv *_env, jobject _this, RsContext con, jint alloc, jobject jbitmap)
{
SkBitmap const * nativeBitmap =
- (SkBitmap const *)_env->GetIntField(jbitmap, gNativeBitmapID);
+ (SkBitmap const *)_env->GetLongField(jbitmap, gNativeBitmapID);
const SkBitmap& bitmap(*nativeBitmap);
bitmap.lockPixels();