aboutsummaryrefslogtreecommitdiff
path: root/nativeruntime/src/main/java/org/robolectric/nativeruntime/PathNatives.java
blob: 0870f6bf79f5dd7874393822399ebbc7b70ed556 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
package org.robolectric.nativeruntime;

import android.graphics.RectF;

/**
 * Native methods for Path JNI registration.
 *
 * <p>Native method signatures are derived from
 * https://cs.android.com/android/platform/superproject/+/android-12.0.0_r1:frameworks/base/graphics/java/android/graphics/Path.java
 */
public final class PathNatives {

  public static native long nInit();

  public static native long nInit(long nPath);

  public static native long nGetFinalizer();

  public static native void nSet(long nativeDst, long nSrc);

  public static native void nComputeBounds(long nPath, RectF bounds);

  public static native void nIncReserve(long nPath, int extraPtCount);

  public static native void nMoveTo(long nPath, float x, float y);

  public static native void nRMoveTo(long nPath, float dx, float dy);

  public static native void nLineTo(long nPath, float x, float y);

  public static native void nRLineTo(long nPath, float dx, float dy);

  public static native void nQuadTo(long nPath, float x1, float y1, float x2, float y2);

  public static native void nRQuadTo(long nPath, float dx1, float dy1, float dx2, float dy2);

  public static native void nCubicTo(
      long nPath, float x1, float y1, float x2, float y2, float x3, float y3);

  public static native void nRCubicTo(
      long nPath, float x1, float y1, float x2, float y2, float x3, float y3);

  public static native void nArcTo(
      long nPath,
      float left,
      float top,
      float right,
      float bottom,
      float startAngle,
      float sweepAngle,
      boolean forceMoveTo);

  public static native void nClose(long nPath);

  public static native void nAddRect(
      long nPath, float left, float top, float right, float bottom, int dir);

  public static native void nAddOval(
      long nPath, float left, float top, float right, float bottom, int dir);

  public static native void nAddCircle(long nPath, float x, float y, float radius, int dir);

  public static native void nAddArc(
      long nPath,
      float left,
      float top,
      float right,
      float bottom,
      float startAngle,
      float sweepAngle);

  public static native void nAddRoundRect(
      long nPath, float left, float top, float right, float bottom, float rx, float ry, int dir);

  public static native void nAddRoundRect(
      long nPath, float left, float top, float right, float bottom, float[] radii, int dir);

  public static native void nAddPath(long nPath, long src, float dx, float dy);

  public static native void nAddPath(long nPath, long src);

  public static native void nAddPath(long nPath, long src, long matrix);

  public static native void nOffset(long nPath, float dx, float dy);

  public static native void nSetLastPoint(long nPath, float dx, float dy);

  public static native void nTransform(long nPath, long matrix, long dstPath);

  public static native void nTransform(long nPath, long matrix);

  public static native boolean nOp(long path1, long path2, int op, long result);

  public static native boolean nIsRect(long nPath, RectF rect);

  public static native void nReset(long nPath);

  public static native void nRewind(long nPath);

  public static native boolean nIsEmpty(long nPath);

  public static native boolean nIsConvex(long nPath);

  public static native int nGetFillType(long nPath);

  public static native void nSetFillType(long nPath, int ft);

  public static native float[] nApproximate(long nPath, float error);

  private PathNatives() {}
}