| Flutter Impeller |

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

`#include <paragraph.h>`

Inheritance diagram for impeller::interop::Paragraph:

## Public Member Functions
| Paragraph (std::unique_ptr< txt::Paragraph > paragraph)
| ~Paragraph () override
| Paragraph (const Paragraph &)=delete
Paragraph & | operator= (const Paragraph &)=delete
Scalar | GetMaxWidth () const
Scalar | GetHeight () const
Scalar | GetLongestLineWidth () const
Scalar | GetMinIntrinsicWidth () const
Scalar | GetMaxIntrinsicWidth () const
Scalar | GetIdeographicBaseline () const
Scalar | GetAlphabeticBaseline () const
uint32_t | GetLineCount () const
const std::unique_ptr< txt::Paragraph > & | GetHandle () const
ScopedObject< LineMetrics > | GetLineMetrics () const
ScopedObject< GlyphInfo > | GetGlyphInfoAtCodeUnitIndex (size_t code_unit_index) const
ScopedObject< GlyphInfo > | GetClosestGlyphInfoAtParagraphCoordinates (double x, double y) const
ImpellerRange | GetWordBoundary (size_t code_unit_index) 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< Paragraph, IMPELLER_INTERNAL_HANDLE_NAME(ImpellerParagraph)>
using | InteropClass = Paragraph
using | InteropCSibling = IMPELLER_INTERNAL_HANDLE_NAME(ImpellerParagraph)
Static Public Member Functions inherited from impeller::interop::ObjectBase
static void | SafeRetain (void *ptr)
static void | SafeRelease (void *ptr)

## Detailed Description

An immutable fully laid out paragraph.

Definition at line 19 of file paragraph.h.

## Constructor & Destructor Documentation

## ◆ Paragraph() [1/2]

impeller::interop::Paragraph::Paragraph | ( | std::unique_ptr< txt::Paragraph > | paragraph | ) |
| explicit

Definition at line 9 of file paragraph.cc.

10 : paragraph_(std::move(paragraph)) {}

## ◆ ~Paragraph()

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

## ◆ Paragraph() [2/2]

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

## Member Function Documentation

## ◆ GetAlphabeticBaseline()

Scalar impeller::interop::Paragraph::GetAlphabeticBaseline | ( |  | ) | const

Definition at line 38 of file paragraph.cc.

38 {
39 return paragraph_->GetAlphabeticBaseline();
40 }

## ◆ GetClosestGlyphInfoAtParagraphCoordinates()

ScopedObject< GlyphInfo > impeller::interop::Paragraph::GetClosestGlyphInfoAtParagraphCoordinates | ( | double | x,
|  | double | y
| ) |  | const

Definition at line 70 of file paragraph.cc.

72 {
73 skia::textlayout::Paragraph::GlyphInfo info = {};
74 if (paragraph_->GetClosestGlyphInfoAtCoordinate(x, y, &info)) {
75 return Create<GlyphInfo>(info);
76 }
77 return nullptr;
78 }
x
int32_t x
Definition: dl_golden_unittests.cc:458

References x.

## ◆ GetGlyphInfoAtCodeUnitIndex()

ScopedObject< GlyphInfo > impeller::interop::Paragraph::GetGlyphInfoAtCodeUnitIndex | ( | size_t | code_unit_index | ) | const

Definition at line 61 of file paragraph.cc.

62 {
63 skia::textlayout::Paragraph::GlyphInfo info = {};
64 if (paragraph_->GetGlyphInfoAt(code_unit_index, &info)) {
65 return Create<GlyphInfo>(info);
66 }
67 return nullptr;
68 }

## ◆ GetHandle()

const std::unique_ptr< txt::Paragraph > & impeller::interop::Paragraph::GetHandle | ( |  | ) | const

Definition at line 46 of file paragraph.cc.

46 {
47 return paragraph_;
48 }

Referenced by impeller::interop::DisplayListBuilder::DrawParagraph().

## ◆ GetHeight()

Scalar impeller::interop::Paragraph::GetHeight | ( |  | ) | const

Definition at line 18 of file paragraph.cc.

18 {
19 return paragraph_->GetHeight();
20 }

## ◆ GetIdeographicBaseline()

Scalar impeller::interop::Paragraph::GetIdeographicBaseline | ( |  | ) | const

Definition at line 34 of file paragraph.cc.

34 {
35 return paragraph_->GetIdeographicBaseline();
36 }

## ◆ GetLineCount()

uint32_t impeller::interop::Paragraph::GetLineCount | ( |  | ) | const

Definition at line 42 of file paragraph.cc.

42 {
43 return paragraph_->GetNumberOfLines();
44 }

## ◆ GetLineMetrics()

ScopedObject< LineMetrics > impeller::interop::Paragraph::GetLineMetrics | ( |  | ) | const

Definition at line 50 of file paragraph.cc.

50 {
51 // Line metrics are expensive to calculate and the recommendation is that
52 // the metric after each layout must be cached. But interop::Paragraphs are
53 // immutable. So do the caching on behalf of the caller.
54 if (lazy_line_metrics_) {
55 return lazy_line_metrics_;
56 }
57 lazy_line_metrics_ = Create<LineMetrics>(paragraph_->GetLineMetrics());
58 return lazy_line_metrics_;
59 }

## ◆ GetLongestLineWidth()

Scalar impeller::interop::Paragraph::GetLongestLineWidth | ( |  | ) | const

Definition at line 22 of file paragraph.cc.

22 {
23 return paragraph_->GetLongestLine();
24 }

## ◆ GetMaxIntrinsicWidth()

Scalar impeller::interop::Paragraph::GetMaxIntrinsicWidth | ( |  | ) | const

Definition at line 30 of file paragraph.cc.

30 {
31 return paragraph_->GetMaxIntrinsicWidth();
32 }

## ◆ GetMaxWidth()

Scalar impeller::interop::Paragraph::GetMaxWidth | ( |  | ) | const

Definition at line 14 of file paragraph.cc.

14 {
15 return paragraph_->GetMaxWidth();
16 }

## ◆ GetMinIntrinsicWidth()

Scalar impeller::interop::Paragraph::GetMinIntrinsicWidth | ( |  | ) | const

Definition at line 26 of file paragraph.cc.

26 {
27 return paragraph_->GetMinIntrinsicWidth();
28 }

## ◆ GetWordBoundary()

ImpellerRange impeller::interop::Paragraph::GetWordBoundary | ( | size_t | code_unit_index | ) | const

Definition at line 80 of file paragraph.cc.

80 {
81 const auto range = paragraph_->GetWordBoundary(code_unit_index);
82 return ImpellerRange{range.start, range.end};
83 }
ImpellerRange
Definition: impeller.h:524
ImpellerRange::start
uint64_t start
Definition: impeller.h:525

References ImpellerRange::start.

## ◆ operator=()

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

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

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