2#ifndef ParagraphBuilderImpl_DEFINED
3#define ParagraphBuilderImpl_DEFINED
26#if !defined(SK_DISABLE_LEGACY_PARAGRAPH_UNICODE)
63 std::unique_ptr<Paragraph>
Build()
override;
69#if !defined(SK_DISABLE_LEGACY_CLIENT_UNICODE) && defined(SK_UNICODE_CLIENT_IMPLEMENTATION)
70 void setWordsUtf8(std::vector<SkUnicode::Position> wordsUtf8)
override;
71 void setWordsUtf16(std::vector<SkUnicode::Position> wordsUtf16)
override;
73 void setGraphemeBreaksUtf8(std::vector<SkUnicode::Position> graphemesUtf8)
override;
74 void setGraphemeBreaksUtf16(std::vector<SkUnicode::Position> graphemesUtf16)
override;
76 void setLineBreaksUtf8(std::vector<SkUnicode::LineBreakBefore> lineBreaksUtf8)
override;
77 void setLineBreaksUtf16(std::vector<SkUnicode::LineBreakBefore> lineBreaksUtf16)
override;
79 std::tuple<std::vector<SkUnicode::Position>,
80 std::vector<SkUnicode::Position>,
81 std::vector<SkUnicode::LineBreakBefore>>
82 getClientICUData()
const override {
83 return { fWordsUtf16, fGraphemeBreaksUtf8, fLineBreaksUtf8 };
91 void Reset()
override;
93 static std::unique_ptr<ParagraphBuilder>
make(
const ParagraphStyle& style,
98#if !defined(SK_DISABLE_LEGACY_PARAGRAPH_UNICODE)
100 static std::unique_ptr<ParagraphBuilder>
make(
const ParagraphStyle& style,
109 void addPlaceholder(
const PlaceholderStyle& placeholderStyle,
bool lastOne);
121 SkOnce fillUTF16MappingOnce;
122 void ensureUTF16Mapping();
125#if defined(SK_UNICODE_CLIENT_IMPLEMENTATION)
126 bool fTextIsFinalized;
127 bool fUsingClientInfo;
128 std::vector<SkUnicode::Position> fWordsUtf16;
129 std::vector<SkUnicode::Position> fGraphemeBreaksUtf8;
130 std::vector<SkUnicode::LineBreakBefore> fLineBreaksUtf8;
sk_sp< FontCollection > fFontCollection
void addPlaceholder(const PlaceholderStyle &placeholderStyle) override
~ParagraphBuilderImpl() override
skia_private::STArray< 4, Block, true > fStyledBlocks
sk_sp< SkUnicode > fUnicode
SkSpan< char > getText() override
skia_private::STArray< 4, Placeholder, true > fPlaceholders
static bool RequiresClientICU()
ParagraphStyle fParagraphStyle
ParagraphBuilderImpl(const ParagraphStyle &style, sk_sp< FontCollection > fontCollection, sk_sp< SkUnicode > unicode)
void addText(const std::u16string &text) override
const ParagraphStyle & getParagraphStyle() const override
TextStyle peekStyle() override
skia_private::STArray< 4, TextStyle, true > fTextStyles
const TextStyle & internalPeekStyle()
void pushStyle(const TextStyle &style) override
static std::unique_ptr< ParagraphBuilder > make(const ParagraphStyle &style, sk_sp< FontCollection > fontCollection, sk_sp< SkUnicode > unicode)
std::unique_ptr< Paragraph > Build() override