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

Go to the source code of this file.

Functions

 REG_FIDDLE (Matrix_mapRect_2, 256, 256, false, 0)
 

Function Documentation

◆ REG_FIDDLE()

REG_FIDDLE ( Matrix_mapRect_2  ,
256  ,
256  ,
false  ,
 
)

Definition at line 4 of file Matrix_mapRect_2.cpp.

4 {
5void draw(SkCanvas* canvas) {
7 paint.setAntiAlias(true);
9 matrix.setRotate(45, 128, 128);
10 SkRect bounds = {40, 50, 190, 200};
11 matrix.mapRect(&bounds);
12 paint.setColor(SK_ColorGRAY);
13 canvas->drawRect(bounds, paint);
14 canvas->concat(matrix);
15 paint.setColor(SK_ColorRED);
16 canvas->drawRect({40, 50, 190, 200}, paint);
17}
18} // END FIDDLE
constexpr SkColor SK_ColorGRAY
Definition: SkColor.h:113
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 concat(const SkMatrix &matrix)
Definition: SkCanvas.cpp:1318
const Paint & paint
Definition: color_source.cc:38
unsigned useCenter Optional< SkMatrix > matrix
Definition: SkRecords.h:258
Optional< SkRect > bounds
Definition: SkRecords.h:189