Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Region_getBoundaryPath.cpp
Go to the documentation of this file.
1// Copyright 2019 Google LLC.
2// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
4// HASH=6631d36406efa3b3e27960c876421a7f
5REG_FIDDLE(Region_getBoundaryPath, 256, 100, false, 0) {
6void draw(SkCanvas* canvas) {
7 SkRegion region;
8 region.setRect({10, 20, 90, 60});
9 region.op({30, 40, 60, 80}, SkRegion::kXOR_Op);
10 canvas->drawRegion(region, SkPaint());
11 SkPath path;
12 region.getBoundaryPath(&path);
13 path.offset(100, 0);
14 canvas->drawPath(path, SkPaint());
15}
16} // END FIDDLE
static void draw(SkCanvas *canvas, SkRect &target, int x, int y)
Definition aaclip.cpp:27
void drawRegion(const SkRegion &region, const SkPaint &paint)
void drawPath(const SkPath &path, const SkPaint &paint)
bool getBoundaryPath(SkPath *path) const
@ kXOR_Op
target exclusive or with operand
Definition SkRegion.h:370
bool op(const SkIRect &rect, Op op)
Definition SkRegion.h:384
bool setRect(const SkIRect &rect)
Definition SkRegion.cpp:192
#define REG_FIDDLE(NAME, W, H, TEXT, I)
Definition examples.h:60