FastUIDraw
Public Member Functions | List of all members
fastuidraw::GlyphAtlas Class Reference

A GlyphAtlas is a common location to place glyph data of an application. Ideally, all glyph data is placed into a single GlyphAtlas. Methods of GlyphAtlas are thread safe, protected behind atomics and a mutex within the GlyphAtlas. More...

#include <glyph_atlas.hpp>

Inheritance diagram for fastuidraw::GlyphAtlas:
Inheritance graph
[legend]

Public Member Functions

 GlyphAtlas (reference_counted_ptr< GlyphAtlasBackingStoreBase > pstore)
 
int allocate_data (c_array< const uint32_t > pdata)
 
void clear (void)
 
unsigned int data_allocated (void)
 
void deallocate_data (int location, int count)
 
void flush (void) const
 
void lock_resources (void)
 
unsigned int number_times_cleared (void) const
 
const reference_counted_ptr< const GlyphAtlasBackingStoreBase > & store (void) const
 
void unlock_resources (void)
 
- Public Member Functions inherited from fastuidraw::reference_counted_base< T, Counter >
 reference_counted_base (void)
 

Additional Inherited Members

- Static Public Member Functions inherited from fastuidraw::reference_counted_base< T, Counter >
static void add_reference (const reference_counted_base< T, Counter > *p)
 
static void remove_reference (const reference_counted_base< T, Counter > *p)
 

Detailed Description

A GlyphAtlas is a common location to place glyph data of an application. Ideally, all glyph data is placed into a single GlyphAtlas. Methods of GlyphAtlas are thread safe, protected behind atomics and a mutex within the GlyphAtlas.

Definition at line 111 of file glyph_atlas.hpp.

Constructor & Destructor Documentation

◆ GlyphAtlas()

fastuidraw::GlyphAtlas::GlyphAtlas ( reference_counted_ptr< GlyphAtlasBackingStoreBase pstore)
explicit

Ctor.

Parameters
pstoreGlyphAtlasBackingStoreBase to which to store data

Member Function Documentation

◆ allocate_data()

int fastuidraw::GlyphAtlas::allocate_data ( c_array< const uint32_t >  pdata)

Negative return value indicates failure.

◆ clear()

void fastuidraw::GlyphAtlas::clear ( void  )

Frees all allocated regions of this GlyphAtlas;

◆ data_allocated()

unsigned int fastuidraw::GlyphAtlas::data_allocated ( void  )

Returns how much data has been allocated

◆ deallocate_data()

void fastuidraw::GlyphAtlas::deallocate_data ( int  location,
int  count 
)

Deallocate data

◆ flush()

void fastuidraw::GlyphAtlas::flush ( void  ) const

Calls GlyphAtlasBackingStoreBase::flush() on the backing store (see store()).

◆ lock_resources()

void fastuidraw::GlyphAtlas::lock_resources ( void  )

Increments an internal counter. If this internal counter is greater than zero, then clear() and deallocate_data() are -delayed- until the counter reaches zero again (see unlock_resources()). The use case is for buffered painting where the GPU calls are delayed for later (to batch commands) and a clear() or deallocate_data() was issued during painting.

◆ number_times_cleared()

unsigned int fastuidraw::GlyphAtlas::number_times_cleared ( void  ) const

Returns the number of times that clear() has been called.

◆ store()

const reference_counted_ptr<const GlyphAtlasBackingStoreBase>& fastuidraw::GlyphAtlas::store ( void  ) const

Returns the store for this GlyphAtlas.

◆ unlock_resources()

void fastuidraw::GlyphAtlas::unlock_resources ( void  )

Decrements an internal counter. If this internal counter reaches zero then any deallocate_data() and clear() calls are issued.


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