Debian Codegraph @

docs/examples/Matrix_mapPoints_2.cpp

raw
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.
3 #include "tools/fiddle/examples.h"
4 REG_FIDDLE(Matrix_mapPoints_2, 256, 256, false, 0) {
5 void draw(SkCanvas* canvas) {
6 SkMatrix matrix;
7 matrix.setRotate(35, 128, 128);
8 SkPoint pts[4];
9 matrix.mapRectToQuad(pts, {40, 70, 180, 220} );
10 SkPaint paint;
11 paint.setARGB(77, 23, 99, 154);
12 for (int i = 0; i < 5; ++i) {
13 canvas->drawPoints(SkCanvas::kPolygon_PointMode, pts, paint);
14 matrix.mapPoints(pts);
15 }
16 }
17 } // END FIDDLE