Represents a collection of shaped text runs. More...
#include <text_frame.h>
Public Member Functions | |
| TextFrame () | |
| TextFrame (std::vector< TextRun > &runs, Rect bounds, bool has_color) | |
| ~TextFrame () | |
| Rect | GetBounds () const |
| The conservative bounding box for this text frame. More... | |
| size_t | GetRunCount () const |
| The number of runs in this text frame. More... | |
| const std::vector< TextRun > & | GetRuns () const |
| Returns a reference to all the text runs in this frame. More... | |
| bool | HasColor () const |
| Returns the paint color this text frame was recorded with. More... | |
| GlyphAtlas::Type | GetAtlasType () const |
| The type of atlas this run should be place in. More... | |
| bool | IsFrameComplete () const |
| Verifies that all glyphs in this text frame have computed bounds information. More... | |
| const FrameBounds & | GetFrameBounds (size_t index) const |
| Retrieve the frame bounds for the glyph at [index]. More... | |
| void | SetPerFrameData (Scalar scale, Point offset, const Matrix &transform, std::optional< GlyphProperties > properties) |
| Store text frame scale, offset, and properties for hashing in th glyph atlas. More... | |
| std::pair< size_t, intptr_t > | GetAtlasGenerationAndID () const |
| Scalar | GetScale () const |
| TextFrame & | operator= (TextFrame &&other)=default |
| TextFrame (const TextFrame &other)=default | |
| const Matrix & | GetTransform () const |
| Point | GetOffset () const |
| Matrix | GetOffsetTransform () const |
Static Public Member Functions | |
| static Point | ComputeSubpixelPosition (const TextRun::GlyphPosition &glyph_position, AxisAlignment alignment, const Matrix &transform) |
| static Scalar | RoundScaledFontSize (Scalar scale) |
Friends | |
| class | TypographerContextSkia |
| class | LazyGlyphAtlas |
Represents a collection of shaped text runs.
This object is typically the entrypoint in the Impeller type
rendering subsystem.
A text frame should not be reused in multiple places within a single frame, as internally it is used as a cache for various glyph properties.
Definition at line 22 of file text_frame.h.
|
default |
Definition at line 14 of file text_frame.cc.
|
default |
|
default |
|
static |
Definition at line 69 of file text_frame.cc.
References impeller::ComputeFractionalPosition(), impeller::kAll, impeller::kNone, impeller::kX, impeller::kY, impeller::TextRun::GlyphPosition::position, transform, impeller::TPoint< T >::x, and impeller::TPoint< T >::y.
Referenced by impeller::TextContents::ComputeVertexData().
| std::pair< size_t, intptr_t > impeller::TextFrame::GetAtlasGenerationAndID | ( | ) | const |
Definition at line 135 of file text_frame.cc.
| GlyphAtlas::Type impeller::TextFrame::GetAtlasType | ( | ) | const |
The type of atlas this run should be place in.
Definition at line 31 of file text_frame.cc.
References impeller::GlyphAtlas::kAlphaBitmap, and impeller::GlyphAtlas::kColorBitmap.
| Rect impeller::TextFrame::GetBounds | ( | ) | const |
The conservative bounding box for this text frame.
Definition at line 19 of file text_frame.cc.
| const FrameBounds & impeller::TextFrame::GetFrameBounds | ( | size_t | index | ) | const |
Retrieve the frame bounds for the glyph at [index].
This method is only valid if [IsFrameComplete] returns true.
Definition at line 130 of file text_frame.cc.
| Point impeller::TextFrame::GetOffset | ( | ) | const |
Definition at line 106 of file text_frame.cc.
| Matrix impeller::TextFrame::GetOffsetTransform | ( | ) | const |
Definition at line 87 of file text_frame.cc.
References impeller::Matrix::MakeTranslation().
| size_t impeller::TextFrame::GetRunCount | ( | ) | const |
The number of runs in this text frame.
Definition at line 23 of file text_frame.cc.
| const std::vector< TextRun > & impeller::TextFrame::GetRuns | ( | ) | const |
Returns a reference to all the text runs in this frame.
Definition at line 27 of file text_frame.cc.
| Scalar impeller::TextFrame::GetScale | ( | ) | const |
Definition at line 102 of file text_frame.cc.
|
inline |
Definition at line 100 of file text_frame.h.
| bool impeller::TextFrame::HasColor | ( | ) | const |
Returns the paint color this text frame was recorded with.
Non-bitmap/COLR fonts always use a black text color here, but
COLR fonts can potentially use the paint color in the glyph
atlas, so this color must be considered as part of the cache
key.
Definition at line 36 of file text_frame.cc.
| bool impeller::TextFrame::IsFrameComplete | ( | ) | const |
Verifies that all glyphs in this text frame have computed bounds information.
Definition at line 122 of file text_frame.cc.
References x.
Definition at line 41 of file text_frame.cc.
References scale.
Referenced by impeller::FirstPassDispatcher::drawTextFrame(), and impeller::testing::TEST_P().
| void impeller::TextFrame::SetPerFrameData | ( | Scalar | scale, |
| Point | offset, | ||
| const Matrix & | transform, | ||
| std::optional< GlyphProperties > | properties | ||
| ) |
Store text frame scale, offset, and properties for hashing in th glyph atlas.
Definition at line 91 of file text_frame.cc.
|
friend |
Definition at line 108 of file text_frame.h.
|
friend |
Definition at line 107 of file text_frame.h.