8package org.skia.jetski;
10import androidx.annotation.Nullable;
13 private long mNativeInstance;
17 return nGetWidth(mNativeInstance);
21 return nGetHeight(mNativeInstance);
25 return nSave(mNativeInstance);
29 nRestore(mNativeInstance);
33 nRestoreToCount(mNativeInstance,
count);
39 nativePaint =
paint.getNativeInstance();
41 return nSaveLayer(mNativeInstance, nativePaint);
45 long native_matrix = nGetLocalToDevice(mNativeInstance);
46 return new Matrix(native_matrix);
50 nConcat(mNativeInstance,
m.getNativeInstance());
53 public void concat(
float[] rowMajorMatrix) {
54 if (rowMajorMatrix.length != 16) {
55 throw new java.lang.IllegalArgumentException(
"Expecting a 16 float array.");
58 nConcat16f(mNativeInstance, rowMajorMatrix);
61 public void translate(
float tx,
float ty,
float tz) {
62 nTranslate(mNativeInstance, tx ,ty, tz);
66 nTranslate(mNativeInstance, tx ,ty, 0);
69 public void scale(
float sx,
float sy,
float sz) {
70 nScale(mNativeInstance, sx ,sy, sz);
73 public void scale(
float sx,
float sy) {
74 nScale(mNativeInstance, sx ,sy, 1);
78 nClipPath(mNativeInstance,
path.getNativeInstance(), op.
mNativeInt, antiAliasing);
81 public void clipRect(
float left,
float top,
float right,
float bottom,
82 ClipOp op,
boolean antiAliasing) {
83 nClipRect(mNativeInstance, left, top, right, bottom, op.
mNativeInt, antiAliasing);
86 public void clipRRect(
float left,
float top,
float right,
float bottom,
float xRad,
float yRad,
87 ClipOp op,
boolean antiAliasing) {
88 nClipRRect(mNativeInstance, left, top, right, bottom, xRad, yRad, op.
mNativeInt, antiAliasing);
96 nDrawRect(mNativeInstance, left, top, right, bottom,
paint.getNativeInstance());
100 nDrawColor(mNativeInstance, c.
r(), c.
g(), c.
b(), c.
a());
104 nDrawColor(mNativeInstance, r, g,
b,
a);
108 nDrawColor(mNativeInstance,
109 (
float)((icolor >> 16) & 0xff) / 255,
110 (
float)((icolor >> 8) & 0xff) / 255,
111 (
float)((icolor >> 0) & 0xff) / 255,
112 (
float)((icolor >> 24) & 0xff) / 255
121 nDrawImage(mNativeInstance,
image.getNativeInstance(),
x,
y,
126 nDrawPath(mNativeInstance,
path.getNativeInstance(),
paint.getNativeInstance());
131 mNativeInstance = native_instance;
138 private static native
int nGetWidth(
long nativeInstance);
139 private static native
int nGetHeight(
long nativeInstance);
140 private static native
int nSave(
long nativeInstance);
141 private static native
void nRestore(
long nativeInstance);
142 private static native
void nRestoreToCount(
long nativeInstance,
int count);
143 private static native
int nSaveLayer(
long nativeInstance,
long nativePaint);
144 private static native
long nGetLocalToDevice(
long mNativeInstance);
145 private static native
void nConcat(
long nativeInstance,
long nativeMatrix);
146 private static native
void nConcat16f(
long nativeInstance,
float[] floatMatrix);
147 private static native
void nTranslate(
long nativeInstance,
float tx,
float ty,
float tz);
148 private static native
void nScale(
long nativeInstance,
float sx,
float sy,
float sz);
150 private static native
void nClipPath(
long nativeInstance,
long nativePath,
int clipOp,
152 private static native
void nClipRect(
long nativeInstance,
float left,
float top,
float right,
153 float bottom,
int clipOp,
boolean doAA);
154 private static native
void nClipRRect(
long nativeInstance,
float left,
float top,
float right,
155 float bottom,
float xRad,
float yRad,
156 int clipOp,
boolean doAA);
157 private static native
void nClipShader(
long nativeInstance,
long nativeShader,
int clipOp);
160 private static native
void nDrawColor(
long nativeInstance,
float r,
float g,
float b,
float a);
162 private static native
void nDrawRect(
long nativeInstance,
163 float left,
float top,
float right,
float bottom,
165 private static native
void nDrawImage(
long nativeInstance,
long nativeImage,
float x,
float y,
167 float samplingCoeffB,
float samplingCoeffC);
168 private static native
void nDrawPath(
long nativeInstance,
long nativePath,
long nativePaint);
169 private static native
void nDrawGlyphs(
long nativeInstance,
char[]
glyphs,
float[] positions,
170 float originX,
float originY,
long nativeFont,
long nativePaint);
void clipShader(Shader shader, ClipOp op)
void drawImage(Image image, float x, float y)
void drawImage(Image image, float x, float y, SamplingOptions sampling)
void drawColor(int icolor)
void clipPath(Path path, ClipOp op, boolean antiAliasing)
void drawRect(float left, float top, float right, float bottom, Paint paint)
void clipRRect(float left, float top, float right, float bottom, float xRad, float yRad, ClipOp op, boolean antiAliasing)
void translate(float tx, float ty)
void translate(float tx, float ty, float tz)
void drawColor(float r, float g, float b, float a)
Canvas(Surface surface, long native_instance)
void clipRect(float left, float top, float right, float bottom, ClipOp op, boolean antiAliasing)
int saveLayer(@Nullable Paint paint)
void scale(float sx, float sy, float sz)
void scale(float sx, float sy)
Matrix getLocalToDevice()
void drawPath(Path path, Paint paint)
void restoreToCount(int count)
void concat(float[] rowMajorMatrix)
sk_sp< const SkImage > image
SkSamplingOptions sampling
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir path
SkSamplingOptions SamplingOptions(jint desc, jfloat coeffB, jfloat coeffC)
SK_API sk_sp< PrecompileColorFilter > Matrix()