Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Matrix_invert.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=0e03cd9f154603ed4b21ca56d69dae44
5REG_FIDDLE(Matrix_invert, 256, 128, false, 0) {
6void draw(SkCanvas* canvas) {
7 const SkPoint src[] = { { 10, 120}, {120, 120}, {120, 10}, { 10, 10} };
8 const SkPoint dst[] = { {150, 120}, {200, 100}, {240, 30}, { 130, 40} };
10 paint.setAntiAlias(true);
11 SkMatrix matrix;
12 matrix.setPolyToPoly(src, dst, 4);
15 paint.setColor(SK_ColorBLUE);
16 paint.setStrokeWidth(3);
17 paint.setStrokeCap(SkPaint::kRound_Cap);
19 if (matrix.invert(&matrix)) {
20 canvas->concat(matrix);
22 }
23}
24} // END FIDDLE
constexpr SkColor SK_ColorBLUE
Definition SkColor.h:135
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 concat(const SkMatrix &matrix)
@ kPolygon_PointMode
draw the array of points as a open polygon
Definition SkCanvas.h:1243
@ kPoints_PointMode
draw each point separately
Definition SkCanvas.h:1241
@ kRound_Cap
adds circle
Definition SkPaint.h:335
const Paint & paint
#define REG_FIDDLE(NAME, W, H, TEXT, I)
Definition examples.h:60