1 /*
2 * Copyright 2018 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8 #include "SkShaper.h"
9
10 #include "SkTextBlobPriv.h"
11
newRunBuffer(const RunInfo &,const SkFont & font,int glyphCount,int textCount)12 SkShaper::RunHandler::Buffer SkTextBlobBuilderRunHandler::newRunBuffer(const RunInfo&,
13 const SkFont& font,
14 int glyphCount,
15 int textCount) {
16 const auto& runBuffer = SkTextBlobBuilderPriv::AllocRunTextPos(&fBuilder, font, glyphCount,
17 textCount, SkString());
18 return { runBuffer.glyphs,
19 runBuffer.points(),
20 runBuffer.utf8text,
21 runBuffer.clusters };
22 }
23
makeBlob()24 sk_sp<SkTextBlob> SkTextBlobBuilderRunHandler::makeBlob() {
25 return fBuilder.make();
26 }
27