some graphics API stubs

This commit is contained in:
Julian Winkler
2024-03-24 20:43:47 +01:00
parent 3d9468aa9f
commit 0b78cbcc55
5 changed files with 25 additions and 1 deletions

View File

@@ -392,6 +392,16 @@ public class Canvas {
public void restoreToCount(int count) {} public void restoreToCount(int count) {}
public void drawRoundRect(RectF rect, float rx, float ry, Paint paint) {}
public void getMatrix(Matrix matrix) {
matrix.reset();
}
public void translate(float dx, float dy) {}
public void drawCircle(float cx, float cy, float radius, Paint paint) {}
private static native long native_canvas_from_bitmap(long pixbuf); private static native long native_canvas_from_bitmap(long pixbuf);
private static native void native_save(long skia_canvas, long widget); private static native void native_save(long skia_canvas, long widget);

View File

@@ -64,6 +64,8 @@ public class Paint {
} }
public float measureText(CharSequence text, int start, int end) { return 10; } public float measureText(CharSequence text, int start, int end) { return 10; }
public Shader setShader(Shader shader) { return shader; }
public enum Style { public enum Style {
/** /**
* Geometry and text drawn with this style will be filled, ignoring all * Geometry and text drawn with this style will be filled, ignoring all

View File

@@ -0,0 +1,5 @@
package android.graphics;
public class Shader {
}

View File

@@ -90,7 +90,9 @@ public class Drawable {
public final int getLevel() {return 0;} public final int getLevel() {return 0;}
public final boolean setLevel(int level) {return false;} public final boolean setLevel(int level) {return false;}
public void setBounds(Rect bounds) {} public void setBounds(Rect bounds) {
setBounds(bounds.left, bounds.top, bounds.right, bounds.bottom);
}
public void setColorFilter(int color, PorterDuff.Mode mode) {} public void setColorFilter(int color, PorterDuff.Mode mode) {}
public void setColorFilter(ColorFilter filter) {} public void setColorFilter(ColorFilter filter) {}
@@ -173,5 +175,9 @@ public class Drawable {
return false; return false;
} }
public void copyBounds(Rect bounds) {
bounds.set(mBounds);
}
protected static native long native_paintable_from_path(String path); protected static native long native_paintable_from_path(String path);
} }

View File

@@ -172,6 +172,7 @@ hax_jar = jar('hax', [
'android/graphics/Rect.java', 'android/graphics/Rect.java',
'android/graphics/RectF.java', 'android/graphics/RectF.java',
'android/graphics/Region.java', 'android/graphics/Region.java',
'android/graphics/Shader.java',
'android/graphics/Typeface.java', 'android/graphics/Typeface.java',
'android/graphics/Xfermode.java', 'android/graphics/Xfermode.java',
'android/graphics/drawable/Animatable.java', 'android/graphics/drawable/Animatable.java',