d88c2e8e09
Change-Id: I9a6b2780cfdd91cdd16d5a08eb9ba1214492cb7e Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201982 Commit-Queue: Hal Canary <halcanary@google.com> Reviewed-by: Hal Canary <halcanary@google.com>
19 lines
673 B
C++
19 lines
673 B
C++
// Copyright 2019 Google LLC.
|
|
// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
|
|
#include "fiddle/examples.h"
|
|
// HASH=1cae21e7b63b24de3eca0bbd9be1936b
|
|
REG_FIDDLE(Canvas_drawTextBlob_2, 256, 120, false, 0) {
|
|
void draw(SkCanvas* canvas) {
|
|
SkTextBlobBuilder textBlobBuilder;
|
|
SkFont font;
|
|
font.setSize(50);
|
|
const SkTextBlobBuilder::RunBuffer& run =
|
|
textBlobBuilder.allocRun(font, 1, 20, 100);
|
|
run.glyphs[0] = 20;
|
|
sk_sp<const SkTextBlob> blob = textBlobBuilder.make();
|
|
SkPaint paint;
|
|
paint.setColor(SK_ColorBLUE);
|
|
canvas->drawTextBlob(blob.get(), 0, 0, paint);
|
|
}
|
|
} // END FIDDLE
|