Flutter Engine
The Flutter Engine
Canvas_scale.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(Canvas_scale, 256, 160, false, 0) {
5void draw(SkCanvas* canvas) {
7 SkRect rect = { 10, 20, 60, 120 };
8 canvas->translate(20, 20);
9 canvas->drawRect(rect, paint);
10 canvas->scale(2, .5f);
11 paint.setColor(SK_ColorGRAY);
12 canvas->drawRect(rect, paint);
13}
14} // END FIDDLE
REG_FIDDLE(Canvas_scale, 256, 160, false, 0)
Definition: Canvas_scale.cpp:4
constexpr SkColor SK_ColorGRAY
Definition: SkColor.h:113
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 translate(SkScalar dx, SkScalar dy)
Definition: SkCanvas.cpp:1278
void scale(SkScalar sx, SkScalar sy)
Definition: SkCanvas.cpp:1289
const Paint & paint
Definition: color_source.cc:38
sk_sp< SkBlender > blender SkRect rect
Definition: SkRecords.h:350