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 22 of file ogl_texturecache.hxx.

Member Typedef Documentation

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

Definition at line 55 of file ogl_texturecache.hxx.

Constructor & Destructor Documentation

oglcanvas::TextureCache::TextureCache ( )

Definition at line 23 of file ogl_texturecache.cxx.

References maCache.

oglcanvas::TextureCache::~TextureCache ( )

Definition at line 29 of file ogl_texturecache.cxx.

References flush().

Member Function Documentation

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().

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

Definition at line 43 of file ogl_texturecache.hxx.

References mnHitCount.

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

Definition at line 42 of file ogl_texturecache.hxx.

References mnMissCount.

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

Statistics.

Definition at line 41 of file ogl_texturecache.hxx.

References maCache.

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.

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

TextureCacheMapT oglcanvas::TextureCache::maCache
mutableprivate

Definition at line 56 of file ogl_texturecache.hxx.

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

sal_uInt32 oglcanvas::TextureCache::mnHitCount
mutableprivate

Definition at line 58 of file ogl_texturecache.hxx.

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

sal_uInt32 oglcanvas::TextureCache::mnMissCount
mutableprivate

Definition at line 57 of file ogl_texturecache.hxx.

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


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