Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 88a8364c authored by Narayan Kamath's avatar Narayan Kamath
Browse files

Track 64bit changes to android/graphics.

All pointers are now 64bits wide, so should be
represented as java longs and not ints.

Also changed DelegateManager and SparseWeakArray to
reflect the new world order.

Change-Id: Ic32b6b53818dbae9b949f03004c4fb6dae26cdbe
parent 36bef0bf
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -61,7 +61,7 @@ public class AvoidXfermode_Delegate extends Xfermode_Delegate {
    // ---- native methods ----

    @LayoutlibDelegate
    /*package*/ static int nativeCreate(int opColor, int tolerance, int nativeMode) {
    /*package*/ static long nativeCreate(int opColor, int tolerance, int nativeMode) {
        AvoidXfermode_Delegate newDelegate = new AvoidXfermode_Delegate();
        return sManager.addNewDelegate(newDelegate);
    }
+2 −2
Original line number Diff line number Diff line
@@ -65,7 +65,7 @@ public class BitmapShader_Delegate extends Shader_Delegate {
    // ---- native methods ----

    @LayoutlibDelegate
    /*package*/ static int nativeCreate(int native_bitmap, int shaderTileModeX,
    /*package*/ static long nativeCreate(long native_bitmap, int shaderTileModeX,
            int shaderTileModeY) {
        Bitmap_Delegate bitmap = Bitmap_Delegate.getDelegate(native_bitmap);
        if (bitmap == null) {
@@ -80,7 +80,7 @@ public class BitmapShader_Delegate extends Shader_Delegate {
    }

    @LayoutlibDelegate
    /*package*/ static int nativePostCreate(int native_shader, int native_bitmap,
    /*package*/ static long nativePostCreate(long native_shader, long native_bitmap,
            int shaderTileModeX, int shaderTileModeY) {
        // pass, not needed.
        return 0;
+26 −26
Original line number Diff line number Diff line
@@ -83,7 +83,7 @@ public final class Bitmap_Delegate {
    /**
     * Returns the native delegate associated to a given an int referencing a {@link Bitmap} object.
     */
    public static Bitmap_Delegate getDelegate(int native_bitmap) {
    public static Bitmap_Delegate getDelegate(long native_bitmap) {
        return sManager.getDelegate(native_bitmap);
    }

@@ -272,7 +272,7 @@ public final class Bitmap_Delegate {
    }

    @LayoutlibDelegate
    /*package*/ static Bitmap nativeCopy(int srcBitmap, int nativeConfig, boolean isMutable) {
    /*package*/ static Bitmap nativeCopy(long srcBitmap, int nativeConfig, boolean isMutable) {
        Bitmap_Delegate srcBmpDelegate = sManager.getDelegate(srcBitmap);
        if (srcBmpDelegate == null) {
            return null;
@@ -301,17 +301,17 @@ public final class Bitmap_Delegate {
    }

    @LayoutlibDelegate
    /*package*/ static void nativeDestructor(int nativeBitmap) {
    /*package*/ static void nativeDestructor(long nativeBitmap) {
        sManager.removeJavaReferenceFor(nativeBitmap);
    }

    @LayoutlibDelegate
    /*package*/ static void nativeRecycle(int nativeBitmap) {
    /*package*/ static void nativeRecycle(long nativeBitmap) {
        sManager.removeJavaReferenceFor(nativeBitmap);
    }

    @LayoutlibDelegate
    /*package*/ static boolean nativeCompress(int nativeBitmap, int format, int quality,
    /*package*/ static boolean nativeCompress(long nativeBitmap, int format, int quality,
            OutputStream stream, byte[] tempStorage) {
        Bridge.getLog().error(LayoutLog.TAG_UNSUPPORTED,
                "Bitmap.compress() is not supported", null /*data*/);
@@ -319,7 +319,7 @@ public final class Bitmap_Delegate {
    }

    @LayoutlibDelegate
    /*package*/ static void nativeErase(int nativeBitmap, int color) {
    /*package*/ static void nativeErase(long nativeBitmap, int color) {
        // get the delegate from the native int.
        Bitmap_Delegate delegate = sManager.getDelegate(nativeBitmap);
        if (delegate == null) {
@@ -339,7 +339,7 @@ public final class Bitmap_Delegate {
    }

    @LayoutlibDelegate
    /*package*/ static int nativeWidth(int nativeBitmap) {
    /*package*/ static int nativeWidth(long nativeBitmap) {
        // get the delegate from the native int.
        Bitmap_Delegate delegate = sManager.getDelegate(nativeBitmap);
        if (delegate == null) {
@@ -350,7 +350,7 @@ public final class Bitmap_Delegate {
    }

    @LayoutlibDelegate
    /*package*/ static int nativeHeight(int nativeBitmap) {
    /*package*/ static int nativeHeight(long nativeBitmap) {
        // get the delegate from the native int.
        Bitmap_Delegate delegate = sManager.getDelegate(nativeBitmap);
        if (delegate == null) {
@@ -361,7 +361,7 @@ public final class Bitmap_Delegate {
    }

    @LayoutlibDelegate
    /*package*/ static int nativeRowBytes(int nativeBitmap) {
    /*package*/ static int nativeRowBytes(long nativeBitmap) {
        // get the delegate from the native int.
        Bitmap_Delegate delegate = sManager.getDelegate(nativeBitmap);
        if (delegate == null) {
@@ -372,7 +372,7 @@ public final class Bitmap_Delegate {
    }

    @LayoutlibDelegate
    /*package*/ static int nativeConfig(int nativeBitmap) {
    /*package*/ static int nativeConfig(long nativeBitmap) {
        // get the delegate from the native int.
        Bitmap_Delegate delegate = sManager.getDelegate(nativeBitmap);
        if (delegate == null) {
@@ -383,7 +383,7 @@ public final class Bitmap_Delegate {
    }

    @LayoutlibDelegate
    /*package*/ static boolean nativeHasAlpha(int nativeBitmap) {
    /*package*/ static boolean nativeHasAlpha(long nativeBitmap) {
        // get the delegate from the native int.
        Bitmap_Delegate delegate = sManager.getDelegate(nativeBitmap);
        if (delegate == null) {
@@ -394,7 +394,7 @@ public final class Bitmap_Delegate {
    }

    @LayoutlibDelegate
    /*package*/ static boolean nativeHasMipMap(int nativeBitmap) {
    /*package*/ static boolean nativeHasMipMap(long nativeBitmap) {
        // get the delegate from the native int.
        Bitmap_Delegate delegate = sManager.getDelegate(nativeBitmap);
        if (delegate == null) {
@@ -405,7 +405,7 @@ public final class Bitmap_Delegate {
    }

    @LayoutlibDelegate
    /*package*/ static int nativeGetPixel(int nativeBitmap, int x, int y) {
    /*package*/ static int nativeGetPixel(long nativeBitmap, int x, int y) {
        // get the delegate from the native int.
        Bitmap_Delegate delegate = sManager.getDelegate(nativeBitmap);
        if (delegate == null) {
@@ -416,7 +416,7 @@ public final class Bitmap_Delegate {
    }

    @LayoutlibDelegate
    /*package*/ static void nativeGetPixels(int nativeBitmap, int[] pixels, int offset,
    /*package*/ static void nativeGetPixels(long nativeBitmap, int[] pixels, int offset,
            int stride, int x, int y, int width, int height) {
        Bitmap_Delegate delegate = sManager.getDelegate(nativeBitmap);
        if (delegate == null) {
@@ -428,7 +428,7 @@ public final class Bitmap_Delegate {


    @LayoutlibDelegate
    /*package*/ static void nativeSetPixel(int nativeBitmap, int x, int y, int color) {
    /*package*/ static void nativeSetPixel(long nativeBitmap, int x, int y, int color) {
        Bitmap_Delegate delegate = sManager.getDelegate(nativeBitmap);
        if (delegate == null) {
            return;
@@ -438,7 +438,7 @@ public final class Bitmap_Delegate {
    }

    @LayoutlibDelegate
    /*package*/ static void nativeSetPixels(int nativeBitmap, int[] colors, int offset,
    /*package*/ static void nativeSetPixels(long nativeBitmap, int[] colors, int offset,
            int stride, int x, int y, int width, int height) {
        Bitmap_Delegate delegate = sManager.getDelegate(nativeBitmap);
        if (delegate == null) {
@@ -449,21 +449,21 @@ public final class Bitmap_Delegate {
    }

    @LayoutlibDelegate
    /*package*/ static void nativeCopyPixelsToBuffer(int nativeBitmap, Buffer dst) {
    /*package*/ static void nativeCopyPixelsToBuffer(long nativeBitmap, Buffer dst) {
        // FIXME implement native delegate
        Bridge.getLog().fidelityWarning(LayoutLog.TAG_UNSUPPORTED,
                "Bitmap.copyPixelsToBuffer is not supported.", null, null /*data*/);
    }

    @LayoutlibDelegate
    /*package*/ static void nativeCopyPixelsFromBuffer(int nb, Buffer src) {
    /*package*/ static void nativeCopyPixelsFromBuffer(long nb, Buffer src) {
        // FIXME implement native delegate
        Bridge.getLog().fidelityWarning(LayoutLog.TAG_UNSUPPORTED,
                "Bitmap.copyPixelsFromBuffer is not supported.", null, null /*data*/);
    }

    @LayoutlibDelegate
    /*package*/ static int nativeGenerationId(int nativeBitmap) {
    /*package*/ static int nativeGenerationId(long nativeBitmap) {
        Bitmap_Delegate delegate = sManager.getDelegate(nativeBitmap);
        if (delegate == null) {
            return 0;
@@ -483,7 +483,7 @@ public final class Bitmap_Delegate {
    }

    @LayoutlibDelegate
    /*package*/ static boolean nativeWriteToParcel(int nativeBitmap, boolean isMutable,
    /*package*/ static boolean nativeWriteToParcel(long nativeBitmap, boolean isMutable,
            int density, Parcel p) {
        // This is only called when sending a bitmap through aidl, so really this should not
        // be called.
@@ -494,7 +494,7 @@ public final class Bitmap_Delegate {
    }

    @LayoutlibDelegate
    /*package*/ static Bitmap nativeExtractAlpha(int nativeBitmap, int nativePaint,
    /*package*/ static Bitmap nativeExtractAlpha(long nativeBitmap, long nativePaint,
            int[] offsetXY) {
        Bitmap_Delegate bitmap = sManager.getDelegate(nativeBitmap);
        if (bitmap == null) {
@@ -522,12 +522,12 @@ public final class Bitmap_Delegate {
    }

    @LayoutlibDelegate
    /*package*/ static void nativePrepareToDraw(int nativeBitmap) {
    /*package*/ static void nativePrepareToDraw(long nativeBitmap) {
        // nothing to be done here.
    }

    @LayoutlibDelegate
    /*package*/ static void nativeSetHasAlpha(int nativeBitmap, boolean hasAlpha) {
    /*package*/ static void nativeSetHasAlpha(long nativeBitmap, boolean hasAlpha) {
        // get the delegate from the native int.
        Bitmap_Delegate delegate = sManager.getDelegate(nativeBitmap);
        if (delegate == null) {
@@ -538,7 +538,7 @@ public final class Bitmap_Delegate {
    }

    @LayoutlibDelegate
    /*package*/ static void nativeSetHasMipMap(int nativeBitmap, boolean hasMipMap) {
    /*package*/ static void nativeSetHasMipMap(long nativeBitmap, boolean hasMipMap) {
        // get the delegate from the native int.
        Bitmap_Delegate delegate = sManager.getDelegate(nativeBitmap);
        if (delegate == null) {
@@ -549,7 +549,7 @@ public final class Bitmap_Delegate {
    }

    @LayoutlibDelegate
    /*package*/ static boolean nativeSameAs(int nb0, int nb1) {
    /*package*/ static boolean nativeSameAs(long nb0, long nb1) {
        Bitmap_Delegate delegate1 = sManager.getDelegate(nb0);
        if (delegate1 == null) {
            return false;
@@ -602,7 +602,7 @@ public final class Bitmap_Delegate {
    private static Bitmap createBitmap(Bitmap_Delegate delegate,
            Set<BitmapCreateFlags> createFlags, int density) {
        // get its native_int
        int nativeInt = sManager.addNewDelegate(delegate);
        long nativeInt = sManager.addNewDelegate(delegate);

        int width = delegate.mImage.getWidth();
        int height = delegate.mImage.getHeight();
+1 −1
Original line number Diff line number Diff line
@@ -55,7 +55,7 @@ public class BlurMaskFilter_Delegate extends MaskFilter_Delegate {
    // ---- native methods ----

    @LayoutlibDelegate
    /*package*/ static int nativeConstructor(float radius, int style) {
    /*package*/ static long nativeConstructor(float radius, int style) {
        BlurMaskFilter_Delegate newDelegate = new BlurMaskFilter_Delegate();
        return sManager.addNewDelegate(newDelegate);
    }
+78 −79

File changed.

Preview size limit exceeded, changes collapsed.

Loading