implement drawing into Bitmaps with Canvas, make BitmapDrawable use use paintable, misc Bitmap improvements

This commit is contained in:
Mis012
2024-03-16 15:00:22 +01:00
parent fa1aa36f6b
commit 2e864adc0f
10 changed files with 201 additions and 85 deletions

View File

@@ -25,11 +25,7 @@ public class BitmapDrawable extends Drawable {
public BitmapDrawable(Resources res, Bitmap bitmap) {
this.bitmap = bitmap;
}
@Override
public void draw(Canvas canvas) {
canvas.drawBitmap(bitmap, new Rect(0, 0, bitmap.getWidth(), bitmap.getWidth()), new RectF(getBounds()), null);
this.paintable = native_paintable_from_pixbuf(bitmap.pixbuf);
}
public Bitmap getBitmap() {
@@ -45,4 +41,5 @@ public class BitmapDrawable extends Drawable {
a.recycle();
}
private static native long native_paintable_from_pixbuf(long pixbuf);
}