Florin Malita | 9867f61 | 2018-12-12 10:54:49 -0500 | [diff] [blame] | 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 | |
| 12 | SkShaper::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 | |
| 23 | sk_sp<SkTextBlob> SkTextBlobBuilderLineHandler::makeBlob() { |
| 24 | return fBuilder.make(); |
| 25 | } |