| Flutter Impeller |

Public Member Functions | List of all members
impeller::GlyphAtlasContext Class Reference

A container for caching a glyph atlas across frames. More...

`#include <glyph_atlas.h>`

## Public Member Functions
| GlyphAtlasContext (GlyphAtlas::Type type)
virtual | ~GlyphAtlasContext ()
std::shared_ptr< GlyphAtlas > | GetGlyphAtlas () const
| Retrieve the current glyph atlas. More...
const ISize & | GetAtlasSize () const
| Retrieve the size of the current glyph atlas. More...
std::shared_ptr< RectanglePacker > | GetRectPacker () const
| Retrieve the previous (if any) rect packer. More...
int64_t | GetHeightAdjustment () const
| A y-coordinate shift that must be applied to glyphs appended to the atlas. More...
void | UpdateGlyphAtlas (std::shared_ptr< GlyphAtlas > atlas, ISize size, int64_t height_adjustment_)
| Update the context with a newly constructed glyph atlas. More...
void | UpdateRectPacker (std::shared_ptr< RectanglePacker > rect_packer)

## Detailed Description

A container for caching a glyph atlas across frames.

Definition at line 218 of file glyph_atlas.h.

## Constructor & Destructor Documentation

## ◆ GlyphAtlasContext()

impeller::GlyphAtlasContext::GlyphAtlasContext | ( | GlyphAtlas::Type | type | ) |
| explicit

Definition at line 14 of file glyph_atlas.cc.

15 : atlas_(std::make_shared<GlyphAtlas>(type, /*initial_generation=*/0)),
16 atlas_size_(ISize(0, 0)) {}
type
GLenum type
Definition: blit_command_gles.cc:151
impeller::ISize
ISize64 ISize
Definition: size.h:174

## ◆ ~GlyphAtlasContext()

impeller::GlyphAtlasContext::~GlyphAtlasContext | ( |  | ) |
| virtual

Definition at line 18 of file glyph_atlas.cc.

18 {}

## Member Function Documentation

## ◆ GetAtlasSize()

const ISize & impeller::GlyphAtlasContext::GetAtlasSize | ( |  | ) | const

Retrieve the size of the current glyph atlas.

Definition at line 24 of file glyph_atlas.cc.

24 {
25 return atlas_size_;
26 }

## ◆ GetGlyphAtlas()

std::shared_ptr< GlyphAtlas > impeller::GlyphAtlasContext::GetGlyphAtlas | ( |  | ) | const

Retrieve the current glyph atlas.

Definition at line 20 of file glyph_atlas.cc.

20 {
21 return atlas_;
22 }

## ◆ GetHeightAdjustment()

int64_t impeller::GlyphAtlasContext::GetHeightAdjustment | ( |  | ) | const

A y-coordinate shift that must be applied to glyphs appended to the atlas.

The rectangle packer is only initialized for unfilled regions of the atlas. The area the rectangle packer covers is offset from the origin by this height adjustment.

Definition at line 28 of file glyph_atlas.cc.

28 {
29 return height_adjustment_;
30 }

## ◆ GetRectPacker()

std::shared_ptr< RectanglePacker > impeller::GlyphAtlasContext::GetRectPacker | ( |  | ) | const

Retrieve the previous (if any) rect packer.

Definition at line 32 of file glyph_atlas.cc.

32 {
33 return rect_packer_;
34 }

## ◆ UpdateGlyphAtlas()

void impeller::GlyphAtlasContext::UpdateGlyphAtlas | ( | std::shared_ptr< GlyphAtlas > | atlas,
|  | ISize | size,
|  | int64_t | height_adjustment_
| ) |  |

Update the context with a newly constructed glyph atlas.

Definition at line 36 of file glyph_atlas.cc.

38 {
39 atlas_ = std::move(atlas);
40 atlas_size_ = size;
41 height_adjustment_ = height_adjustment;
42 }

## ◆ UpdateRectPacker()

void impeller::GlyphAtlasContext::UpdateRectPacker | ( | std::shared_ptr< RectanglePacker > | rect_packer | ) |

Definition at line 44 of file glyph_atlas.cc.

45 {
46 rect_packer_ = std::move(rect_packer);
47 }

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

- impeller/typographer/glyph_atlas.h
- impeller/typographer/glyph_atlas.cc