diff options
author | Ashok Bhat <ashok.bhat@arm.com> | 2014-01-20 20:08:01 +0000 |
---|---|---|
committer | Narayan Kamath <narayan@google.com> | 2014-01-28 17:40:38 +0000 |
commit | a0398430fcf365fba6e42ad0bdca2fbf45ed6fe0 (patch) | |
tree | f263a4baa0ab7b4e7e0101075f1e85768b3d7ba1 /graphics/java/android/graphics/Bitmap.java | |
parent | 1ff4293e33f98e6dc19e4f154cb497af9bd88c9d (diff) | |
download | frameworks_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/java/android/graphics/Bitmap.java')
-rw-r--r-- | graphics/java/android/graphics/Bitmap.java | 62 |
1 files changed, 31 insertions, 31 deletions
diff --git a/graphics/java/android/graphics/Bitmap.java b/graphics/java/android/graphics/Bitmap.java index 3c24683..efce606 100644 --- a/graphics/java/android/graphics/Bitmap.java +++ b/graphics/java/android/graphics/Bitmap.java @@ -41,7 +41,7 @@ public final class Bitmap implements Parcelable { * * @hide */ - public final int mNativeBitmap; + public final long mNativeBitmap; /** * Backing buffer for the Bitmap. @@ -103,7 +103,7 @@ public final class Bitmap implements Parcelable { * int (pointer). */ @SuppressWarnings({"UnusedDeclaration"}) // called from JNI - Bitmap(int nativeBitmap, byte[] buffer, int width, int height, int density, + Bitmap(long nativeBitmap, byte[] buffer, int width, int height, int density, boolean isMutable, boolean isPremultiplied, byte[] ninePatchChunk, int[] layoutBounds) { if (nativeBitmap == 0) { @@ -1511,7 +1511,7 @@ public final class Bitmap implements Parcelable { */ public Bitmap extractAlpha(Paint paint, int[] offsetXY) { checkRecycled("Can't extractAlpha on a recycled bitmap"); - int nativePaint = paint != null ? paint.mNativePaint : 0; + long nativePaint = paint != null ? paint.mNativePaint : 0; Bitmap bm = nativeExtractAlpha(mNativeBitmap, nativePaint, offsetXY); if (bm == null) { throw new RuntimeException("Failed to extractAlpha on Bitmap"); @@ -1545,9 +1545,9 @@ public final class Bitmap implements Parcelable { } private static class BitmapFinalizer { - private final int mNativeBitmap; + private final long mNativeBitmap; - BitmapFinalizer(int nativeBitmap) { + BitmapFinalizer(long nativeBitmap) { mNativeBitmap = nativeBitmap; } @@ -1568,55 +1568,55 @@ public final class Bitmap implements Parcelable { private static native Bitmap nativeCreate(int[] colors, int offset, int stride, int width, int height, int nativeConfig, boolean mutable); - private static native Bitmap nativeCopy(int srcBitmap, int nativeConfig, + private static native Bitmap nativeCopy(long nativeSrcBitmap, int nativeConfig, boolean isMutable); - private static native void nativeDestructor(int nativeBitmap); - private static native boolean nativeRecycle(int nativeBitmap); - private static native void nativeReconfigure(int nativeBitmap, int width, int height, + private static native void nativeDestructor(long nativeBitmap); + private static native boolean nativeRecycle(long nativeBitmap); + private static native void nativeReconfigure(long nativeBitmap, int width, int height, int config, int allocSize); - private static native boolean nativeCompress(int nativeBitmap, int format, + private static native boolean nativeCompress(long nativeBitmap, int format, int quality, OutputStream stream, byte[] tempStorage); - private static native void nativeErase(int nativeBitmap, int color); - private static native int nativeRowBytes(int nativeBitmap); - private static native int nativeConfig(int nativeBitmap); + private static native void nativeErase(long nativeBitmap, int color); + private static native int nativeRowBytes(long nativeBitmap); + private static native int nativeConfig(long nativeBitmap); - private static native int nativeGetPixel(int nativeBitmap, int x, int y, + private static native int nativeGetPixel(long nativeBitmap, int x, int y, boolean isPremultiplied); - private static native void nativeGetPixels(int nativeBitmap, int[] pixels, + private static native void nativeGetPixels(long nativeBitmap, int[] pixels, int offset, int stride, int x, int y, int width, int height, boolean isPremultiplied); - private static native void nativeSetPixel(int nativeBitmap, int x, int y, + private static native void nativeSetPixel(long nativeBitmap, int x, int y, int color, boolean isPremultiplied); - private static native void nativeSetPixels(int nativeBitmap, int[] colors, + private static native void nativeSetPixels(long nativeBitmap, int[] colors, int offset, int stride, int x, int y, int width, int height, boolean isPremultiplied); - private static native void nativeCopyPixelsToBuffer(int nativeBitmap, + private static native void nativeCopyPixelsToBuffer(long nativeBitmap, Buffer dst); - private static native void nativeCopyPixelsFromBuffer(int nb, Buffer src); - private static native int nativeGenerationId(int nativeBitmap); + private static native void nativeCopyPixelsFromBuffer(long nativeBitmap, Buffer src); + private static native int nativeGenerationId(long nativeBitmap); private static native Bitmap nativeCreateFromParcel(Parcel p); // returns true on success - private static native boolean nativeWriteToParcel(int nativeBitmap, + private static native boolean nativeWriteToParcel(long nativeBitmap, boolean isMutable, int density, Parcel p); // returns a new bitmap built from the native bitmap's alpha, and the paint - private static native Bitmap nativeExtractAlpha(int nativeBitmap, - int nativePaint, + private static native Bitmap nativeExtractAlpha(long nativeBitmap, + long nativePaint, int[] offsetXY); - private static native void nativePrepareToDraw(int nativeBitmap); - private static native boolean nativeHasAlpha(int nativeBitmap); - private static native void nativeSetHasAlpha(int nBitmap, boolean hasAlpha); - private static native boolean nativeHasMipMap(int nativeBitmap); - private static native void nativeSetHasMipMap(int nBitmap, boolean hasMipMap); - private static native boolean nativeSameAs(int nb0, int nb1); - - /* package */ final int ni() { + private static native void nativePrepareToDraw(long nativeBitmap); + private static native boolean nativeHasAlpha(long nativeBitmap); + private static native void nativeSetHasAlpha(long nativeBitmap, boolean hasAlpha); + private static native boolean nativeHasMipMap(long nativeBitmap); + private static native void nativeSetHasMipMap(long nativeBitmap, boolean hasMipMap); + private static native boolean nativeSameAs(long nativeBitmap0, long nativeBitmap1); + + /* package */ final long ni() { return mNativeBitmap; } } |