JUCE  v6.1.6 (6.0.8-1114)
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 () override
 
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.

@tags{Graphics}

Constructor & Destructor Documentation

◆ GlyphCache()

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

References juce::gl::reset.

◆ ~GlyphCache()

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

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

References juce::gl::target.

◆ findExistingGlyph()

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

References juce::gl::g.

◆ findLeastRecentlyUsedGlyph()

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

References juce::gl::g.

◆ findOrCreateGlyph()

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

References juce::gl::g, and 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

References juce::gl::g.

◆ getSingletonPointer()

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

References juce::gl::g.

◆ 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: