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

Go to the source code of this file.

Functions

 REG_FIDDLE (skcanvas_square, 256, 256, false, 0)
 

Function Documentation

◆ REG_FIDDLE()

REG_FIDDLE ( skcanvas_square  ,
256  ,
256  ,
false  ,
 
)

Definition at line 4 of file skcanvas_square.cpp.

4 {
5void draw(SkCanvas* canvas) {
6 canvas->save();
7 canvas->translate(SkIntToScalar(128), SkIntToScalar(128));
8 canvas->rotate(SkIntToScalar(45));
9 SkRect rect = SkRect::MakeXYWH(-90.5f, -90.5f, 181.0f, 181.0f);
11 paint.setColor(SK_ColorBLUE);
12 canvas->drawRect(rect, paint);
13 canvas->restore();
14}
15} // END FIDDLE
constexpr SkColor SK_ColorBLUE
Definition: SkColor.h:135
#define SkIntToScalar(x)
Definition: SkScalar.h:57
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
void rotate(SkScalar degrees)
Definition: SkCanvas.cpp:1300
int save()
Definition: SkCanvas.cpp:447
const Paint & paint
Definition: color_source.cc:38
sk_sp< SkBlender > blender SkRect rect
Definition: SkRecords.h:350
static constexpr SkRect MakeXYWH(float x, float y, float w, float h)
Definition: SkRect.h:659