Flutter Engine
The Flutter Engine
Matrix_mapRectScaleTranslate.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_mapRectScaleTranslate, 256, 256, false, 0) {
5void draw(SkCanvas* canvas) {
8 SkRect rect = {100, 50, 150, 180};
9 matrix.setScale(2, .5f, rect.centerX(), rect.centerY());
10 SkRect rotated;
11 matrix.mapRectScaleTranslate(&rotated, rect);
13 canvas->drawRect(rect, paint);
14 paint.setColor(SK_ColorRED);
15 canvas->drawRect(rotated, paint);
16}
17} // END FIDDLE
REG_FIDDLE(Matrix_mapRectScaleTranslate, 256, 256, false, 0)
constexpr SkColor SK_ColorRED
Definition: SkColor.h:126
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
@ 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