Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | Package Functions | List of all members
org.skia.jetski.Canvas Class Reference

Public Member Functions

int getWidth ()
 
int getHeight ()
 
int save ()
 
void restore ()
 
void restoreToCount (int count)
 
int saveLayer (@Nullable Paint paint)
 
Matrix getLocalToDevice ()
 
void concat (Matrix m)
 
void concat (float[] rowMajorMatrix)
 
void translate (float tx, float ty, float tz)
 
void translate (float tx, float ty)
 
void scale (float sx, float sy, float sz)
 
void scale (float sx, float sy)
 
void clipPath (Path path, ClipOp op, boolean antiAliasing)
 
void clipRect (float left, float top, float right, float bottom, ClipOp op, boolean antiAliasing)
 
void clipRRect (float left, float top, float right, float bottom, float xRad, float yRad, ClipOp op, boolean antiAliasing)
 
void clipShader (Shader shader, ClipOp op)
 
void drawRect (float left, float top, float right, float bottom, Paint paint)
 
void drawColor (Color c)
 
void drawColor (float r, float g, float b, float a)
 
void drawColor (int icolor)
 
void drawImage (Image image, float x, float y)
 
void drawImage (Image image, float x, float y, SamplingOptions sampling)
 
void drawPath (Path path, Paint paint)
 

Package Functions

 Canvas (Surface surface, long native_instance)
 
long getNativeInstance ()
 

Detailed Description

Definition at line 12 of file Canvas.java.

Constructor & Destructor Documentation

◆ Canvas()

org.skia.jetski.Canvas.Canvas ( Surface  surface,
long  native_instance 
)
inlinepackage

Definition at line 130 of file Canvas.java.

130 {
131 mNativeInstance = native_instance;
132 mSurface = surface;
133 }
VkSurfaceKHR surface
Definition main.cc:49

Member Function Documentation

◆ clipPath()

void org.skia.jetski.Canvas.clipPath ( Path  path,
ClipOp  op,
boolean  antiAliasing 
)
inline

Definition at line 77 of file Canvas.java.

77 {
78 nClipPath(mNativeInstance, path.getNativeInstance(), op.mNativeInt, antiAliasing);
79 }
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
Definition switches.h:57

◆ clipRect()

void org.skia.jetski.Canvas.clipRect ( float  left,
float  top,
float  right,
float  bottom,
ClipOp  op,
boolean  antiAliasing 
)
inline

Definition at line 81 of file Canvas.java.

82 {
83 nClipRect(mNativeInstance, left, top, right, bottom, op.mNativeInt, antiAliasing);
84 }
static bool left(const SkPoint &p0, const SkPoint &p1)
static bool right(const SkPoint &p0, const SkPoint &p1)

◆ clipRRect()

void org.skia.jetski.Canvas.clipRRect ( float  left,
float  top,
float  right,
float  bottom,
float  xRad,
float  yRad,
ClipOp  op,
boolean  antiAliasing 
)
inline

Definition at line 86 of file Canvas.java.

87 {
88 nClipRRect(mNativeInstance, left, top, right, bottom, xRad, yRad, op.mNativeInt, antiAliasing);
89 }

◆ clipShader()

void org.skia.jetski.Canvas.clipShader ( Shader  shader,
ClipOp  op 
)
inline

Definition at line 91 of file Canvas.java.

91 {
92 nClipShader(mNativeInstance, shader.getNativeInstance(), op.mNativeInt);
93 }

◆ concat() [1/2]

void org.skia.jetski.Canvas.concat ( float[]  rowMajorMatrix)
inline

Definition at line 53 of file Canvas.java.

53 {
54 if (rowMajorMatrix.length != 16) {
55 throw new java.lang.IllegalArgumentException("Expecting a 16 float array.");
56 }
57
58 nConcat16f(mNativeInstance, rowMajorMatrix);
59 }

◆ concat() [2/2]

void org.skia.jetski.Canvas.concat ( Matrix  m)
inline

Definition at line 49 of file Canvas.java.

49 {
50 nConcat(mNativeInstance, m.getNativeInstance());
51 }

◆ drawColor() [1/3]

void org.skia.jetski.Canvas.drawColor ( Color  c)
inline

Definition at line 99 of file Canvas.java.

99 {
100 nDrawColor(mNativeInstance, c.r(), c.g(), c.b(), c.a());
101 }

◆ drawColor() [2/3]

void org.skia.jetski.Canvas.drawColor ( float  r,
float  g,
float  b,
float  a 
)
inline

Definition at line 103 of file Canvas.java.

103 {
104 nDrawColor(mNativeInstance, r, g, b, a);
105 }
static bool b
struct MyStruct a[10]

◆ drawColor() [3/3]

