Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Canvas_drawTextBlob_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.
4// HASH=1cae21e7b63b24de3eca0bbd9be1936b
5REG_FIDDLE(Canvas_drawTextBlob_2, 256, 120, false, 0) {
6void draw(SkCanvas* canvas) {
7 SkTextBlobBuilder textBlobBuilder;
8 SkFont font = SkFont(fontMgr->matchFamilyStyle(nullptr, {}), 50);
10 textBlobBuilder.allocRun(font, 1, 20, 100);
11 run.glyphs[0] = 20;
12 sk_sp<const SkTextBlob> blob = textBlobBuilder.make();
14 paint.setColor(SK_ColorBLUE);
15 canvas->drawTextBlob(blob.get(), 0, 0, paint);
16}
17} // END FIDDLE
constexpr SkColor SK_ColorBLUE
Definition SkColor.h:135
static void draw(SkCanvas *canvas, SkRect &target, int x, int y)
Definition aaclip.cpp:27
void drawTextBlob(const SkTextBlob *blob, SkScalar x, SkScalar y, const SkPaint &paint)
sk_sp< SkTypeface > matchFamilyStyle(const char familyName[], const SkFontStyle &) const
const RunBuffer & allocRun(const SkFont &font, int count, SkScalar x, SkScalar y, const SkRect *bounds=nullptr)
sk_sp< SkTextBlob > make()
T * get() const
Definition SkRefCnt.h:303
const Paint & paint
sk_sp< SkFontMgr > fontMgr
Definition examples.cpp:32
#define REG_FIDDLE(NAME, W, H, TEXT, I)
Definition examples.h:60
Definition run.py:1