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

Go to the source code of this file.

Functions

 REG_FIDDLE (Matrix_mapRectScaleTranslate, 256, 256, false, 0)
 

Function Documentation

◆ REG_FIDDLE()

REG_FIDDLE ( Matrix_mapRectScaleTranslate  ,
256  ,
256  ,
false  ,
 
)

Definition at line 4 of file Matrix_mapRectScaleTranslate.cpp.

4 {
5void draw(SkCanvas* canvas) {
8 SkRect rect = {100, 50, 150, 180};
9 matrix.setScale(2, .5f, rect.centerX(), rect.centerY());
10 SkRect rotated;
11 matrix.mapRectScaleTranslate(&rotated, rect);
13 canvas->drawRect(rect, paint);
14 paint.setColor(SK_ColorRED);
15 canvas->drawRect(rotated, paint);
16}
17} // END FIDDLE
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
@ 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