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

Go to the source code of this file.

Functions

 REG_FIDDLE (Canvas_scale, 256, 160, false, 0)
 

Function Documentation

◆ REG_FIDDLE()

REG_FIDDLE ( Canvas_scale  ,
256  ,
160  ,
false  ,
 
)

Definition at line 4 of file Canvas_scale.cpp.

4 {
5void draw(SkCanvas* canvas) {
7 SkRect rect = { 10, 20, 60, 120 };
8 canvas->translate(20, 20);
9 canvas->drawRect(rect, paint);
10 canvas->scale(2, .5f);
11 paint.setColor(SK_ColorGRAY);
12 canvas->drawRect(rect, paint);
13}
14} // END FIDDLE
constexpr SkColor SK_ColorGRAY
Definition: SkColor.h:113
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 scale(SkScalar sx, SkScalar sy)
Definition: SkCanvas.cpp:1289
const Paint & paint
Definition: color_source.cc:38
sk_sp< SkBlender > blender SkRect rect
Definition: SkRecords.h:350