GskCanvas: implement RoundedRect filling

This commit is contained in:
Julian Winkler
2024-12-13 22:35:40 +01:00
parent 0e078894ce
commit 597c73f334
6 changed files with 35 additions and 6 deletions

View File

@@ -91,7 +91,7 @@ public class GskCanvas extends Canvas {
@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());
native_drawRoundRect(snapshot, left, top, right, bottom, rx, ry, paint.getColor(), paint.getStrokeWidth(), paint.getStyle().nativeInt);
}
protected native void native_drawBitmap(long snapshot, long texture, int x, int y, int width, int height, int color);
@@ -103,5 +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, long font);
protected native void native_drawRoundRect(long snapshot, float left, float top, float right, float bottom, float rx, float ry, int color, float strokeWidth);
protected native void native_drawRoundRect(long snapshot, float left, float top, float right, float bottom, float rx, float ry, int color, float strokeWidth, int style);
}

View File

@@ -307,6 +307,10 @@ public class Paint {
public float getLetterSpacing() { return 1.0f; }
public Style getStyle() {
return Style.values()[native_get_style(skia_paint)];
}
private native long native_constructor();
private native void native_set_antialias(long skia_paint, boolean aa);
private native void native_set_color(long skia_paint, int color);
@@ -320,4 +324,5 @@ public class Paint {
private static native float native_get_stroke_width(long skia_font);
private static native void native_set_style(long skia_paint, int style);
private static native void native_set_blendmode(long skia_paint, int mode);
private static native int native_get_style(long skia_paint);
}