implement some Canvas methods needed for composeUI

This commit is contained in:
Julian Winkler
2024-11-30 17:58:31 +01:00
committed by Mis012
parent cb7805bb45
commit d0952101a6
17 changed files with 143 additions and 18 deletions

View File

@@ -89,6 +89,11 @@ public class GskCanvas extends Canvas {
drawBitmap(bitmap, src, new Rect((int)dst.left, (int)dst.top, (int)dst.right, (int)dst.bottom), paint);
}
@Override
public void drawRoundRect(float left, float top, float right, float bottom, float rx, float ry, Paint paint) {
native_drawRoundRect(snapshot, left, top, right, bottom, rx, ry, paint.getColor(), paint.getStrokeWidth());
}
protected native void native_drawBitmap(long snapshot, long texture, int x, int y, int width, int height, int color);
protected native void native_drawRect(long snapshot, float left, float top, float right, float bottom, int color);
protected native void native_drawPath(long snapshot, long path, long paint);
@@ -98,4 +103,5 @@ public class GskCanvas extends Canvas {
protected native void native_restore(long snapshot);
protected native void native_drawLine(long snapshot, float startX, float startY, float stopX, float stopY, long paint);
protected native void native_drawText(long snapshot, String text, float x, float y, long paint);
protected native void native_drawRoundRect(long snapshot, float left, float top, float right, float bottom, float rx, float ry, int color, float strokeWidth);
}