35 std::shared_ptr<BitmapCache> pCache,
36 const Size& rPreviewSize,
37 const bool bDoSuperSampling,
39 : maTimer(
"sd::QueueProcessor maTimer"),
40 maPreviewSize(rPreviewSize),
41 mbDoSuperSampling(bDoSuperSampling),
42 mpCacheContext(
std::move(pCacheContext)),
44 mpCache(
std::move(pCache)),
61 if (nPriorityClass == 0)
88 const Size& rPreviewSize,
89 const bool bDoSuperSampling)
146 std::scoped_lock aGuard (
maMutex);
152 if (pSdPage !=
nullptr)
163 catch (css::uno::Exception &)
170 const std::shared_ptr<BitmapCache>& rpCache)
void SetTimeout(sal_uInt64 nTimeoutMs)
void SetInvokeHandler(const Link< Timer *, void > &rLink)
virtual void Start(bool bStartTimer=true) override
BitmapEx CreateBitmap(const SdPage &rPage, const Size &rPixelSize, const bool bDoSuperSampling)
This queue processor is timer based, i.e.
void SetBitmapCache(const std::shared_ptr< BitmapCache > &rpCache)
Use this method when the page cache is (maybe) using a different BitmapCache.
std::mutex maMutex
This mutex is used to guard the queue processor.
void ProcessOneRequest(CacheKey aKey, const RequestPriorityClass ePriorityClass)
BitmapFactory maBitmapFactory
std::shared_ptr< BitmapCache > mpCache
QueueProcessor(RequestQueue &rQueue, std::shared_ptr< BitmapCache > pCache, const Size &rPreviewSize, const bool bDoSuperSampling, SharedCacheContext pCacheContext)
void Start(int nPriorityClass)
Start the processor.
void SetPreviewSize(const Size &rSize, const bool bDoSuperSampling)
SharedCacheContext mpCacheContext
The request queue stores requests that are described by the Request sorted according to priority clas...
bool IsEmpty()
Returns <TRUE> when there is no element in the queue.
::osl::Mutex & GetMutex()
Return the mutex that guards the access to the priority queue.
RequestPriorityClass GetFrontPriorityClass()
void PopFront()
Really a synonym for RemoveRequest(GetFront());.
CacheKey GetFront()
Get the request with the highest priority int the highest priority class.
#define TOOLS_WARN_EXCEPTION(area, stream)
#define LINK(Instance, Class, Member)
IMPL_LINK_NOARG(CacheCompactor, CompactionCallback, Timer *, void)
RequestPriorityClass
Each request for a preview creation has a priority.
std::shared_ptr< CacheContext > SharedCacheContext