From 18b4cbeedef21c1fa666a110a157bab66edff976 Mon Sep 17 00:00:00 2001 From: Ashok Bhat Date: Mon, 20 Jan 2014 20:08:01 +0000 Subject: AArch64: Make graphics classes 64-bit compatible MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This a merger of two commits submitted to AOSP by the following authors: ashok.bhat@arm.com, david.butcher@arm.coma craig.barber@arm.com, kevin.petit@arm.com and marcus.oakland@arm.com Due to the very large number of internal conflicts, I have chosen to cherry-pick this change instead of letting it merge through AOSP because the merge conflict resolution would be very hard to review. Commit messages below: ================================================ 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. Signed-off-by: Ashok Bhat Signed-off-by: Craig Barber Signed-off-by: Kévin PETIT Signed-off-by: Marcus Oakland ================================================================== AArch64: Use long for pointers in graphics/Camera For storing pointers, long is used in android/graphics/Camera class, as native pointers can be 64-bit. In addition, some minor changes have been done to conform with standard JNI practice (e.g. use of jint instead of int in JNI function prototypes) Signed-off-by: Ashok Bhat Signed-off-by: Marcus Oakland =================================================================== Change-Id: Ib3eab85ed97ea3e3c227617c20f8d213f17d4ba0 --- core/jni/android/graphics/LayerRasterizer.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'core/jni/android/graphics/LayerRasterizer.cpp') diff --git a/core/jni/android/graphics/LayerRasterizer.cpp b/core/jni/android/graphics/LayerRasterizer.cpp index e5bc6f8..29e7db1 100644 --- a/core/jni/android/graphics/LayerRasterizer.cpp +++ b/core/jni/android/graphics/LayerRasterizer.cpp @@ -3,11 +3,13 @@ class SkLayerRasterizerGlue { public: - static SkRasterizer* create(JNIEnv* env, jobject) { - return new SkLayerRasterizer(); + static jlong create(JNIEnv* env, jobject) { + return reinterpret_cast(new SkLayerRasterizer()); } - static void addLayer(JNIEnv* env, jobject, SkLayerRasterizer* layer, const SkPaint* paint, float dx, float dy) { + static void addLayer(JNIEnv* env, jobject, jlong layerHandle, jlong paintHandle, jfloat dx, jfloat dy) { + SkLayerRasterizer* layer = reinterpret_cast(layerHandle); + const SkPaint* paint = reinterpret_cast(paintHandle); SkASSERT(layer); SkASSERT(paint); layer->addLayer(*paint, SkFloatToScalar(dx), SkFloatToScalar(dy)); @@ -19,8 +21,8 @@ public: #include static JNINativeMethod gLayerRasterizerMethods[] = { - { "nativeConstructor", "()I", (void*)SkLayerRasterizerGlue::create }, - { "nativeAddLayer", "(IIFF)V", (void*)SkLayerRasterizerGlue::addLayer } + { "nativeConstructor", "()J", (void*)SkLayerRasterizerGlue::create }, + { "nativeAddLayer", "(JJFF)V", (void*)SkLayerRasterizerGlue::addLayer } }; int register_android_graphics_LayerRasterizer(JNIEnv* env) -- cgit v1.1