31class BitmapCompressor;
154 void Compress(
const CacheKey& rKey,
const std::shared_ptr<BitmapCompressor>& rpCompressor);
203 void UpdateCacheSize(std::unique_lock<std::mutex>& rGuard,
const CacheEntry& rKey,
209 const BitmapEx& rPreview,
bool bIsPrecious);
This low level cache is the actual bitmap container.
void ReCalculateTotalCacheSize()
Calculate the cache size.
void Recycle(const BitmapCache &rCache)
Use the previews in the given cache to initialize missing previews.
bool InvalidateBitmap(const CacheKey &rKey)
Mark the specified preview bitmap as not being up-to-date anymore.
sal_Int32 mnMaximalNormalCacheSize
The maximal cache size for the off-screen preview bitmaps.
void SetPrecious(const CacheKey &rKey, bool bIsPrecious)
Mark the specified preview bitmap as precious, i.e.
::std::vector< CacheKey > CacheIndex
std::unique_ptr< CacheBitmapContainer > mpBitmapContainer
::std::unique_ptr< CacheCompactor > mpCacheCompactor
The cache compactor is used to reduce the number of bytes used by off-screen preview bitmaps.
BitmapEx GetBitmap(const CacheKey &rKey)
Return the preview bitmap for the given contact object.
void SetMarkedBitmap(const CacheKey &rKey, const BitmapEx &rPreview)
Add or replace a marked bitmap for the given key.
void Compress(const CacheKey &rKey, const std::shared_ptr< BitmapCompressor > &rpCompressor)
Compress the specified preview bitmap with the given bitmap compressor.
bool IsFull() const
Return <TRUE> when the cache is full, i.e.
bool HasBitmap(const CacheKey &rKey)
Return <TRUE> when a preview bitmap exists for the given key.
void SetBitmap(const CacheKey &rKey, const BitmapEx &rPreview, bool bIsPrecious)
Add or replace a bitmap for the given key.
sal_Int32 mnNormalCacheSize
Total size of bytes that are occupied by bitmaps in the cache for whom the slides are currently not i...
void Clear()
Remove all preview bitmaps from the cache.
CacheIndex GetCacheIndex() const
Return a list of sorted cache keys that represent an index into (a part of) the cache.
sal_Int32 GetSize() const
Return the memory size that is occupied by all non-precious bitmaps in the cache.
void ReleaseBitmap(const CacheKey &rKey)
Release the reference to the preview bitmap that is associated with the given key.
bool BitmapIsUpToDate(const CacheKey &rKey)
Return <TRUE> when a preview bitmap exists for the given key and when it is up-to-date.
const SdrPage * CacheKey
The key for looking up preview bitmaps is a pointer to an SdrPage object.
~BitmapCache()
The destructor clears the cache and releases all bitmaps still in it.
CacheOperation
Update mnNormalCacheSize or mnPreciousCacheSize according to the precious flag of the specified previ...
BitmapCache()
Create a new cache for bitmap objects.
bool mbIsFull
This flag stores if the cache is or recently was full, i.e.
void UpdateCacheSize(std::unique_lock< std::mutex > &rGuard, const CacheEntry &rKey, CacheOperation eOperation)
BitmapEx GetMarkedBitmap(const CacheKey &rKey)
Return the marked preview bitmap for the given contact object.
void InvalidateCache()
Mark all preview bitmaps as not being up-to-date anymore.
sal_Int32 mnCurrentAccessTime
At the moment the access time is not an actual time or date value but a counter that is increased wit...
sal_Int32 mnPreciousCacheSize
Total size of bytes that are occupied by bitmaps in the cache for whom the slides are currently visib...