api-impl: misc stubs for WhatsApp

This commit is contained in:
Julian Winkler
2025-01-11 18:01:43 +01:00
parent 2a3c8fd5fa
commit 57dd86fc98
25 changed files with 470 additions and 2 deletions

View File

@@ -180,6 +180,10 @@ public final class Bitmap {
buffer.position(buffer.position() + getAllocationByteCount());
}
public int getByteCount() {
return getAllocationByteCount();
}
@SuppressWarnings("deprecation")
@Override
protected void finalize() throws Throwable {

View File

@@ -6,7 +6,11 @@ public class Canvas {
private Bitmap bitmap;
private GskCanvas gsk_canvas;
public Canvas() {}
public Canvas() {
if (!(this instanceof GskCanvas)) {
gsk_canvas = new GskCanvas(0);
}
}
public Canvas(Bitmap bmp) {
this.bitmap = bmp;
@@ -462,4 +466,6 @@ public class Canvas {
outRect.set(0, 0, 100, 100);
return true;
}
public void drawPaint(Paint paint) {}
}

View File

@@ -92,6 +92,10 @@ public class Path {
public void arcTo(RectF oval, float startAngle, float sweepAngle, boolean forceMoveTo) {}
public void arcTo(RectF oval, float startAngle, float sweepAngle) {}
public void arcTo(float left, float top, float right, float bottom, float startAngle, float sweepAngle, boolean forceMoveTo) {}
public void rMoveTo(float x, float y) {
native_rel_move_to(getBuilder(), x, y);
}
@@ -118,6 +122,10 @@ public class Path {
addPath(path, matrix);
}
public void addPath(Path path) {
addPath(path, Matrix.IDENTITY_MATRIX);
}
public void addRect(RectF rect, Direction direction) {
native_add_rect(getBuilder(), rect.left, rect.top, rect.right, rect.bottom);
}
@@ -138,6 +146,8 @@ public class Path {
public void addOval(RectF rect, Direction direction) {}
public void addCircle(float x, float y, float radius, Direction direction) {}
public void transform(Matrix matrix) {
builder = native_transform(getGskPath(), matrix.ni());
path = 0;