Flutter Engine
The Flutter Engine
SkShaper_factory.cpp
Go to the documentation of this file.
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 */
8
9namespace {
10class PrimitiveFactory final : public SkShapers::Factory {
11 std::unique_ptr<SkShaper> makeShaper(sk_sp<SkFontMgr>) override {
13 }
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 }
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
25 SkUnicode* getUnicode() override {
26 return nullptr;
27 }
28};
29}
30
31namespace SkShapers::Primitive {
33 return sk_make_sp<PrimitiveFactory>();
34}
35} // namespace SkShapers::Primitive
uint32_t SkFourByteTag
Definition: SkTypes.h:166
virtual std::unique_ptr< SkShaper::BiDiRunIterator > makeBidiRunIterator(const char *utf8, size_t utf8Bytes, uint8_t bidiLevel)=0
virtual std::unique_ptr< SkShaper > makeShaper(sk_sp< SkFontMgr > fallback)=0
virtual SkUnicode * getUnicode()=0
virtual std::unique_ptr< SkShaper::ScriptRunIterator > makeScriptRunIterator(const char *utf8, size_t utf8Bytes, SkFourByteTag script)=0
SKSHAPER_API sk_sp< Factory > Factory()
SKSHAPER_API std::unique_ptr< SkShaper > PrimitiveText()