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

Go to the source code of this file.

Functions

 REG_FIDDLE (Matrix_mapRectToQuad, 256, 192, false, 0)
 

Function Documentation

◆ REG_FIDDLE()

REG_FIDDLE ( Matrix_mapRectToQuad  ,
256  ,
192  ,
false  ,
 
)

Definition at line 4 of file Matrix_mapRectToQuad.cpp.

4 {
5void draw(SkCanvas* canvas) {
7 paint.setAntiAlias(true);
9 matrix.setRotate(60, 128, 128);
10 SkRect rect = {50, 50, 150, 150};
11 SkPoint pts[4];
12 matrix.mapRectToQuad(pts, rect);
13 for (int i = 0; i < 4; ++i) {
14 canvas->drawCircle(pts[i].fX, pts[i].fY, 3, paint);
15 }
16 canvas->concat(matrix);
18 canvas->drawRect(rect, paint);
19}
20} // END FIDDLE
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 concat(const SkMatrix &matrix)
Definition: SkCanvas.cpp:1318
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
const Paint & paint
Definition: color_source.cc:38
unsigned useCenter Optional< SkMatrix > matrix
Definition: SkRecords.h:258
sk_sp< SkBlender > blender SkRect rect
Definition: SkRecords.h:350