android.graphics.Region#Op ( )源码实例Demo

下面列出了android.graphics.Region#Op ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: android-DecoView-charting   文件: PieSeries.java
/**
 * Draw the {@link EdgeDetail} for this View. Note that on API 11 - 17 clipPath is only available
 * if HardwareAcceleration is disable. A function {@link DecoView#enableCompatibilityMode()}
 * is provided which will disable on affected platforms however this needs to be explicitly
 * called by the user, otherwise EdgeDetails will not be drawn
 */
protected void drawClippedArc(@NonNull Canvas canvas, @NonNull Path path, int color, @NonNull Region.Op combine) {
    canvas.save();

    try {
        canvas.clipPath(path, combine);
    } catch (UnsupportedOperationException e) {
        Log.w(TAG, "clipPath unavailable on API 11 - 17 without disabling hardware acceleration. (EdgeDetail functionality requires clipPath). Call DecoView.enableCompatibilityMode() to enable");
        canvas.restore();
        return;
    }

    int colorOld = mPaint.getColor();
    Shader shaderOld = mPaint.getShader();
    mPaint.setColor(color);
    mPaint.setShader(null);
    drawArc(canvas);
    mPaint.setColor(colorOld);
    mPaint.setShader(shaderOld);
    canvas.restore();
}
 
源代码2 项目: android-DecoView-charting   文件: LineArcSeries.java
/**
 * Draw the {@link EdgeDetail} for this View. Note that on API 11 - 17 clipPath is only available
 * if HardwareAcceleration is disable. A function {@link DecoView#enableCompatibilityMode()}
 * is provided which will disable on affected platforms however this needs to be explicitly
 * called by the user, otherwise EdgeDetails will not be drawn
 */
protected void drawClippedArc(@NonNull Canvas canvas, @NonNull Path path, int color, @NonNull Region.Op combine) {
    canvas.save();

    try {
        canvas.clipPath(path, combine);
    } catch (UnsupportedOperationException e) {
        Log.w(TAG, "clipPath unavailable on API 11 - 17 without disabling hardware acceleration. (EdgeDetail functionality requires clipPath). Call DecoView.enableCompatibilityMode() to enable");
        canvas.restore();
        return;
    }

    int colorOld = mPaint.getColor();
    mPaint.setColor(color);
    drawArc(canvas);
    mPaint.setColor(colorOld);
    canvas.restore();
}
 
源代码3 项目: LaunchEnr   文件: FolderIcon.java
private void clipCanvasSoftware(Canvas canvas, Region.Op op) {
    mPath.reset();
    float r = getScaledRadius();
    mPath.addCircle(r + getOffsetX(), r + getOffsetY(), r, Path.Direction.CW);
    canvas.clipPath(mPath, op);
}
 
源代码4 项目: CircularReveal   文件: ViewRevealManager.java
/** @see Canvas#clipPath(Path, Region.Op) */
public Region.Op op() {
  return op;
}
 
源代码5 项目: madge   文件: DelegateCanvas.java
@Override public boolean clipRect(RectF rect, Region.Op op) {
  return delegate.clipRect(rect, op);
}
 
源代码6 项目: madge   文件: DelegateCanvas.java
@Override public boolean clipRect(Rect rect, Region.Op op) {
  return delegate.clipRect(rect, op);
}
 
源代码7 项目: madge   文件: DelegateCanvas.java
@Override
public boolean clipRect(float left, float top, float right, float bottom, Region.Op op) {
  return delegate.clipRect(left, top, right, bottom, op);
}
 
源代码8 项目: madge   文件: DelegateCanvas.java
@Override public boolean clipPath(Path path, Region.Op op) {
  return delegate.clipPath(path, op);
}
 
源代码9 项目: madge   文件: DelegateCanvas.java
@Override public boolean clipRegion(Region region, Region.Op op) {
  return delegate.clipRegion(region, op);
}
 
源代码10 项目: OpenMapKitAndroid   文件: ISafeCanvas.java
/**
 * Modify the current clip with the specified rectangle, which is expressed in local
 * coordinates.
 *
 * @param rect The rectangle to intersect with the current clip.
 * @param op How the clip is modified
 * @return true if the resulting clip is non-empty
 */
public abstract boolean clipRect(Rect rect, Region.Op op);
 
源代码11 项目: OpenMapKitAndroid   文件: ISafeCanvas.java
/**
 * Modify the current clip with the specified rectangle, which is expressed in local
 * coordinates.
 *
 * @param left The left side of the rectangle to intersect with the current clip
 * @param top The top of the rectangle to intersect with the current clip
 * @param right The right side of the rectangle to intersect with the current clip
 * @param bottom The bottom of the rectangle to intersect with the current clip
 * @param op How the clip is modified
 * @return true if the resulting clip is non-empty
 */
public abstract boolean clipRect(double left, double top, double right, double bottom,
        Region.Op op);
 
源代码12 项目: OpenMapKitAndroid   文件: ISafeCanvas.java
/**
 * Modify the current clip with the specified path.
 *
 * @param path The path to operate on the current clip
 * @param op How the clip is modified
 * @return true if the resulting is non-empty
 */
public abstract boolean clipPath(SafeTranslatedPath path, Region.Op op);
 
源代码13 项目: OpenMapKitAndroid   文件: ISafeCanvas.java
/**
 * Modify the current clip with the specified region. Note that unlike clipRect() and
 * clipPath()
 * which transform their arguments by the current matrix, clipRegion() assumes its argument is
 * already in the coordinate system of the current layer's bitmap, and so not transformation is
 * performed.
 *
 * @param region The region to operate on the current clip, based on op
 * @param op How the clip is modified
 * @return true if the resulting is non-empty
 */
public abstract boolean clipRegion(Region region, Region.Op op);