LibreOffice Module canvas (master) 1
Classes | Public Member Functions | Private Types | Private Attributes | List of all members
oglcanvas::TextureCache Class Reference

#include <ogl_texturecache.hxx>

Classes

struct  CacheEntry
 

Public Member Functions

 TextureCache ()
 
 ~TextureCache ()
 
void flush ()
 clear whole cache, reset statistic counters More...
 
void prune ()
 prune old entries from cache More...
 
size_t getCacheSize () const
 Statistics. More...
 
sal_uInt32 getCacheMissCount () const
 
sal_uInt32 getCacheHitCount () const
 
unsigned int getTexture (const css::geometry::IntegerSize2D &rPixelSize, const sal_Int8 *pPixel, sal_uInt32 nPixelCrc32) const
 

Private Types

typedef std::unordered_map< sal_uInt32, CacheEntryTextureCacheMapT
 

Private Attributes

TextureCacheMapT maCache
 
sal_uInt32 mnMissCount
 
sal_uInt32 mnHitCount
 

Detailed Description

Definition at line 20 of file ogl_texturecache.hxx.

Member Typedef Documentation

◆ TextureCacheMapT

typedef std::unordered_map<sal_uInt32,CacheEntry> oglcanvas::TextureCache::TextureCacheMapT
private

Definition at line 53 of file ogl_texturecache.hxx.

Constructor & Destructor Documentation

◆ TextureCache()

oglcanvas::TextureCache::TextureCache ( )

Definition at line 23 of file ogl_texturecache.cxx.

References maCache.

◆ ~TextureCache()

oglcanvas::TextureCache::~TextureCache ( )

Definition at line 29 of file ogl_texturecache.cxx.

References flush().

Member Function Documentation

◆ flush()

void oglcanvas::TextureCache::flush ( )

clear whole cache, reset statistic counters

Definition at line 34 of file ogl_texturecache.cxx.

References maCache, mnHitCount, and mnMissCount.

Referenced by ~TextureCache().

◆ getCacheHitCount()

sal_uInt32 oglcanvas::TextureCache::getCacheHitCount ( ) const
inline

Definition at line 41 of file ogl_texturecache.hxx.

References mnHitCount.

◆ getCacheMissCount()

sal_uInt32 oglcanvas::TextureCache::getCacheMissCount ( ) const
inline

Definition at line 40 of file ogl_texturecache.hxx.

References mnMissCount.

◆ getCacheSize()

size_t oglcanvas::TextureCache::getCacheSize ( ) const
inline

Statistics.

Definition at line 39 of file ogl_texturecache.hxx.

References maCache.

◆ getTexture()

unsigned int oglcanvas::TextureCache::getTexture ( const css::geometry::IntegerSize2D &  rPixelSize,
const sal_Int8 pPixel,
sal_uInt32  nPixelCrc32 
) const

Definition at line 75 of file ogl_texturecache.cxx.

References maCache, mnHitCount, and mnMissCount.

◆ prune()

void oglcanvas::TextureCache::prune ( )

prune old entries from cache

Every time this method is called, all cache entries are set to "old". If subsequently not used by getTexture(), they'll be entitled for expunge on the next prune() call. Resets statistic counters.

Definition at line 50 of file ogl_texturecache.cxx.

References maCache, mnHitCount, and mnMissCount.

Member Data Documentation

◆ maCache

TextureCacheMapT oglcanvas::TextureCache::maCache
mutableprivate

Definition at line 54 of file ogl_texturecache.hxx.

Referenced by flush(), getCacheSize(), getTexture(), and prune().

◆ mnHitCount

sal_uInt32 oglcanvas::TextureCache::mnHitCount
mutableprivate

Definition at line 56 of file ogl_texturecache.hxx.

Referenced by flush(), getCacheHitCount(), getTexture(), and prune().

◆ mnMissCount

sal_uInt32 oglcanvas::TextureCache::mnMissCount
mutableprivate

Definition at line 55 of file ogl_texturecache.hxx.

Referenced by flush(), getCacheMissCount(), getTexture(), and prune().


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