Flutter Engine
The Flutter Engine
Functions
Canvas_clipRect_3.cpp File Reference
#include "tools/fiddle/examples.h"

Go to the source code of this file.

Functions

 REG_FIDDLE (Canvas_clipRect_3, 256, 133, false, 0)
 

Function Documentation

◆ REG_FIDDLE()

REG_FIDDLE ( Canvas_clipRect_3  ,
256  ,
133  ,
false  ,
 
)

Definition at line 4 of file Canvas_clipRect_3.cpp.

4 {
5void draw(SkCanvas* canvas) {
6 canvas->clear(SK_ColorWHITE);
8 paint.setAntiAlias(true);
9 paint.setColor(0x8055aaff);
10 SkRect clipRect = { 0, 0, 87.4f, 87.4f };
11 for (auto alias: { false, true } ) {
12 canvas->save();
13 canvas->clipRect(clipRect, SkClipOp::kIntersect, alias);
14 canvas->drawCircle(67, 67, 60, paint);
15 canvas->restore();
16 canvas->save();
18 canvas->drawCircle(67, 67, 60, paint);
19 canvas->restore();
20 canvas->translate(120, 0);
21 }
22}
23} // END FIDDLE
constexpr SkColor SK_ColorWHITE
Definition: SkColor.h:122
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 clear(SkColor color)
Definition: SkCanvas.h:1199
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
clipRect(r.rect, r.opAA.op(), r.opAA.aa())) template<> void Draw