Flutter Engine
The Flutter Engine
Matrix_mapRect_3.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.
4REG_FIDDLE(Matrix_mapRect_3, 256, 256, false, 0) {
5void draw(SkCanvas* canvas) {
6 SkRect rect{110, 50, 180, 100};
8 matrix.setRotate(50, 28, 28);
9 SkRect mapped = matrix.mapRect(rect);
11 paint.setAntiAlias(true);
13 canvas->drawRect(rect, paint);
14 canvas->drawRect(mapped, paint);
15 canvas->concat(matrix);
16 canvas->drawRect(rect, paint);
17}
18} // END FIDDLE
REG_FIDDLE(Matrix_mapRect_3, 256, 256, false, 0)
static void draw(SkCanvas *canvas, SkRect &target, int x, int y)
Definition: aaclip.cpp:27
void drawRect(const SkRect &rect, const SkPaint &paint)
Definition: SkCanvas.cpp:1673
void concat(const SkMatrix &matrix)
Definition: SkCanvas.cpp:1318
@ kStroke_Style
set to stroke geometry
Definition: SkPaint.h:194
const Paint & paint
Definition: color_source.cc:38
unsigned useCenter Optional< SkMatrix > matrix
Definition: SkRecords.h:258
sk_sp< SkBlender > blender SkRect rect
Definition: SkRecords.h:350