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

Go to the source code of this file.

Functions

 REG_FIDDLE (Canvas_saveLayer_3, 256, 256, false, 3)
 

Function Documentation

◆ REG_FIDDLE()

REG_FIDDLE ( Canvas_saveLayer_3  ,
256  ,
256  ,
false  ,
 
)

Definition at line 4 of file Canvas_saveLayer_3.cpp.

4 {
5void draw(SkCanvas* canvas) {
6 canvas->drawImage(image, 0, 0);
9 paint.setBlendMode(SkBlendMode::kPlus);
11 rec.fPaint = &paint;
12 canvas->saveLayer(rec);
13 paint.setBlendMode(SkBlendMode::kClear);
14 canvas->drawCircle(128, 128, 96, paint);
15 canvas->restore();
16}
17} // END FIDDLE
@ kPlus
r = min(s + d, 1)
@ kClear
r = 0
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 restore()
Definition: SkCanvas.cpp:461
@ kInitWithPrevious_SaveLayerFlag
initializes with previous contents
Definition: SkCanvas.h:672
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
const Paint & paint
Definition: color_source.cc:38
sk_sp< const SkImage > image
Definition: SkRecords.h:269
const SkPaint * fPaint
Definition: SkCanvas.h:743
SaveLayerFlags fSaveLayerFlags
Definition: SkCanvas.h:763