6 paint->setAntiAlias(
true);
27 const unsigned oneColor = 0xFF8080FF;
28 const unsigned twoColor = 0x807F1f1f;
30 makePaint(&fOnePaint, oneColor);
31 makePaint(&fTwoPaint, twoColor);
37 makePaint(&fOutlinePaint, 0xFF000000);
42 for (
int oneFill = 0; oneFill <= 1; ++oneFill) {
45 for (
int twoFill = 0; twoFill <= 1; ++twoFill) {
57 two.setFillType(twoF);
58 two.addRect(40, 40, 100, 100);
63 canvas->
drawPath(one, fOutlinePaint);
@ kReverseDifference_SkPathOp
subtract the first path from the op path
@ kDifference_SkPathOp
subtract the op path from the first path
@ kIntersect_SkPathOp
intersect the two paths
@ kUnion_SkPathOp
union (inclusive-or) the two paths
@ kXOR_SkPathOp
exclusive-or the two paths
static void draw(SkCanvas *canvas, SkRect &target, int x, int y)
void allocN32Pixels(int width, int height, bool isOpaque=false)
void clipRect(const SkRect &rect, SkClipOp op, bool doAntiAlias)
void translate(SkScalar dx, SkScalar dy)
void drawColor(SkColor color, SkBlendMode mode=SkBlendMode::kSrcOver)
void drawPath(const SkPath &path, const SkPaint &paint)
void setStyle(Style style)
@ kStroke_Style
set to stroke geometry
@ kFill_Style
set to fill geometry
SkPath & moveTo(SkScalar x, SkScalar y)
void setFillType(SkPathFillType ft)
SkPath & conicTo(SkScalar x1, SkScalar y1, SkScalar x2, SkScalar y2, SkScalar w)
static SkColor blend(SkColor dst, SkColor src, void(*mode)(float, float, float, float *, float *, float *))
REG_FIDDLE(pathops, 1000, 600, false, 0)
static constexpr SkRect MakeWH(float w, float h)