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

Go to the source code of this file.

Functions

 REG_FIDDLE (Canvas_save, 256, 100, false, 0)
 

Function Documentation

◆ REG_FIDDLE()

REG_FIDDLE ( Canvas_save  ,
256  ,
100  ,
false  ,
 
)

Definition at line 4 of file Canvas_save.cpp.

4 {
5void draw(SkCanvas* canvas) {
7 SkRect rect = { 0, 0, 25, 25 };
8 canvas->drawRect(rect, paint);
9 canvas->save();
10 canvas->translate(50, 50);
11 canvas->drawRect(rect, paint);
12 canvas->restore();
13 paint.setColor(SK_ColorRED);
14 canvas->drawRect(rect, paint);
15}
16} // END FIDDLE
constexpr SkColor SK_ColorRED
Definition: SkColor.h:126
static void draw(SkCanvas *canvas, SkRect &target, int x, int y)
Definition: aaclip.cpp:27
void drawRect(const SkRect &rect, const SkPaint &paint)
Definition: SkCanvas.cpp:1673
void restore()
Definition: SkCanvas.cpp:461
void translate(SkScalar dx, SkScalar dy)
Definition: SkCanvas.cpp:1278
int save()
Definition: SkCanvas.cpp:447
const Paint & paint
Definition: color_source.cc:38
sk_sp< SkBlender > blender SkRect rect
Definition: SkRecords.h:350