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

Go to the source code of this file.

Functions

 REG_FIDDLE (Canvas_saveLayerAlpha, 256, 256, false, 0)
 

Function Documentation

◆ REG_FIDDLE()

REG_FIDDLE ( Canvas_saveLayerAlpha  ,
256  ,
256  ,
false  ,
 
)

Definition at line 4 of file Canvas_saveLayerAlpha.cpp.

4 {
5void draw(SkCanvas* canvas) {
7 paint.setColor(SK_ColorRED);
8 canvas->drawCircle(50, 50, 50, paint);
9 canvas->saveLayerAlpha(nullptr, 128);
10 paint.setColor(SK_ColorBLUE);
11 canvas->drawCircle(100, 50, 50, paint);
12 paint.setColor(SK_ColorGREEN);
13 paint.setAlpha(128);
14 canvas->drawCircle(75, 90, 50, paint);
15 canvas->restore();
16}
17} // END FIDDLE
constexpr SkColor SK_ColorBLUE
Definition: SkColor.h:135
constexpr SkColor SK_ColorRED
Definition: SkColor.h:126
constexpr SkColor SK_ColorGREEN
Definition: SkColor.h:131
static void draw(SkCanvas *canvas, SkRect &target, int x, int y)
Definition: aaclip.cpp:27
void restore()
Definition: SkCanvas.cpp:461
int saveLayerAlpha(const SkRect *bounds, U8CPU alpha)
Definition: SkCanvas.h:661
void drawCircle(SkScalar cx, SkScalar cy, SkScalar radius, const SkPaint &paint)
Definition: SkCanvas.cpp:2707
const Paint & paint
Definition: color_source.cc:38