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

Go to the source code of this file.

Functions

 REG_FIDDLE (rotations, 256, 256, false, 0)
 

Function Documentation

◆ REG_FIDDLE()

REG_FIDDLE ( rotations  ,
256  ,
256  ,
false  ,
 
)

Definition at line 4 of file rotations.cpp.

4 {
5void draw(SkCanvas* canvas) {
6 canvas->translate(128, 0);
7 canvas->rotate(60);
8 SkRect rect = SkRect::MakeXYWH(0, 0, 200, 100);
9
11 paint.setAntiAlias(true);
12 paint.setColor(0xff4285F4);
13 canvas->drawRect(rect, paint);
14
15 canvas->rotate(SkIntToScalar(20));
16 paint.setColor(0xffDB4437);
17 canvas->drawRect(rect, paint);
18}
19} // END FIDDLE
#define SkIntToScalar(x)
Definition: SkScalar.h:57
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 rotate(SkScalar degrees)
Definition: SkCanvas.cpp:1300
const Paint & paint
Definition: color_source.cc:38
sk_sp< SkBlender > blender SkRect rect
Definition: SkRecords.h:350
static constexpr SkRect MakeXYWH(float x, float y, float w, float h)
Definition: SkRect.h:659