Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Point_Offset.cpp
Go to the documentation of this file.
1// Copyright 2019 Google LLC.
2// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
4// HASH=f0f24726df78a5d797bcf311e694a0a3
5REG_FIDDLE(Point_Offset, 256, 256, false, 0) {
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
#define REG_FIDDLE(NAME, W, H, TEXT, I)
Definition examples.h:60
static void Offset(SkPoint points[], int count, const SkVector &offset)