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

Go to the source code of this file.

Functions

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

Function Documentation

◆ REG_FIDDLE()

REG_FIDDLE ( Matrix_setRSXform  ,
256  ,
128  ,
false  ,
 
)

Definition at line 4 of file Matrix_setRSXform.cpp.

4 {
5void draw(SkCanvas* canvas) {
7 paint.setColor(SK_ColorGRAY);
8 paint.setAntiAlias(true);
9 SkRect rect = {20, 20, 100, 100};
10 canvas->drawRect(rect, paint);
11 paint.setColor(SK_ColorRED);
13 matrix.setRSXform(SkRSXform::Make(.85f, .25f, rect.centerX(), rect.centerY()));
14 canvas->concat(matrix);
15 canvas->translate(-rect.centerX(), -rect.centerY());
16 canvas->drawRect(rect, 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 translate(SkScalar dx, SkScalar dy)
Definition: SkCanvas.cpp:1278
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
sk_sp< SkBlender > blender SkRect rect
Definition: SkRecords.h:350
static SkRSXform Make(SkScalar scos, SkScalar ssin, SkScalar tx, SkScalar ty)
Definition: SkRSXform.h:24