Flutter Engine
The Flutter Engine
Canvas_clipRect_2.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_clipRect_2, 280, 192, false, 0) {
5void draw(SkCanvas* canvas) {
8 canvas->save();
9 canvas->clipRect(SkRect::MakeWH(90, 120), op, false);
10 canvas->drawCircle(100, 100, 60, paint);
11 canvas->restore();
12 canvas->translate(80, 0);
13 }
14}
15} // END FIDDLE
REG_FIDDLE(Canvas_clipRect_2, 280, 192, false, 0)
SkClipOp
Definition: SkClipOp.h:13
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
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
static constexpr SkRect MakeWH(float w, float h)
Definition: SkRect.h:609