A GlyphCache represents a cache of glyphs and manages the uploading of the data to a GlyphAtlas. The methods of GlyphAtlas are thread safe because it maintains an internal mutex lock for the durations of its methods.
More...
#include <glyph_cache.hpp>
|
| GlyphCache (reference_counted_ptr< GlyphAtlas > patlas) |
|
enum return_code | add_glyph (Glyph glyph, bool upload_to_atlas=true) |
|
AllocationHandle | allocate_data (c_array< const uint32_t > pdata) |
|
void | clear_atlas (void) |
|
void | clear_cache (void) |
|
void | deallocate_data (AllocationHandle h) |
|
void | delete_glyph (Glyph glyph) |
|
Glyph | fetch_glyph (GlyphRenderer render, const FontBase *font, uint32_t glyph_code, bool upload_to_atlas=true) |
|
GlyphMetrics | fetch_glyph_metrics (const FontBase *font, uint32_t glyph_code) |
|
void | fetch_glyph_metrics (const FontBase *font, c_array< const uint32_t > glyph_codes, c_array< GlyphMetrics > out_metrics) |
|
void | fetch_glyph_metrics (c_array< const GlyphSource > glyph_sources, c_array< GlyphMetrics > out_metrics) |
|
void | fetch_glyphs (GlyphRenderer render, const FontBase *font, c_array< const uint32_t > glyph_codes, c_array< Glyph > out_glyphs, bool upload_to_atlas=true) |
|
void | fetch_glyphs (GlyphRenderer render, c_array< const GlyphSource > glyph_sources, c_array< Glyph > out_glyphs, bool upload_to_atlas=true) |
|
void | fetch_glyphs (GlyphRenderer render, c_array< const GlyphMetrics > glyph_metrics, c_array< Glyph > out_glyphs, bool upload_to_atlas=true) |
|
unsigned int | number_times_atlas_cleared (void) |
|
| reference_counted_base (void) |
|
A GlyphCache represents a cache of glyphs and manages the uploading of the data to a GlyphAtlas. The methods of GlyphAtlas are thread safe because it maintains an internal mutex lock for the durations of its methods.
Definition at line 43 of file glyph_cache.hpp.
◆ GlyphCache()
◆ add_glyph()
enum return_code fastuidraw::GlyphCache::add_glyph |
( |
Glyph |
glyph, |
|
|
bool |
upload_to_atlas = true |
|
) |
| |
◆ allocate_data()
◆ clear_atlas()
void fastuidraw::GlyphCache::clear_atlas |
( |
void |
| ) |
|
◆ clear_cache()
void fastuidraw::GlyphCache::clear_cache |
( |
void |
| ) |
|
◆ deallocate_data()
◆ delete_glyph()
void fastuidraw::GlyphCache::delete_glyph |
( |
Glyph |
glyph | ) |
|
Deletes and removes a glyph from the GlyphCache, thus to use that glyph again requires calling fetch_glyph() (and thus fetching a new value for Glyph). The underlying memory of the Glyph will be reused by a later glyph, thus the Glyph value passed should be discarded.
- Parameters
-
glyph | Glyph to delete and remove from cache |
◆ fetch_glyph()
Glyph fastuidraw::GlyphCache::fetch_glyph |
( |
GlyphRenderer |
render, |
|
|
const FontBase * |
font, |
|
|
uint32_t |
glyph_code, |
|
|
bool |
upload_to_atlas = true |
|
) |
| |
Fetch, and if necessay create and store, a glyph given a glyph code of a font and a GlyphRenderer specifying how to render the glyph.
- Parameters
-
render | renderer of fetched Glyph |
font | font from which to take the glyph |
glyph_code | glyph code |
upload_to_atlas | if true, upload to atlas |
◆ fetch_glyph_metrics() [1/3]
GlyphMetrics fastuidraw::GlyphCache::fetch_glyph_metrics |
( |
const FontBase * |
font, |
|
|
uint32_t |
glyph_code |
|
) |
| |
Fetch, and if necessay create and store, the metrics of given a glyph code of a font.
- Parameters
-
font | font from which to take the glyph |
glyph_code | glyph code |
◆ fetch_glyph_metrics() [2/3]
Fetch, and if necessay create and store, the metrics of given a set of glyph codes of a font.
- Parameters
-
font | font from which to take the glyph |
glyph_codes | glyph codes to fetch |
out_metrics | location to which to write the Glyph |
◆ fetch_glyph_metrics() [3/3]
Fetch, and if necessay create and store, the metrics of given a set of glyph codes of a font.
- Parameters
-
glyph_sources | sequence of GlyphSource values |
out_metrics | location to which to write the Glyph |
◆ fetch_glyphs() [1/3]
Fetch, and if necessay create and store, a sequence of glyphs given a sequence of glyph codes of a font and a GlyphRenderer specifying how to render the glyph.
- Parameters
-
| render | renderer of fetched Glyph |
| font | font from which to take the glyph |
| glyph_codes | sequence of glyph codes |
[out] | out_glyphs | location to which to write the glyphs; the size must be the same as glyph_codes |
| upload_to_atlas | if true, upload glyphs to atlas |
◆ fetch_glyphs() [2/3]
Fetch, and if necessay create and store, a sequence of glyphs given a sequence of glyph codes of a font and a GlyphRenderer specifying how to render the glyph.
- Parameters
-
| render | renderer of fetched Glyph |
| glyph_sources | sequence of GlyphSource values |
[out] | out_glyphs | location to which to write the glyphs; the size must be the same as glyph_codes |
| upload_to_atlas | if true, upload glyphs to atlas |
◆ fetch_glyphs() [3/3]
Fetch, and if necessay create and store, a sequence of glyphs given a sequence of GlyphMetrics values and a GlyphRenderer specifying how to render the glyph.
- Parameters
-
| render | renderer of fetched Glyph |
| glyph_metrics | sequence of GlyphMetrics values |
[out] | out_glyphs | location to which to write the glyphs; the size must be the same as glyph_codes |
| upload_to_atlas | if true, upload glyphs to atlas |
◆ number_times_atlas_cleared()
unsigned int fastuidraw::GlyphCache::number_times_atlas_cleared |
( |
void |
| ) |
|
The documentation for this class was generated from the following file: