Flutter Engine
The Flutter Engine
Canvas_rotate_2.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_rotate_2, 256, 192, false, 0) {
5void draw(SkCanvas* canvas) {
7 SkFont font(fontMgr->matchFamilyStyle(nullptr, {}), 96);
8 canvas->drawString("A1", 130, 100, font, paint);
9 canvas->rotate(180, 130, 100);
10 canvas->drawString("A1", 130, 100, font, paint);
11}
12} // END FIDDLE
REG_FIDDLE(Canvas_rotate_2, 256, 192, false, 0)
static void draw(SkCanvas *canvas, SkRect &target, int x, int y)
Definition: aaclip.cpp:27
void rotate(SkScalar degrees)
Definition: SkCanvas.cpp:1300
void drawString(const char str[], SkScalar x, SkScalar y, const SkFont &font, const SkPaint &paint)
Definition: SkCanvas.h:1803
sk_sp< SkTypeface > matchFamilyStyle(const char familyName[], const SkFontStyle &) const
Definition: SkFontMgr.cpp:109
Definition: SkFont.h:35
const Paint & paint
Definition: color_source.cc:38
sk_sp< SkFontMgr > fontMgr
Definition: examples.cpp:32
font
Font Metadata and Metrics.