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

Go to the source code of this file.

Functions

 REG_FIDDLE (Canvas_drawRect, 256, 256, false, 0)
 

Function Documentation

◆ REG_FIDDLE()

REG_FIDDLE ( Canvas_drawRect  ,
256  ,
256  ,
false  ,
 
)

Definition at line 4 of file Canvas_drawRect.cpp.

4 {
5void draw(SkCanvas* canvas) {
6 SkPoint rectPts[] = { {64, 48}, {192, 160} };
8 paint.setAntiAlias(true);
10 paint.setStrokeWidth(20);
11 paint.setStrokeJoin(SkPaint::kRound_Join);
12 SkMatrix rotator;
13 rotator.setRotate(30, 128, 128);
15 paint.setColor(color);
17 rect.set(rectPts[0], rectPts[1]);
18 canvas->drawRect(rect, paint);
19 rotator.mapPoints(rectPts, 2);
20 }
21}
22} // END FIDDLE
constexpr SkColor SK_ColorYELLOW
Definition: SkColor.h:139
constexpr SkColor SK_ColorMAGENTA
Definition: SkColor.h:147
constexpr SkColor SK_ColorBLUE
Definition: SkColor.h:135
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 mapPoints(SkPoint dst[], const SkPoint src[], int count) const
Definition: SkMatrix.cpp:770
SkMatrix & setRotate(SkScalar degrees, SkScalar px, SkScalar py)
Definition: SkMatrix.cpp:452
@ kStroke_Style
set to stroke geometry
Definition: SkPaint.h:194
@ kRound_Join
adds circle
Definition: SkPaint.h:360
const Paint & paint
Definition: color_source.cc:38
DlColor color
sk_sp< SkBlender > blender SkRect rect
Definition: SkRecords.h:350