ParagraphBuilder implementation using Skia's text layout module.
More...
#include <paragraph_builder_skia.h>
|
| | ParagraphBuilderSkia (const ParagraphStyle &style, const std::shared_ptr< FontCollection > &font_collection, const bool impeller_enabled) |
| |
| virtual | ~ParagraphBuilderSkia () |
| |
| virtual void | PushStyle (const TextStyle &style) override |
| |
| virtual void | Pop () override |
| |
| virtual const TextStyle & | PeekStyle () override |
| |
| virtual void | AddText (const std::u16string &text) override |
| |
| virtual void | AddText (const uint8_t *utf8_data, size_t byte_length) override |
| |
| virtual void | AddPlaceholder (PlaceholderRun &span) override |
| |
| virtual std::unique_ptr< Paragraph > | Build () override |
| |
| | ~ParagraphBuilder () override |
| |
| void | pushStyle (const tonic::Int32List &encoded, const std::vector< std::string > &fontFamilies, double fontSize, double letterSpacing, double wordSpacing, double height, double decorationThickness, const std::string &locale, Dart_Handle background_objects, Dart_Handle background_data, Dart_Handle foreground_objects, Dart_Handle foreground_data, Dart_Handle shadows_data, Dart_Handle font_features_data, Dart_Handle font_variations_data) |
| |
| void | pop () |
| |
| Dart_Handle | addText (const std::u16string &text) |
| |
| void | addPlaceholder (double width, double height, unsigned alignment, double baseline_offset, unsigned baseline) |
| |
| void | build (Dart_Handle paragraph_handle) |
| |
| virtual void | RetainDartWrappableReference () const override |
| |
| virtual void | ReleaseDartWrappableReference () const override |
| |
| void | Release () const |
| |
| void | AddRef () const |
| |
| bool | HasOneRef () const |
| |
| void | AssertHasOneRef () const |
| |
| | DartWrappable () |
| |
| virtual const DartWrapperInfo & | GetDartWrapperInfo () const =0 |
| |
| Dart_Handle | CreateDartWrapper (DartState *dart_state) |
| |
| void | AssociateWithDartWrapper (Dart_Handle wrappable) |
| |
| void | ClearDartWrapper () |
| |
| Dart_WeakPersistentHandle | dart_wrapper () const |
| |
|
| enum | DartNativeFields {
kPeerIndex
,
kNumberOfNativeFields
} |
| |
| static void | Create (Dart_Handle wrapper, Dart_Handle encoded_handle, Dart_Handle strutData, const std::string &fontFamily, const std::vector< std::string > &strutFontFamilies, double fontSize, double height, const std::u16string &ellipsis, const std::string &locale) |
| |
| | RefCountedThreadSafe () |
| |
| | ~RefCountedThreadSafe () |
| |
| | RefCountedThreadSafeBase () |
| |
| | ~RefCountedThreadSafeBase () |
| |
| bool | Release () const |
| |
| void | Adopt () |
| |
| virtual | ~DartWrappable () |
| |
| static Dart_PersistentHandle | GetTypeForWrapper (tonic::DartState *dart_state, const tonic::DartWrapperInfo &wrapper_info) |
| |
ParagraphBuilder implementation using Skia's text layout module.
- Note
- Despite the suffix "Skia", this class is not specific to Skia and is also used with the Impeller backend.
Definition at line 20 of file paragraph_builder_skia.h.
◆ ParagraphBuilderSkia()
| txt::ParagraphBuilderSkia::ParagraphBuilderSkia |
( |
const ParagraphStyle & |
style, |
|
|
const std::shared_ptr< FontCollection > & |
font_collection, |
|
|
const bool |
impeller_enabled |
|
) |
| |
Definition at line 35 of file paragraph_builder_skia.cc.
39 : base_style_(style.GetTextStyle()), impeller_enabled_(impeller_enabled) {
40 builder_ = skt::ParagraphBuilder::make(
41 TxtToSkia(style), font_collection->CreateSktFontCollection(),
42 SkUnicodes::ICU::Make());
43}
◆ ~ParagraphBuilderSkia()
| txt::ParagraphBuilderSkia::~ParagraphBuilderSkia |
( |
| ) |
|
|
virtualdefault |
◆ AddPlaceholder()
| void txt::ParagraphBuilderSkia::AddPlaceholder |
( |
PlaceholderRun & |
span | ) |
|
|
overridevirtual |
◆ AddText() [1/2]
| void txt::ParagraphBuilderSkia::AddText |
( |
const std::u16string & |
text | ) |
|
|
overridevirtual |
◆ AddText() [2/2]
| void txt::ParagraphBuilderSkia::AddText |
( |
const uint8_t * |
utf8_data, |
|
|
size_t |
byte_length |
|
) |
| |
|
overridevirtual |
Definition at line 65 of file paragraph_builder_skia.cc.
66 {
67 builder_->addText(reinterpret_cast<const char*>(utf8_data), byte_length);
68}
◆ Build()
| std::unique_ptr< Paragraph > txt::ParagraphBuilderSkia::Build |
( |
| ) |
|
|
overridevirtual |
Definition at line 82 of file paragraph_builder_skia.cc.
82 {
83 return std::make_unique<ParagraphSkia>(
84 builder_->Build(), std::move(dl_paints_), impeller_enabled_);
85}
◆ PeekStyle()
| const TextStyle & txt::ParagraphBuilderSkia::PeekStyle |
( |
| ) |
|
|
overridevirtual |
Definition at line 57 of file paragraph_builder_skia.cc.
57 {
58 return txt_style_stack_.empty() ? base_style_ : txt_style_stack_.top();
59}
◆ Pop()
| void txt::ParagraphBuilderSkia::Pop |
( |
| ) |
|
|
overridevirtual |
◆ PushStyle()
| void txt::ParagraphBuilderSkia::PushStyle |
( |
const TextStyle & |
style | ) |
|
|
overridevirtual |
Definition at line 47 of file paragraph_builder_skia.cc.
47 {
48 builder_->pushStyle(TxtToSkia(style));
49 txt_style_stack_.push(style);
50}
◆ SkiaParagraphBuilderTests_ParagraphStrutStyle_Test
| friend class SkiaParagraphBuilderTests_ParagraphStrutStyle_Test |
|
friend |
The documentation for this class was generated from the following files: