Methods Summary |
---|
public void | addArc(RectF oval, float startAngle, float sweepAngle)Add the specified arc to the path as a new contour.
if (oval == null) {
throw new NullPointerException("need oval parameter");
}
native_addArc(mNativePath, oval, startAngle, sweepAngle);
|
public void | addCircle(float x, float y, float radius, android.graphics.Path$Direction dir)Add a closed circle contour to the path
native_addCircle(mNativePath, x, y, radius, dir.nativeInt);
|
public void | addOval(RectF oval, android.graphics.Path$Direction dir)Add a closed oval contour to the path
if (oval == null) {
throw new NullPointerException("need oval parameter");
}
native_addOval(mNativePath, oval, dir.nativeInt);
|
public void | addPath(android.graphics.Path src, float dx, float dy)Add a copy of src to the path, offset by (dx,dy)
native_addPath(mNativePath, src.mNativePath, dx, dy);
|
public void | addPath(android.graphics.Path src)Add a copy of src to the path
native_addPath(mNativePath, src.mNativePath);
|
public void | addPath(android.graphics.Path src, Matrix matrix)Add a copy of src to the path, transformed by matrix
native_addPath(mNativePath, src.mNativePath, matrix.native_instance);
|
public void | addRect(RectF rect, android.graphics.Path$Direction dir)Add a closed rectangle contour to the path
if (rect == null) {
throw new NullPointerException("need rect parameter");
}
native_addRect(mNativePath, rect, dir.nativeInt);
|
public void | addRect(float left, float top, float right, float bottom, android.graphics.Path$Direction dir)Add a closed rectangle contour to the path
native_addRect(mNativePath, left, top, right, bottom, dir.nativeInt);
|
public void | addRoundRect(RectF rect, float rx, float ry, android.graphics.Path$Direction dir)Add a closed round-rectangle contour to the path
if (rect == null) {
throw new NullPointerException("need rect parameter");
}
native_addRoundRect(mNativePath, rect, rx, ry, dir.nativeInt);
|
public void | addRoundRect(RectF rect, float[] radii, android.graphics.Path$Direction dir)Add a closed round-rectangle contour to the path. Each corner receives
two radius values [X, Y]. The corners are ordered top-left, top-right,
bottom-right, bottom-left
if (rect == null) {
throw new NullPointerException("need rect parameter");
}
if (radii.length < 8) {
throw new ArrayIndexOutOfBoundsException("radii[] needs 8 values");
}
native_addRoundRect(mNativePath, rect, radii, dir.nativeInt);
|
public void | arcTo(RectF oval, float startAngle, float sweepAngle, boolean forceMoveTo)Append the specified arc to the path as a new contour. If the start of
the path is different from the path's current last point, then an
automatic lineTo() is added to connect the current contour to the
start of the arc. However, if the path is empty, then we call moveTo()
with the first point of the arc. The sweep angle is tread mod 360.
native_arcTo(mNativePath, oval, startAngle, sweepAngle, forceMoveTo);
|
public void | arcTo(RectF oval, float startAngle, float sweepAngle)Append the specified arc to the path as a new contour. If the start of
the path is different from the path's current last point, then an
automatic lineTo() is added to connect the current contour to the
start of the arc. However, if the path is empty, then we call moveTo()
with the first point of the arc.
native_arcTo(mNativePath, oval, startAngle, sweepAngle, false);
|
public void | close()Close the current contour. If the current point is not equal to the
first point of the contour, a line segment is automatically added.
native_close(mNativePath);
|
public void | computeBounds(RectF bounds, boolean exact)Compute the bounds of the path, and write the answer into bounds. If the
path contains 0 or 1 points, the bounds is set to (0,0,0,0)
// 1-exact, 0-fast correspond to the values in SkPath.h
native_computeBounds(mNativePath, bounds, exact ? 1 : 0);
|
public void | cubicTo(float x1, float y1, float x2, float y2, float x3, float y3)Add a cubic bezier from the last point, approaching control points
(x1,y1) and (x2,y2), and ending at (x3,y3). If no moveTo() call has been
made for this contour, the first point is automatically set to (0,0).
native_cubicTo(mNativePath, x1, y1, x2, y2, x3, y3);
|
protected void | finalize()
try {
finalizer(mNativePath);
} finally {
super.finalize();
}
|
private static native void | finalizer(int nPath)
|
public android.graphics.Path$FillType | getFillType()Return the path's fill type. This defines how "inside" is
computed. The default value is WINDING.
return sFillTypeArray[native_getFillType(mNativePath)];
|
public void | incReserve(int extraPtCount)Hint to the path to prepare for adding more points. This can allow the
path to more efficiently allocate its storage.
native_incReserve(mNativePath, extraPtCount);
|
private static native int | init1()
|
private static native int | init2(int nPath)
|
public boolean | isEmpty()Returns true if the path is empty (contains no lines or curves)
return native_isEmpty(mNativePath);
|
public boolean | isInverseFillType()Returns true if the filltype is one of the INVERSE variants
final int ft = native_getFillType(mNativePath);
return (ft & 2) != 0;
|
public boolean | isRect(RectF rect)Returns true if the path specifies a rectangle. If so, and if rect is
not null, set rect to the bounds of the path. If the path does not
specify a rectangle, return false and ignore rect.
return native_isRect(mNativePath, rect);
|
public void | lineTo(float x, float y)Add a line from the last point to the specified point (x,y).
If no moveTo() call has been made for this contour, the first point is
automatically set to (0,0).
native_lineTo(mNativePath, x, y);
|
public void | moveTo(float x, float y)Set the beginning of the next contour to the point (x,y).
native_moveTo(mNativePath, x, y);
|
private static native void | native_addArc(int nPath, RectF oval, float startAngle, float sweepAngle)
|
private static native void | native_addCircle(int nPath, float x, float y, float radius, int dir)
|
private static native void | native_addOval(int nPath, RectF oval, int dir)
|
private static native void | native_addPath(int nPath, int src, float dx, float dy)
|
private static native void | native_addPath(int nPath, int src)
|
private static native void | native_addPath(int nPath, int src, int matrix)
|
private static native void | native_addRect(int nPath, RectF rect, int dir)
|
private static native void | native_addRect(int nPath, float left, float top, float right, float bottom, int dir)
|
private static native void | native_addRoundRect(int nPath, RectF rect, float rx, float ry, int dir)
|
private static native void | native_addRoundRect(int nPath, RectF r, float[] radii, int dir)
|
private static native void | native_arcTo(int nPath, RectF oval, float startAngle, float sweepAngle, boolean forceMoveTo)
|
private static native void | native_close(int nPath)
|
private static native void | native_computeBounds(int nPath, RectF bounds, int btype)
|
private static native void | native_cubicTo(int nPath, float x1, float y1, float x2, float y2, float x3, float y3)
|
private static native int | native_getFillType(int nPath)
|
private static native void | native_incReserve(int nPath, int extraPtCount)
|
private static native boolean | native_isEmpty(int nPath)
|
private static native boolean | native_isRect(int nPath, RectF rect)
|
private static native void | native_lineTo(int nPath, float x, float y)
|
private static native void | native_moveTo(int nPath, float x, float y)
|
private static native void | native_offset(int nPath, float dx, float dy, int dst_path)
|
private static native void | native_offset(int nPath, float dx, float dy)
|
private static native void | native_quadTo(int nPath, float x1, float y1, float x2, float y2)
|
private static native void | native_rCubicTo(int nPath, float x1, float y1, float x2, float y2, float x3, float y3)
|
private static native void | native_rLineTo(int nPath, float dx, float dy)
|
private static native void | native_rMoveTo(int nPath, float dx, float dy)
|
private static native void | native_rQuadTo(int nPath, float dx1, float dy1, float dx2, float dy2)
|
private static native void | native_reset(int nPath)
|
private static native void | native_rewind(int nPath)
|
private static native void | native_set(int native_dst, int native_src)
|
private static native void | native_setFillType(int nPath, int ft)
|
private static native void | native_setLastPoint(int nPath, float dx, float dy)
|
private static native void | native_transform(int nPath, int matrix, int dst_path)
|
private static native void | native_transform(int nPath, int matrix)
|
final int | ni()
return mNativePath;
|
public void | offset(float dx, float dy, android.graphics.Path dst)Offset the path by (dx,dy), returning true on success
int dstNative = 0;
if (dst != null) {
dstNative = dst.mNativePath;
}
native_offset(mNativePath, dx, dy, dstNative);
|
public void | offset(float dx, float dy)Offset the path by (dx,dy), returning true on success
native_offset(mNativePath, dx, dy);
|
public void | quadTo(float x1, float y1, float x2, float y2)Add a quadratic bezier from the last point, approaching control point
(x1,y1), and ending at (x2,y2). If no moveTo() call has been made for
this contour, the first point is automatically set to (0,0).
native_quadTo(mNativePath, x1, y1, x2, y2);
|
public void | rCubicTo(float x1, float y1, float x2, float y2, float x3, float y3)Same as cubicTo, but the coordinates are considered relative to the
current point on this contour. If there is no previous point, then a
moveTo(0,0) is inserted automatically.
native_rCubicTo(mNativePath, x1, y1, x2, y2, x3, y3);
|
public void | rLineTo(float dx, float dy)Same as lineTo, but the coordinates are considered relative to the last
point on this contour. If there is no previous point, then a moveTo(0,0)
is inserted automatically.
native_rLineTo(mNativePath, dx, dy);
|
public void | rMoveTo(float dx, float dy)Set the beginning of the next contour relative to the last point on the
previous contour. If there is no previous contour, this is treated the
same as moveTo().
native_rMoveTo(mNativePath, dx, dy);
|
public void | rQuadTo(float dx1, float dy1, float dx2, float dy2)Same as quadTo, but the coordinates are considered relative to the last
point on this contour. If there is no previous point, then a moveTo(0,0)
is inserted automatically.
native_rQuadTo(mNativePath, dx1, dy1, dx2, dy2);
|
public void | reset()Clear any lines and curves from the path, making it empty.
This does NOT change the fill-type setting.
native_reset(mNativePath);
|
public void | rewind()Rewinds the path: clears any lines and curves from the path but
keeps the internal data structure for faster reuse.
native_rewind(mNativePath);
|
public void | set(android.graphics.Path src)Replace the contents of this with the contents of src.
if (this != src) {
native_set(mNativePath, src.mNativePath);
}
|
public void | setFillType(android.graphics.Path$FillType ft)Set the path's fill type. This defines how "inside" is computed.
native_setFillType(mNativePath, ft.nativeInt);
|
public void | setLastPoint(float dx, float dy)Sets the last point of the path.
native_setLastPoint(mNativePath, dx, dy);
|
public void | toggleInverseFillType()Toggles the INVERSE state of the filltype
int ft = native_getFillType(mNativePath);
ft ^= 2;
native_setFillType(mNativePath, ft);
|
public void | transform(Matrix matrix, android.graphics.Path dst)Transform the points in this path by matrix, and write the answer
into dst. If dst is null, then the the original path is modified.
int dstNative = 0;
if (dst != null) {
dstNative = dst.mNativePath;
}
native_transform(mNativePath, matrix.native_instance, dstNative);
|
public void | transform(Matrix matrix)Transform the points in this path by matrix.
native_transform(mNativePath, matrix.native_instance);
|