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

Go to the source code of this file.

Functions

 REG_FIDDLE (Point_subtract_operator, 256, 256, false, 0)
 

Function Documentation

◆ REG_FIDDLE()

REG_FIDDLE ( Point_subtract_operator  ,
256  ,
256  ,
false  ,
 
)

Definition at line 5 of file Point_subtract_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(30, 15);
16 points[1] += points[0] - points[2];
17 points[2] -= points[3] - points[5];
18 paint.setColor(SK_ColorRED);
20}
21} // 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