2019-03-15 18:22:51 +00:00
|
|
|
// 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
|
2019-03-18 20:06:34 +00:00
|
|
|
REG_FIDDLE(Canvas_drawTextBlob_2, 256, 120, false, 0) {
|
2019-03-15 18:22:51 +00:00
|
|
|
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
|