void org.skia.jetski.Canvas.drawColor ( int  icolor)
inline

Definition at line 107 of file Canvas.java.

107 {
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
113 );
114 }

◆ drawImage() [1/2]

void org.skia.jetski.Canvas.drawImage ( Image  image,
float  x,
float  y 
)
inline

Definition at line 116 of file Canvas.java.

116 {
118 }
void drawImage(Image image, float x, float y)
Definition Canvas.java:116
sk_sp< SkImage > image
Definition examples.cpp:29
double y
double x
SkSamplingOptions SamplingOptions(jint desc, jfloat coeffB, jfloat coeffC)
Definition Utils.cpp:13

◆ drawImage() [2/2]

void org.skia.jetski.Canvas.drawImage ( Image  image,
float  x,
float  y,
SamplingOptions  sampling 
)
inline

Definition at line 120 of file Canvas.java.

120 {
121 nDrawImage(mNativeInstance, image.getNativeInstance(), x, y,
122 sampling.getNativeDesc(), sampling.getCubicCoeffB(), sampling.getCubicCoeffC());
123 }
SkSamplingOptions sampling
Definition SkRecords.h:337

◆ drawPath()

void org.skia.jetski.Canvas.drawPath ( Path  path,
Paint  paint 
)
inline

Definition at line 125 of file Canvas.java.

125 {
126 nDrawPath(mNativeInstance, path.getNativeInstance(), paint.getNativeInstance());
127 }
const Paint & paint

◆ drawRect()

void org.skia.jetski.Canvas.drawRect ( float  left,
float  top,
float  right,
float  bottom,
Paint  paint 
)
inline

Definition at line 95 of file Canvas.java.

95 {
96 nDrawRect(mNativeInstance, left, top, right, bottom, paint.getNativeInstance());
97 }

◆ getHeight()

int org.skia.jetski.Canvas.getHeight ( )
inline

Definition at line 20 of file Canvas.java.

20 {
21 return nGetHeight(mNativeInstance);
22 }

◆ getLocalToDevice()

Matrix org.skia.jetski.Canvas.getLocalToDevice ( )
inline

Definition at line 44 of file Canvas.java.

44 {
45 long native_matrix = nGetLocalToDevice(mNativeInstance);
46 return new Matrix(native_matrix);
47 }

◆ getNativeInstance()

long org.skia.jetski.Canvas.getNativeInstance ( )
inlinepackage

Definition at line 136 of file Canvas.java.

136{ return mNativeInstance; }

◆ getWidth()

int org.skia.jetski.Canvas.getWidth ( )
inline

Definition at line 16 of file Canvas.java.

16 {
17 return nGetWidth(mNativeInstance);
18 }

◆ restore()

void org.skia.jetski.Canvas.restore ( )
inline

Definition at line 28 of file Canvas.java.

28 {
29 nRestore(mNativeInstance);
30 }

◆ restoreToCount()

void org.skia.jetski.Canvas.restoreToCount ( int  count)
inline

Definition at line 32 of file Canvas.java.

32 {
33 nRestoreToCount(mNativeInstance, count);
34 }
int count

◆ save()

int org.skia.jetski.Canvas.save ( )
inline

Definition at line 24 of file Canvas.java.

24 {
25 return nSave(mNativeInstance);
26 }

◆ saveLayer()

int org.skia.jetski.Canvas.saveLayer ( @Nullable Paint  paint)
inline

Definition at line 36 of file Canvas.java.

36 {
37 long nativePaint = 0;
38 if (paint != null) {
39 nativePaint = paint.getNativeInstance();
40 }
41 return nSaveLayer(mNativeInstance, nativePaint);
42 }

◆ scale() [1/2]

void org.skia.jetski.Canvas.scale ( float  sx,
float  sy 
)
inline

Definition at line 73 of file Canvas.java.

73 {
74 nScale(mNativeInstance, sx ,sy, 1);
75 }

◆ scale() [2/2]

void org.skia.jetski.Canvas.scale ( float  sx,
float  sy,
float  sz 
)
inline

Definition at line 69 of file Canvas.java.

69 {
70 nScale(mNativeInstance, sx ,sy, sz);
71 }

◆ translate() [1/2]

void org.skia.jetski.Canvas.translate ( float  tx,
float  ty 
)
inline

Definition at line 65 of file Canvas.java.

65 {
66 nTranslate(mNativeInstance, tx ,ty, 0);
67 }

◆ translate() [2/2]

void org.skia.jetski.Canvas.translate ( float  tx,
float  ty,
float  tz 
)
inline

Definition at line 61 of file Canvas.java.

61 {
62 nTranslate(mNativeInstance, tx ,ty, tz);
63 }

The documentation for this class was generated from the following file: