JUCE  v5.4.1-191-g0ab5e696f
JUCE API
Looking for a senior C++ dev?
I'm looking for work. Hire me!
juce::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 juce::RenderingHelpers::GlyphCache< CachedGlyphType, RenderTargetType >:
Collaboration diagram for juce::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)
 
ReferenceCountedObjectPtr< CachedGlyphType > findExistingGlyph (const Font &font, int glyphNumber) const noexcept
 
CachedGlyphType * findLeastRecentlyUsedGlyph () const noexcept
 
ReferenceCountedObjectPtr< 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
 

Detailed Description

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

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

{Graphics}

Constructor & Destructor Documentation

◆ GlyphCache()

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

◆ ~GlyphCache()

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

Member Function Documentation

◆ addNewGlyphSlots()

◆ deleteAll()

static void juce::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 juce::RenderingHelpers::GlyphCache< CachedGlyphType, RenderTargetType >::drawGlyph ( RenderTargetType &  target,
const Font font,
const int  glyphNumber,
Point< float pos 
)
inline

◆ findExistingGlyph()

template<class CachedGlyphType, class RenderTargetType>
ReferenceCountedObjectPtr<CachedGlyphType> juce::RenderingHelpers::GlyphCache< CachedGlyphType, RenderTargetType >::findExistingGlyph ( const Font font,
int  glyphNumber 
) const
inlineprivatenoexcept

◆ findLeastRecentlyUsedGlyph()

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

◆ findOrCreateGlyph()

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

References jassert.

◆ getGlyphForReuse()

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

◆ getInstance()

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

◆ getSingletonPointer()

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

◆ reset()

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

Member Data Documentation

◆ accessCounter

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

◆ glyphs

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

◆ hits

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

◆ lock

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

◆ misses

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

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