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

Commit 78fe94f9 authored by Xavier Ducrohet's avatar Xavier Ducrohet Committed by Android (Google) Code Review
Browse files

Merge "Layoutlib Canvas and Paint implementation through native delegates"

parents 7d5411fd 9f63ff26
Loading
Loading
Loading
Loading
+22 −2
Original line number Diff line number Diff line
@@ -59,6 +59,20 @@ public class Bitmap_Delegate {

    // ---- Public Helper methods ----

    /**
     * Returns the native delegate associated to a given {@link Bitmap_Delegate} object.
     */
    public static Bitmap_Delegate getDelegate(Bitmap bitmap) {
        return sManager.getDelegate(bitmap.mNativeBitmap);
    }

    /**
     * Returns the native delegate associated to a given an int referencing a {@link Bitmap} object.
     */
    public static Bitmap_Delegate getDelegate(int native_bitmap) {
        return sManager.getDelegate(native_bitmap);
    }

    /**
     * Creates and returns a {@link Bitmap} initialized with the given file content.
     */
@@ -118,6 +132,13 @@ public class Bitmap_Delegate {
        return BufferedImage.TYPE_INT_ARGB;
    }

    /**
     * Returns the {@link BufferedImage} used by the delegate of the given {@link Bitmap}.
     */
    public BufferedImage getImage() {
        return mImage;
    }

    // ---- native methods ----

    /*package*/ static Bitmap nativeCreate(int[] colors, int offset, int stride, int width,
@@ -127,8 +148,7 @@ public class Bitmap_Delegate {
        // create the image
        BufferedImage image = new BufferedImage(width, height, imageType);

        // fill it
        //image.setRGB(x, y, rgb)
        // FIXME fill the bitmap!

        // create a delegate with the content of the stream.
        Bitmap_Delegate delegate = new Bitmap_Delegate(image);
+0 −1247

File deleted.

Preview size limit exceeded, changes collapsed.

+559 −0

File added.

Preview size limit exceeded, changes collapsed.

+0 −1211

File deleted.

Preview size limit exceeded, changes collapsed.

+750 −0

File added.

Preview size limit exceeded, changes collapsed.

Loading