add Java APIs needed for WhatsApp MainActivity and ConversationActivity

This commit is contained in:
Julian Winkler
2024-08-25 11:20:01 +02:00
parent 9d8e091799
commit c492e1f03f
74 changed files with 903 additions and 69 deletions

View File

@@ -399,7 +399,14 @@ public class Canvas {
native_drawLine(skia_canvas, widget, startX, startY, stopX, stopY, paint.skia_paint);
}
public void setBitmap(Bitmap bitmap) {}
public void setBitmap(Bitmap bitmap) {
if (skia_canvas != 0) {
native_destroy_canvas(skia_canvas);
}
bitmap.destroyTexture(); // invalidate cached texture
this.skia_canvas = native_canvas_from_bitmap(bitmap.pixbuf);
this.widget = 0;
}
public void drawPath(Path path, Paint paint) {
native_drawPath(skia_canvas, path.mNativePath, paint.skia_paint);
@@ -445,6 +452,20 @@ public class Canvas {
public void drawColor(int dummy) {}
public void drawARGB(int a, int r, int g, int b) {}
public int saveLayer(RectF bounds, Paint paint, int flags) {
return save();
}
public void drawOval(RectF oval, Paint paint) {}
public boolean clipRect(int left, int top, int right, int bottom) {
return false;
}
public void drawColor(int color, PorterDuff.Mode mode) {}
private static native long native_canvas_from_bitmap(long pixbuf);
private static native void native_save(long skia_canvas, long widget);