Flutter Engine
The Flutter Engine
persp_text_2.cpp
Go to the documentation of this file.
1// Copyright 2020 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(persp_text_2, 256, 256, false, 0) {
5void draw(SkCanvas* canvas) {
7 SkMatrix persp;
8 persp.setAll(0.9839f, 0, 0, 0.2246f, 0.6829f, 0, 0.0002352f, -0.0003844f, 1);
9 canvas->concat(persp);
10 canvas->translate(100, 0);
11 canvas->scale(375, 375);
12
13 const char text[] = "SKIA";
14 canvas->drawString(text, 0, 0, SkFont(nullptr, 0.1f), paint);
15}
16} // END FIDDLE
static void draw(SkCanvas *canvas, SkRect &target, int x, int y)
Definition: aaclip.cpp:27
void translate(SkScalar dx, SkScalar dy)
Definition: SkCanvas.cpp:1278
void scale(SkScalar sx, SkScalar sy)
Definition: SkCanvas.cpp:1289
void concat(const SkMatrix &matrix)
Definition: SkCanvas.cpp:1318
void drawString(const char str[], SkScalar x, SkScalar y, const SkFont &font, const SkPaint &paint)
Definition: SkCanvas.h:1803
Definition: SkFont.h:35
SkMatrix & setAll(SkScalar scaleX, SkScalar skewX, SkScalar transX, SkScalar skewY, SkScalar scaleY, SkScalar transY, SkScalar persp0, SkScalar persp1, SkScalar persp2)
Definition: SkMatrix.h:562
const Paint & paint
Definition: color_source.cc:38
std::u16string text
REG_FIDDLE(persp_text_2, 256, 256, false, 0)
Definition: persp_text_2.cpp:4