| Flutter Impeller |

Public Member Functions | List of all members
impeller::interop::ParagraphBuilder Class Referencefinal

`#include <paragraph_builder.h>`

Inheritance diagram for impeller::interop::ParagraphBuilder:

## Public Member Functions
| ParagraphBuilder (const TypographyContext &context)
| ~ParagraphBuilder () override
| ParagraphBuilder (const ParagraphBuilder &)=delete
ParagraphBuilder & | operator= (const ParagraphBuilder &)=delete
bool | IsValid () const
void | PushStyle (const ParagraphStyle &style)
void | PopStyle ()
void | AddText (const uint8_t *data, size_t byte_length)
ScopedObject< Paragraph > | Build (Scalar width) const
Public Member Functions inherited from impeller::interop::ObjectBase
| ObjectBase ()=default
virtual | ~ObjectBase ()=default
| ObjectBase (const ObjectBase &)=delete
| ObjectBase (ObjectBase &&)=delete
ObjectBase & | operator= (const ObjectBase &)=delete
ObjectBase & | operator= (ObjectBase &&)=delete
void | Retain ()
void | Release ()
uint64_t | GetRefCountForTests () const

## Additional Inherited Members
Public Types inherited from impeller::interop::Object< ParagraphBuilder, IMPELLER_INTERNAL_HANDLE_NAME(ImpellerParagraphBuilder)>
using | InteropClass = ParagraphBuilder
using | InteropCSibling = IMPELLER_INTERNAL_HANDLE_NAME(ImpellerParagraphBuilder)
Static Public Member Functions inherited from impeller::interop::ObjectBase
static void | SafeRetain (void *ptr)
static void | SafeRelease (void *ptr)

## Detailed Description

Definition at line 19 of file paragraph_builder.h.

## Constructor & Destructor Documentation

## ◆ ParagraphBuilder() [1/2]

impeller::interop::ParagraphBuilder::ParagraphBuilder | ( | const TypographyContext & | context | ) |
| explicit

Definition at line 13 of file paragraph_builder.cc.

13 {
14 if (!context.IsValid()) {
15 VALIDATION_LOG << "Invalid typography context.";
16 return;
17 }
18
19 static txt::ParagraphStyle kBaseStyle;
20
21 builder_ = std::make_unique<txt::ParagraphBuilderSkia>(
22 kBaseStyle, //
23 context.GetFontCollection(), //
24 true // is impeller enabled
25 );
26 }

References impeller::interop::TypographyContext::GetFontCollection(), impeller::interop::TypographyContext::IsValid(), and VALIDATION_LOG.

## ◆ ~ParagraphBuilder()

impeller::interop::ParagraphBuilder::~ParagraphBuilder | ( |  | ) |
| overridedefault

## ◆ ParagraphBuilder() [2/2]

impeller::interop::ParagraphBuilder::ParagraphBuilder | ( | const ParagraphBuilder & |  | ) |
| delete

## Member Function Documentation

## ◆ AddText()

void impeller::interop::ParagraphBuilder::AddText | ( | const uint8_t * | data,
|  | size_t | byte_length
| ) |  |

Definition at line 42 of file paragraph_builder.cc.

42 {
43 builder_->AddText(data, byte_length);
44 }

References data.

## ◆ Build()

ScopedObject< Paragraph > impeller::interop::ParagraphBuilder::Build | ( | Scalar | width | ) | const

Definition at line 46 of file paragraph_builder.cc.

46 {
47 auto txt_paragraph = builder_->Build();
48 if (!txt_paragraph) {
49 return nullptr;
50 }
51 txt_paragraph->Layout(width);
52 return Create<Paragraph>(std::move(txt_paragraph));
53 }

## ◆ IsValid()

bool impeller::interop::ParagraphBuilder::IsValid | ( |  | ) | const

Definition at line 30 of file paragraph_builder.cc.

30 {
31 return !!builder_;
32 }

## ◆ operator=()

ParagraphBuilder& impeller::interop::ParagraphBuilder::operator= | ( | const ParagraphBuilder & |  | ) |
| delete

## ◆ PopStyle()

void impeller::interop::ParagraphBuilder::PopStyle | ( |  | ) |

Definition at line 38 of file paragraph_builder.cc.

38 {
39 builder_->Pop();
40 }

## ◆ PushStyle()

void impeller::interop::ParagraphBuilder::PushStyle | ( | const ParagraphStyle & | style | ) |

Definition at line 34 of file paragraph_builder.cc.

34 {
35 builder_->PushStyle(style.CreateTextStyle());
36 }

References impeller::interop::ParagraphStyle::CreateTextStyle().

The documentation for this class was generated from the following files:

- impeller/toolkit/interop/paragraph_builder.h
- impeller/toolkit/interop/paragraph_builder.cc

data
std::shared_ptr< const fml::Mapping > data
Definition: texture_gles.cc:63
VALIDATION_LOG
#define VALIDATION_LOG
Definition: validation.h:91