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

Go to the source code of this file.

Functions

 REG_FIDDLE_ANIMATED (shapes, 256, 256, false, 5, 0)
 

Function Documentation

◆ REG_FIDDLE_ANIMATED()

REG_FIDDLE_ANIMATED ( shapes  ,
256  ,
256  ,
false  ,
,
 
)

Definition at line 4 of file shapes.cpp.

4 {
5void draw(SkCanvas* canvas) {
7
10 paint.setAntiAlias(true);
11 paint.setStrokeWidth(4);
12 paint.setColor(0xff4285F4);
13
14 SkRect rect = SkRect::MakeXYWH(10, 10, 100, 160);
15 canvas->drawRect(rect, paint);
16
18 oval.setOval(rect);
19 oval.offset(40, 80);
20 paint.setColor(0xffDB4437);
21 canvas->drawRRect(oval, paint);
22
23 paint.setColor(0xff0F9D58);
24 canvas->drawCircle(180, 50, 25, paint);
25
26 rect.offset(80, 50);
27 paint.setColor(0xffF4B400);
29 canvas->drawRoundRect(rect, 10, 10, paint);
30}
31} // END FIDDLE
constexpr SkColor SK_ColorWHITE
Definition: SkColor.h:122
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 drawColor(SkColor color, SkBlendMode mode=SkBlendMode::kSrcOver)
Definition: SkCanvas.h:1182
void drawRRect(const SkRRect &rrect, const SkPaint &paint)
Definition: SkCanvas.cpp:1705
void drawRoundRect(const SkRect &rect, SkScalar rx, SkScalar ry, const SkPaint &paint)
Definition: SkCanvas.cpp:2717
void drawCircle(SkScalar cx, SkScalar cy, SkScalar radius, const SkPaint &paint)
Definition: SkCanvas.cpp:2707
@ kStroke_Style
set to stroke geometry
Definition: SkPaint.h:194
@ kFill_Style
set to fill geometry
Definition: SkPaint.h:193
const Paint & paint
Definition: color_source.cc:38
SkRect oval
Definition: SkRecords.h:249
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
void offset(float dx, float dy)
Definition: SkRect.h:1016