LibreOffice Module canvas (master) 1
|
#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, CacheEntry > | TextureCacheMapT |
Private Attributes | |
TextureCacheMapT | maCache |
sal_uInt32 | mnMissCount |
sal_uInt32 | mnHitCount |
Definition at line 20 of file ogl_texturecache.hxx.
|
private |
Definition at line 53 of file ogl_texturecache.hxx.
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().
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().
|
inline |
Definition at line 41 of file ogl_texturecache.hxx.
References mnHitCount.
|
inline |
Definition at line 40 of file ogl_texturecache.hxx.
References mnMissCount.
|
inline |
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.
|
mutableprivate |
Definition at line 54 of file ogl_texturecache.hxx.
Referenced by flush(), getCacheSize(), getTexture(), and prune().
|
mutableprivate |
Definition at line 56 of file ogl_texturecache.hxx.
Referenced by flush(), getCacheHitCount(), getTexture(), and prune().
|
mutableprivate |
Definition at line 55 of file ogl_texturecache.hxx.
Referenced by flush(), getCacheMissCount(), getTexture(), and prune().