api-impl: misc stubs and trivial impls

This commit is contained in:
Mis012
2025-02-15 21:34:37 +01:00
parent df03617f13
commit 453224cf31
12 changed files with 123 additions and 6 deletions

View File

@@ -32,6 +32,9 @@ public final class Bitmap {
public enum CompressFormat {
JPEG,
PNG,
WEBP,
WEBP_LOSSY,
WEBP_LOSSLESS,
}
private int width;

View File

@@ -207,7 +207,6 @@ public class Canvas {
* @param py The y-coord for the pivot point (unchanged by the scale)
*/
public final void scale(float sx, float sy, float px, float py) {
System.out.println("XXXXXXX scale(sx, sy, px, py)");
translate(px, py);
scale(sx, sy);
translate(-px, -py);
@@ -466,6 +465,10 @@ public class Canvas {
return false;
}
public boolean clipRect(RectF rect) {
return false;
}
public boolean clipRect(float left, float top, float right, float bottom, Region.Op op) {
return false;
}

View File

@@ -20,6 +20,7 @@ public class Paint {
public long paint; // native paint
private Xfermode xfermode;
private Shader shader;
private Align align = Align.CENTER;
public Paint() {
paint = native_create();
@@ -322,6 +323,10 @@ public class Paint {
return Style.values[native_get_style(paint)];
}
public Align getTextAlign() {
return align;
}
private static native long native_create();
private static native long native_clone(long paint);
private static native void native_recycle(long paint);

View File

@@ -112,6 +112,10 @@ public class Path {
native_rel_quad_to(getBuilder(), x1, y1, x2, y2);
}
public void addArc (RectF oval, float startAngle, float sweepAngle) {}
public void addArc (float left, float top, float right, float bottom, float startAngle, float sweepAngle) {}
public void addPath(Path path, Matrix matrix) {
native_add_path(getBuilder(), path.getGskPath(), matrix.ni());
}
@@ -153,6 +157,13 @@ public class Path {
path = 0;
}
public void transform(Matrix matrix, Path out_path) {
if(out_path == null)
out_path = this;
out_path.transform(matrix);
}
public void computeBounds(RectF bounds, boolean exact) {
native_get_bounds(getGskPath(), bounds);
}