#include <ParagraphBuilderImpl.h>
Definition at line 20 of file ParagraphBuilderImpl.h.
◆ ParagraphBuilderImpl() [1/2]
Definition at line 95 of file ParagraphBuilderImpl.cpp.
102#if defined(SK_UNICODE_CLIENT_IMPLEMENTATION)
103 , fTextIsFinalized(false)
104 , fUsingClientInfo(false)
105#endif
106{
109}
sk_sp< FontCollection > fFontCollection
sk_sp< SkUnicode > fUnicode
ParagraphStyle fParagraphStyle
◆ ParagraphBuilderImpl() [2/2]
Definition at line 75 of file ParagraphBuilderImpl.cpp.
78{ }
sk_sp< SkUnicode > get_unicode()
ParagraphBuilderImpl(const ParagraphStyle &style, sk_sp< FontCollection > fontCollection, sk_sp< SkUnicode > unicode)
◆ ~ParagraphBuilderImpl()
skia::textlayout::ParagraphBuilderImpl::~ParagraphBuilderImpl |
( |
| ) |
|
|
overridedefault |
◆ addPlaceholder() [1/2]
void skia::textlayout::ParagraphBuilderImpl::addPlaceholder |
( |
const PlaceholderStyle & |
placeholderStyle | ) |
|
|
overridevirtual |
◆ addPlaceholder() [2/2]
void skia::textlayout::ParagraphBuilderImpl::addPlaceholder |
( |
const PlaceholderStyle & |
placeholderStyle, |
|
|
bool |
lastOne |
|
) |
| |
|
protected |
Definition at line 176 of file ParagraphBuilderImpl.cpp.
176 {
177#if defined(SK_UNICODE_CLIENT_IMPLEMENTATION)
178
179
180 SkASSERT(!fTextIsFinalized || lastOne);
181#endif
183
185 }
186
193 if (!lastOne) {
194 pushStyle(topStyle.cloneForPlaceholder());
195 addText(std::u16string(1ull, 0xFFFC));
197 }
199 fPlaceholders.emplace_back(start, end, placeholderStyle, topStyle, stylesBefore, textBefore);
200}
skia_private::STArray< 4, Block, true > fStyledBlocks
skia_private::STArray< 4, Placeholder, true > fPlaceholders
void addText(const std::u16string &text) override
const TextStyle & internalPeekStyle()
void pushStyle(const TextStyle &style) override
SkRange< size_t > TextRange
SkRange< size_t > BlockRange
◆ addText() [1/3]
void skia::textlayout::ParagraphBuilderImpl::addText |
( |
const char * |
text | ) |
|
|
overridevirtual |
◆ addText() [2/3]
void skia::textlayout::ParagraphBuilderImpl::addText |
( |
const char * |
text, |
|
|
size_t |
len |
|
) |
| |
|
overridevirtual |
◆ addText() [3/3]
void skia::textlayout::ParagraphBuilderImpl::addText |
( |
const std::u16string & |
text | ) |
|
|
overridevirtual |
◆ Build()
std::unique_ptr< Paragraph > skia::textlayout::ParagraphBuilderImpl::Build |
( |
| ) |
|
|
overridevirtual |
Implements skia::textlayout::ParagraphBuilder.
Definition at line 235 of file ParagraphBuilderImpl.cpp.
235 {
237
239
240 fUTF8IndexForUTF16Index.
clear();
241 fUTF16IndexForUTF8Index.
clear();
242#if !defined(SK_DISABLE_LEGACY_PARAGRAPH_UNICODE) && defined(SK_UNICODE_CLIENT_IMPLEMENTATION)
243 if (fUsingClientInfo && !
fUnicode) {
244
246 std::move(fWordsUtf16),
247 std::move(fGraphemeBreaksUtf8),
248 std::move(fLineBreaksUtf8));
249 }
250#endif
251
253 return std::make_unique<ParagraphImpl>(
255}
#define SkASSERT_RELEASE(cond)
SkSpan< char > getText() override
SKUNICODE_API sk_sp< SkUnicode > Make(SkSpan< char > text, std::vector< SkUnicode::Position > words, std::vector< SkUnicode::Position > graphemeBreaks, std::vector< SkUnicode::LineBreakBefore > lineBreaks)
◆ endRunIfNeeded()
void skia::textlayout::ParagraphBuilderImpl::endRunIfNeeded |
( |
| ) |
|
|
protected |
◆ finalize()
void skia::textlayout::ParagraphBuilderImpl::finalize |
( |
| ) |
|
|
protected |
Definition at line 220 of file ParagraphBuilderImpl.cpp.
220 {
221#if defined(SK_UNICODE_CLIENT_IMPLEMENTATION)
222 if (fTextIsFinalized) {
223 return;
224 }
225#endif
228 }
229
230#if defined(SK_UNICODE_CLIENT_IMPLEMENTATION)
231 fTextIsFinalized = true;
232#endif
233}
◆ getParagraphStyle()
const ParagraphStyle & skia::textlayout::ParagraphBuilderImpl::getParagraphStyle |
( |
| ) |
const |
|
overridevirtual |
◆ getText()
SkSpan< char > skia::textlayout::ParagraphBuilderImpl::getText |
( |
| ) |
|
|
overridevirtual |
◆ internalPeekStyle()
const TextStyle & skia::textlayout::ParagraphBuilderImpl::internalPeekStyle |
( |
| ) |
|
|
protected |
Definition at line 135 of file ParagraphBuilderImpl.cpp.
135 {
138 } else {
140 }
141}
skia_private::STArray< 4, TextStyle, true > fTextStyles
const TextStyle & getTextStyle() const
◆ make() [1/2]
◆ make() [2/2]
Definition at line 88 of file ParagraphBuilderImpl.cpp.
90 {
91 return std::make_unique<ParagraphBuilderImpl>(style, std::move(fontCollection),
93}
◆ peekStyle()
TextStyle skia::textlayout::ParagraphBuilderImpl::peekStyle |
( |
| ) |
|
|
overridevirtual |
◆ pop()
void skia::textlayout::ParagraphBuilderImpl::pop |
( |
| ) |
|
|
overridevirtual |
◆ pushStyle()
void skia::textlayout::ParagraphBuilderImpl::pushStyle |
( |
const TextStyle & |
style | ) |
|
|
overridevirtual |
◆ RequiresClientICU()
bool skia::textlayout::ParagraphBuilderImpl::RequiresClientICU |
( |
| ) |
|
|
static |
Definition at line 337 of file ParagraphBuilderImpl.cpp.
337 {
338#if defined(SK_UNICODE_CLIENT_IMPLEMENTATION)
339 return true;
340#else
341 return false;
342#endif
343}
◆ Reset()
void skia::textlayout::ParagraphBuilderImpl::Reset |
( |
| ) |
|
|
overridevirtual |
Implements skia::textlayout::ParagraphBuilder.
Definition at line 320 of file ParagraphBuilderImpl.cpp.
320 {
321
326 fUTF8IndexForUTF16Index.
clear();
327 fUTF16IndexForUTF8Index.
clear();
328#if defined(SK_UNICODE_CLIENT_IMPLEMENTATION)
329 fWordsUtf16.clear();
330 fGraphemeBreaksUtf8.clear();
331 fLineBreaksUtf8.clear();
332 fTextIsFinalized = false;
333#endif
335}
◆ startStyledBlock()
void skia::textlayout::ParagraphBuilderImpl::startStyledBlock |
( |
| ) |
|
|
protected |
◆ fFontCollection
◆ fParagraphStyle
ParagraphStyle skia::textlayout::ParagraphBuilderImpl::fParagraphStyle |
|
protected |
◆ fPlaceholders
◆ fStyledBlocks
◆ fTextStyles
◆ fUnicode
◆ fUtf8
SkString skia::textlayout::ParagraphBuilderImpl::fUtf8 |
|
protected |
The documentation for this class was generated from the following files: