Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
PathBuilder.java
Go to the documentation of this file.
1package org.skia.jetski;
2
3public class PathBuilder {
4 private long mNativeInstance;
5
6 public PathBuilder() {
7 mNativeInstance = nCreate();
8 }
9
10 /**
11 * Releases any resources associated with this Path.
12 */
13 public void release() {
14 nRelease(mNativeInstance);
15 mNativeInstance = 0;
16 }
17
18 public void moveTo(float x, float y) {
19 nMoveTo(mNativeInstance, x, y);
20 }
21
22 public void lineTo(float x, float y) {
23 nLineTo(mNativeInstance, x, y);
24 }
25
26 public void quadTo(float x1, float y1, float x2, float y2) {
27 nQuadTo(mNativeInstance, x1, y1, x2, y2);
28 }
29 public void conicTo(float x1, float y1, float x2, float y2, float w) {
30 nConicTo(mNativeInstance, x1, y1, x2, y2, w);
31 }
32 public void cubicTo(float x1, float y1, float x2, float y2, float x3, float y3) {
33 nCubicTo(mNativeInstance, x1, y1, x2, y2, x3, y3);
34 }
35
36 public void close() {
37 nClose(mNativeInstance);
38 }
39
40 public enum FillType {
45
46
47 FillType(int nativeInt) {
48 this.nativeInt = nativeInt;
49 }
50 final int nativeInt;
51 }
52 public void setFillType(FillType fillType) {
53 nSetFillType(mNativeInstance, fillType.nativeInt);
54 }
55
56 /*
57 * Returns a path from the builder, resets the builder to empty.
58 * Wrapper for SkPath::detach()
59 */
60 public Path makePath() {
61 return new Path(nMake(mNativeInstance));
62 }
63
64 // package private
65 long getNativeInstance() { return mNativeInstance; }
66
67 private static native long nCreate();
68 private static native void nRelease(long nativeInstance);
69 private static native void nMoveTo(long mNativeInstance, float x, float y);
70 private static native void nLineTo(long mNativeInstance, float x, float y);
71 private static native void nQuadTo(long mNativeInstance, float x1, float y1, float x2, float y2);
72 private static native void nConicTo(long mNativeInstance, float x1, float y1, float x2, float y2, float w);
73 private static native void nCubicTo(long mNativeInstance, float x1, float y1, float x2, float y2, float x3, float y3);
74 private static native void nClose(long mNativeInstance);
75 private static native void nSetFillType(long mNativeInstance, int fillType);
76 private static native long nMake(long mNativeInstance);
77
78
79}
void lineTo(float x, float y)
void conicTo(float x1, float y1, float x2, float y2, float w)
void quadTo(float x1, float y1, float x2, float y2)
void setFillType(FillType fillType)
void moveTo(float x, float y)
void cubicTo(float x1, float y1, float x2, float y2, float x3, float y3)
double y
double x
SkScalar w