You've already forked android_translation_layer
mirror of
https://gitlab.com/android_translation_layer/android_translation_layer.git
synced 2025-10-27 11:48:10 -07:00
Canvas: add more Bitmap drawing methods
This commit is contained in:
@@ -87,6 +87,15 @@ 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 drawBitmap(Bitmap bitmap, Matrix matrix, Paint paint) {
|
||||
save();
|
||||
concat(matrix);
|
||||
drawBitmap(bitmap, 0, 0, paint);
|
||||
restore();
|
||||
|
||||
}
|
||||
|
||||
@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 != null ? paint.paint : default_paint.paint);
|
||||
@@ -97,6 +106,11 @@ public class GskCanvas extends Canvas {
|
||||
native_scale(snapshot, sx, sy);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void concat(Matrix matrix) {
|
||||
native_concat(snapshot, matrix.native_instance);
|
||||
}
|
||||
|
||||
protected native void native_drawBitmap(long snapshot, long texture, int x, int y, int width, int height, long paint);
|
||||
protected native void native_drawRect(long snapshot, float left, float top, float right, float bottom, long paint);
|
||||
protected native void native_drawPath(long snapshot, long path, long paint);
|
||||
@@ -108,4 +122,5 @@ public class GskCanvas extends Canvas {
|
||||
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, long paint);
|
||||
protected native void native_scale(long snapshot, float sx, float sy);
|
||||
protected native void native_concat(long snapshot, long matrix);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user