blob: 35dafed4f3279af268979c2df3b04ba5ea99221c [file] [log] [blame]
Florin Malita9867f612018-12-12 10:54:49 -05001/*
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
12SkShaper::LineHandler::Buffer SkTextBlobBuilderLineHandler::newLineBuffer(const SkFont& font,
13 int glyphCount,
14 int textCount) {
15 const auto& runBuffer = SkTextBlobBuilderPriv::AllocRunTextPos(&fBuilder, font, glyphCount,
16 textCount, SkString());
17 return { runBuffer.glyphs,
18 reinterpret_cast<SkPoint*>(runBuffer.pos),
19 runBuffer.utf8text,
20 runBuffer.clusters };
21}
22
23sk_sp<SkTextBlob> SkTextBlobBuilderLineHandler::makeBlob() {
24 return fBuilder.make();
25}