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 | |
Florin Malita | 950243d | 2019-01-11 11:08:35 -0500 | [diff] [blame] | 12 | SkShaper::RunHandler::Buffer SkTextBlobBuilderRunHandler::newRunBuffer(const RunInfo&, |
| 13 | const SkFont& font, |
| 14 | int glyphCount, |
| 15 | int textCount) { |
Florin Malita | 9867f61 | 2018-12-12 10:54:49 -0500 | [diff] [blame] | 16 | const auto& runBuffer = SkTextBlobBuilderPriv::AllocRunTextPos(&fBuilder, font, glyphCount, |
| 17 | textCount, SkString()); |
| 18 | return { runBuffer.glyphs, |
Mike Reed | 22451cc | 2019-01-01 15:40:28 -0500 | [diff] [blame] | 19 | runBuffer.points(), |
Florin Malita | 9867f61 | 2018-12-12 10:54:49 -0500 | [diff] [blame] | 20 | runBuffer.utf8text, |
| 21 | runBuffer.clusters }; |
| 22 | } |
| 23 | |
Florin Malita | 950243d | 2019-01-11 11:08:35 -0500 | [diff] [blame] | 24 | sk_sp<SkTextBlob> SkTextBlobBuilderRunHandler::makeBlob() { |
Florin Malita | 9867f61 | 2018-12-12 10:54:49 -0500 | [diff] [blame] | 25 | return fBuilder.make(); |
| 26 | } |