1 /*
2 * Copyright 2024 Google LLC
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 #include "modules/skshaper/include/SkShaper_factory.h"
8
9 namespace {
10 class PrimitiveFactory final : public SkShapers::Factory {
makeShaper(sk_sp<SkFontMgr>)11 std::unique_ptr<SkShaper> makeShaper(sk_sp<SkFontMgr>) override {
12 return SkShapers::Primitive::PrimitiveText();
13 }
makeBidiRunIterator(const char *,size_t,uint8_t)14 std::unique_ptr<SkShaper::BiDiRunIterator> makeBidiRunIterator(const char*,
15 size_t,
16 uint8_t) override {
17 return std::make_unique<SkShaper::TrivialBiDiRunIterator>(0, 0);
18 }
makeScriptRunIterator(const char *,size_t,SkFourByteTag)19 std::unique_ptr<SkShaper::ScriptRunIterator> makeScriptRunIterator(const char*,
20 size_t,
21 SkFourByteTag) override {
22 return std::make_unique<SkShaper::TrivialScriptRunIterator>(0, 0);
23 }
24
getUnicode()25 SkUnicode* getUnicode() override {
26 return nullptr;
27 }
28 };
29 }
30
31 namespace SkShapers::Primitive {
Factory()32 sk_sp<SkShapers::Factory> Factory() {
33 return sk_make_sp<PrimitiveFactory>();
34 }
35 } // namespace SkShapers::Primitive
36