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

Go to the source code of this file.

Functions

 REG_FIDDLE (Matrix_invert, 256, 128, false, 0)
 

Function Documentation

◆ REG_FIDDLE()

REG_FIDDLE ( Matrix_invert  ,
256  ,
128  ,
false  ,
 
)

Definition at line 4 of file Matrix_invert.cpp.

4 {
5void draw(SkCanvas* canvas) {
6 const SkPoint src[] = { { 10, 120}, {120, 120}, {120, 10}, { 10, 10} };
7 const SkPoint dst[] = { {150, 120}, {200, 100}, {240, 30}, { 130, 40} };
9 paint.setAntiAlias(true);
11 matrix.setPolyToPoly(src, dst, 4);
14 paint.setColor(SK_ColorBLUE);
15 paint.setStrokeWidth(3);
16 paint.setStrokeCap(SkPaint::kRound_Cap);
18 if (matrix.invert(&matrix)) {
19 canvas->concat(matrix);
21 }
22}
23} // END FIDDLE
constexpr SkColor SK_ColorBLUE
Definition: SkColor.h:135
static void draw(SkCanvas *canvas, SkRect &target, int x, int y)
Definition: aaclip.cpp:27
void drawPoints(PointMode mode, size_t count, const SkPoint pts[], const SkPaint &paint)
Definition: SkCanvas.cpp:1710
void concat(const SkMatrix &matrix)
Definition: SkCanvas.cpp:1318
@ kPolygon_PointMode
draw the array of points as a open polygon
Definition: SkCanvas.h:1243
@ kPoints_PointMode
draw each point separately
Definition: SkCanvas.h:1241
@ kRound_Cap
adds circle
Definition: SkPaint.h:335
const Paint & paint
Definition: color_source.cc:38
unsigned useCenter Optional< SkMatrix > matrix
Definition: SkRecords.h:258
dst
Definition: cp.py:12