Flutter Engine
The Flutter Engine
Canvas_clipRegion.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.
4REG_FIDDLE(Canvas_clipRegion, 256, 256, false, 0) {
5void draw(SkCanvas* canvas) {
7 paint.setAntiAlias(true);
8 SkIRect iRect = {30, 40, 120, 130 };
9 SkRegion region(iRect);
10 canvas->rotate(10);
11 canvas->save();
13 canvas->drawCircle(50, 50, 45, paint);
14 canvas->restore();
15 canvas->translate(100, 100);
17 canvas->drawCircle(50, 50, 45, paint);
18}
19} // END FIDDLE
REG_FIDDLE(Canvas_clipRegion, 256, 256, false, 0)
static void draw(SkCanvas *canvas, SkRect &target, int x, int y)
Definition: aaclip.cpp:27
void clipRect(const SkRect &rect, SkClipOp op, bool doAntiAlias)
Definition: SkCanvas.cpp:1361
void restore()
Definition: SkCanvas.cpp:461
void translate(SkScalar dx, SkScalar dy)
Definition: SkCanvas.cpp:1278
void clipRegion(const SkRegion &deviceRgn, SkClipOp op=SkClipOp::kIntersect)
Definition: SkCanvas.cpp:1510
void rotate(SkScalar degrees)
Definition: SkCanvas.cpp:1300
int save()
Definition: SkCanvas.cpp:447
void drawCircle(SkScalar cx, SkScalar cy, SkScalar radius, const SkPaint &paint)
Definition: SkCanvas.cpp:2707
const Paint & paint
Definition: color_source.cc:38
ClipOpAndAA opAA SkRegion region
Definition: SkRecords.h:238
Definition: SkRect.h:32
static SkRect Make(const SkISize &size)
Definition: SkRect.h:669