JUCE  v5.1.1-3-g1a0b28c73
JUCE API
RenderingHelpers::GlyphCache< CachedGlyphType, RenderTargetType > Class Template Reference

Holds a cache of recently-used glyph objects of some type. More...

#include <juce_RenderingHelpers.h>

Inheritance diagram for RenderingHelpers::GlyphCache< CachedGlyphType, RenderTargetType >:
Collaboration diagram for RenderingHelpers::GlyphCache< CachedGlyphType, RenderTargetType >:

Public Member Functions

 GlyphCache ()
 
 ~GlyphCache ()
 
void drawGlyph (RenderTargetType &target, const Font &font, const int glyphNumber, Point< float > pos)
 
ReferenceCountedObjectPtr< CachedGlyphType > findOrCreateGlyph (const Font &font, int glyphNumber)
 
void reset ()
 

Static Public Member Functions

static GlyphCachegetInstance ()
 

Private Member Functions

void addNewGlyphSlots (int num)
 
CachedGlyphType * findExistingGlyph (const Font &font, int glyphNumber) const
 
CachedGlyphType * findLeastRecentlyUsedGlyph () const noexcept
 
CachedGlyphType * getGlyphForReuse ()
 

Static Private Member Functions

static void deleteAll ()
 Deletes all extant objects. More...
 
static GlyphCache *& getSingletonPointer () noexcept
 

Private Attributes

Atomic< intaccessCounter
 
ReferenceCountedArray< CachedGlyphType > glyphs
 
Atomic< inthits
 
CriticalSection lock
 
Atomic< intmisses
 

Friends

struct ContainerDeletePolicy< CachedGlyphType >
 

Detailed Description

template<class CachedGlyphType, class RenderTargetType>
class RenderingHelpers::GlyphCache< CachedGlyphType, RenderTargetType >

Holds a cache of recently-used glyph objects of some type.

Constructor & Destructor Documentation

◆ GlyphCache()

template<class CachedGlyphType , class RenderTargetType >
RenderingHelpers::GlyphCache< CachedGlyphType, RenderTargetType >::GlyphCache ( )
inline

◆ ~GlyphCache()

template<class CachedGlyphType , class RenderTargetType >
RenderingHelpers::GlyphCache< CachedGlyphType, RenderTargetType >::~GlyphCache ( )
inline

Member Function Documentation

◆ addNewGlyphSlots()

◆ deleteAll()

static void DeletedAtShutdown::deleteAll ( )
staticinherited

Deletes all extant objects.

This shouldn't be used by applications, as it's called automatically in the shutdown code of the JUCEApplicationBase class.

◆ drawGlyph()

template<class CachedGlyphType , class RenderTargetType >
void RenderingHelpers::GlyphCache< CachedGlyphType, RenderTargetType >::drawGlyph ( RenderTargetType &  target,
const Font font,
const int  glyphNumber,
Point< float >  pos 
)
inline

◆ findExistingGlyph()

template<class CachedGlyphType , class RenderTargetType >
CachedGlyphType* RenderingHelpers::GlyphCache< CachedGlyphType, RenderTargetType >::findExistingGlyph ( const Font font,
int  glyphNumber 
) const
inlineprivate

◆ findLeastRecentlyUsedGlyph()

template<class CachedGlyphType , class RenderTargetType >
CachedGlyphType* RenderingHelpers::GlyphCache< CachedGlyphType, RenderTargetType >::findLeastRecentlyUsedGlyph ( ) const
inlineprivatenoexcept

◆ findOrCreateGlyph()

template<class CachedGlyphType , class RenderTargetType >
ReferenceCountedObjectPtr<CachedGlyphType> RenderingHelpers::GlyphCache< CachedGlyphType, RenderTargetType >::findOrCreateGlyph ( const Font font,
int  glyphNumber 
)
inline

References jassert.

◆ getGlyphForReuse()

template<class CachedGlyphType , class RenderTargetType >
CachedGlyphType* RenderingHelpers::GlyphCache< CachedGlyphType, RenderTargetType >::getGlyphForReuse ( )
inlineprivate

◆ getInstance()

template<class CachedGlyphType , class RenderTargetType >
static GlyphCache& RenderingHelpers::GlyphCache< CachedGlyphType, RenderTargetType >::getInstance ( )
inlinestatic

◆ getSingletonPointer()

template<class CachedGlyphType , class RenderTargetType >
static GlyphCache*& RenderingHelpers::GlyphCache< CachedGlyphType, RenderTargetType >::getSingletonPointer ( )
inlinestaticprivatenoexcept

◆ reset()

template<class CachedGlyphType , class RenderTargetType >
void RenderingHelpers::GlyphCache< CachedGlyphType, RenderTargetType >::reset ( )
inline

Friends And Related Function Documentation

◆ ContainerDeletePolicy< CachedGlyphType >

template<class CachedGlyphType , class RenderTargetType >
friend struct ContainerDeletePolicy< CachedGlyphType >
friend

Member Data Documentation

◆ accessCounter

template<class CachedGlyphType , class RenderTargetType >
Atomic<int> RenderingHelpers::GlyphCache< CachedGlyphType, RenderTargetType >::accessCounter
private

◆ glyphs

template<class CachedGlyphType , class RenderTargetType >
ReferenceCountedArray<CachedGlyphType> RenderingHelpers::GlyphCache< CachedGlyphType, RenderTargetType >::glyphs
private

◆ hits

template<class CachedGlyphType , class RenderTargetType >
Atomic<int> RenderingHelpers::GlyphCache< CachedGlyphType, RenderTargetType >::hits
private

◆ lock

template<class CachedGlyphType , class RenderTargetType >
CriticalSection RenderingHelpers::GlyphCache< CachedGlyphType, RenderTargetType >::lock
private

◆ misses

template<class CachedGlyphType , class RenderTargetType >
Atomic<int> RenderingHelpers::GlyphCache< CachedGlyphType, RenderTargetType >::misses
private

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