Flutter Impeller
impeller::GlyphAtlasContext Class Reference

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

#include <glyph_atlas.h>

Inheritance diagram for impeller::GlyphAtlasContext:
impeller::GlyphAtlasContextSTB

Public Member Functions

 GlyphAtlasContext (GlyphAtlas::Type type)
 
virtual ~GlyphAtlasContext ()
 
std::shared_ptr< GlyphAtlasGetGlyphAtlas () const
 Retrieve the current glyph atlas. More...
 
const ISizeGetAtlasSize () const
 Retrieve the size of the current glyph atlas. More...
 
std::shared_ptr< RectanglePackerGetRectPacker () 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 153 of file glyph_atlas.h.

Constructor & Destructor Documentation

◆ GlyphAtlasContext()

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

Definition at line 12 of file glyph_atlas.cc.

13  : atlas_(std::make_shared<GlyphAtlas>(type)), atlas_size_(ISize(0, 0)) {}

◆ ~GlyphAtlasContext()

impeller::GlyphAtlasContext::~GlyphAtlasContext ( )
virtual

Definition at line 15 of file glyph_atlas.cc.

15 {}

Member Function Documentation

◆ GetAtlasSize()

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

Retrieve the size of the current glyph atlas.

Definition at line 21 of file glyph_atlas.cc.

21  {
22  return atlas_size_;
23 }

◆ GetGlyphAtlas()

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

Retrieve the current glyph atlas.

Definition at line 17 of file glyph_atlas.cc.

17  {
18  return atlas_;
19 }

◆ 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 25 of file glyph_atlas.cc.

25  {
26  return height_adjustment_;
27 }

◆ GetRectPacker()

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

Retrieve the previous (if any) rect packer.

Definition at line 29 of file glyph_atlas.cc.

29  {
30  return rect_packer_;
31 }

◆ 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 33 of file glyph_atlas.cc.

35  {
36  atlas_ = std::move(atlas);
37  atlas_size_ = size;
38  height_adjustment_ = height_adjustment;
39 }

◆ UpdateRectPacker()

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

Definition at line 41 of file glyph_atlas.cc.

42  {
43  rect_packer_ = std::move(rect_packer);
44 }

The documentation for this class was generated from the following files:
impeller::ISize
ISize64 ISize
Definition: size.h:140
type
GLenum type
Definition: blit_command_gles.cc:127