Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Functions
Point_multiply_operator.cpp File Reference
#include "tools/fiddle/examples.h"

Go to the source code of this file.

Functions

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

Function Documentation

◆ REG_FIDDLE()

REG_FIDDLE ( Point_multiply_operator  ,
256  ,
128  ,
false  ,
 
)

Definition at line 5 of file Point_multiply_operator.cpp.

5 {
6void draw(SkCanvas* canvas) {
8 paint.setAntiAlias(true);
9 SkPoint points[] = { { 3, 1 }, { 4, 2 }, { 5, 1 }, { 7, 3 },
10 { 6, 4 }, { 7, 5 }, { 5, 7 },
11 { 4, 6 }, { 3, 7 }, { 1, 5 },
12 { 2, 4 }, { 1, 3 }, { 3, 1 } };
13 canvas->scale(15, 10);
16 for (auto& point : points) {
17 point = point * 1.5f;
18 }
19 paint.setColor(SK_ColorRED);
21}
22} // END FIDDLE
static const int points[]
constexpr SkColor SK_ColorRED
Definition SkColor.h:126
static void draw(SkCanvas *canvas, SkRect &target, int x, int y)
Definition aaclip.cpp:27
void drawPoints(PointMode mode, size_t count, const SkPoint pts[], const SkPaint &paint)
void scale(SkScalar sx, SkScalar sy)
@ kPolygon_PointMode
draw the array of points as a open polygon
Definition SkCanvas.h:1243
@ kStroke_Style
set to stroke geometry
Definition SkPaint.h:194
const Paint & paint