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

Go to the source code of this file.

Functions

 REG_FIDDLE (Point_Offset, 256, 256, false, 0)
 

Function Documentation

◆ REG_FIDDLE()

REG_FIDDLE ( Point_Offset  ,
256  ,
256  ,
false  ,
 
)

Definition at line 5 of file Point_Offset.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(30, 15);
16 SkPoint::Offset(points, std::size(points), { 1, 9 } );
18}
19} // END FIDDLE
static const int points[]
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
static void Offset(SkPoint points[], int count, const SkVector &offset)