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

Go to the source code of this file.

Functions

 REG_FIDDLE (Src, 256, 256, false, 3)
 

Function Documentation

◆ REG_FIDDLE()

REG_FIDDLE ( Src  ,
256  ,
256  ,
false  ,
 
)

Definition at line 4 of file Src.cpp.

4 {
5void draw(SkCanvas* canvas) {
6 canvas->drawImage(image, 0, 0);
7 canvas->clipRect({50, 50, 200, 200});
8 SkPaint srcBlend;
10 canvas->saveLayer(nullptr, &srcBlend);
11 canvas->drawColor(0);
12 SkPaint transRed;
13 transRed.setColor(SkColorSetA(SK_ColorRED, 127));
14 canvas->drawCircle(125, 125, 75, transRed);
15 canvas->restore();
16}
17} // END FIDDLE
static constexpr SkColor SkColorSetA(SkColor c, U8CPU a)
Definition: SkColor.h:82
constexpr SkColor SK_ColorRED
Definition: SkColor.h:126
static void draw(SkCanvas *canvas, SkRect &target, int x, int y)
Definition: aaclip.cpp:27
int saveLayer(const SkRect *bounds, const SkPaint *paint)
Definition: SkCanvas.cpp:496
void clipRect(const SkRect &rect, SkClipOp op, bool doAntiAlias)
Definition: SkCanvas.cpp:1361
void restore()
Definition: SkCanvas.cpp:461
void drawColor(SkColor color, SkBlendMode mode=SkBlendMode::kSrcOver)
Definition: SkCanvas.h:1182
void drawImage(const SkImage *image, SkScalar left, SkScalar top)
Definition: SkCanvas.h:1528
void drawCircle(SkScalar cx, SkScalar cy, SkScalar radius, const SkPaint &paint)
Definition: SkCanvas.cpp:2707
void setColor(SkColor color)
Definition: SkPaint.cpp:119
void setBlendMode(SkBlendMode mode)
Definition: SkPaint.cpp:151
sk_sp< const SkImage > image
Definition: SkRecords.h:269