Krita Source Code Documentation
Loading...
Searching...
No Matches
KisTestableUpdateScheduler Class Reference

#include <kis_update_scheduler.h>

+ Inheritance diagram for KisTestableUpdateScheduler:

Public Member Functions

 KisTestableUpdateScheduler (KisProjectionUpdateListener *projectionUpdateListener, qint32 threadCount)
 
void processQueues ()
 
KisUpdaterContextupdaterContext ()
 
- Public Member Functions inherited from KisUpdateScheduler
void addJob (KisStrokeId id, KisStrokeJobData *data) override
 
void addSpontaneousJob (KisSpontaneousJob *spontaneousJob)
 
qreal balancingRatio () const
 
void barrierLock ()
 
void blockUpdates ()
 
bool cancelStroke (KisStrokeId id) override
 
void continueUpdate (const QRect &rect)
 
int currentLevelOfDetail () const
 
void doSomeUsefulWork ()
 
void endStroke (KisStrokeId id) override
 
void explicitRegenerateLevelOfDetail ()
 
void fullRefreshAsync (KisNodeSP root, const QRect &rc, const QRect &cropRect)
 
void fullRefreshAsync (KisNodeSP root, const QVector< QRect > &rects, const QRect &cropRect, KisProjectionUpdateFlags flags)
 
bool hasUpdatesRunning () const
 
void immediateLockForReadOnly ()
 
bool isIdle ()
 
 KisUpdateScheduler (KisProjectionUpdateListener *projectionUpdateListener, QObject *parent=0)
 
KisPostExecutionUndoAdapterlodNPostExecutionUndoAdapter () const
 
KisLodPreferences lodPreferences () const
 
 Private (KisUpdateScheduler *_q, KisProjectionUpdateListener *p)
 
void setLod0ToNStrokeStrategyFactory (const KisLodSyncStrokeStrategyFactory &factory)
 
void setLodPreferences (const KisLodPreferences &value)
 
void setPostSyncLod0GUIPlaneRequestForResumeCallback (const std::function< void()> &callback)
 
void setProgressProxy (KoProgressProxy *progressProxy)
 
void setPurgeRedoStateCallback (const std::function< void()> &callback)
 
void setSuspendResumeUpdatesStrokeStrategyFactory (const KisSuspendResumeStrategyPairFactory &factory)
 
void setThreadsLimit (int value)
 
void spareThreadAppeared ()
 
KisStrokeId startStroke (KisStrokeStrategy *strokeStrategy) override
 
int threadsLimit () const
 
bool tryBarrierLock ()
 
bool tryCancelCurrentStrokeAsync ()
 
UndoResult tryUndoLastStrokeAsync ()
 
void unblockUpdates ()
 
void unlock (bool resetLodLevels=true)
 
void updateProjection (KisNodeSP node, const QRect &rc, const QRect &cropRect)
 
void updateProjection (KisNodeSP node, const QVector< QRect > &rects, const QRect &cropRect, KisProjectionUpdateFlags flags)
 
void waitForDone ()
 
bool wrapAroundModeSupported () const
 
 ~KisUpdateScheduler () override
 
- Public Member Functions inherited from Private
 Private (KisCanvas2 *c)
 
- Public Member Functions inherited from KisStrokesFacade
virtual ~KisStrokesFacade ()
 

Additional Inherited Members

- Public Attributes inherited from KisUpdateScheduler
qreal defaultBalancingRatio = 1.0
 
bool processingBlocked = false
 
KisQueuesProgressUpdaterprogressUpdater = 0
 
KisProjectionUpdateListenerprojectionUpdateListener
 
KisUpdateSchedulerq
 
KisStrokesQueue strokesQueue
 
KisUpdaterContext updaterContext
 
KisLazyWaitCondition updatesFinishedCondition
 
QAtomicInt updatesLockCounter
 
KisSimpleUpdateQueue updatesQueue
 
QReadWriteLock updatesStartLock
 
- Public Attributes inherited from Private
KisCanvas2canvas
 
int displayedFrame
 
int intendedFrame
 
- Protected Slots inherited from KisUpdateScheduler
void updateSettings ()
 
- Protected Member Functions inherited from KisUpdateScheduler
void connectSignals ()
 
 KisUpdateScheduler ()
 
void processQueues ()
 
- Protected Attributes inherited from KisUpdateScheduler
Private *const m_d
 

Detailed Description

Definition at line 252 of file kis_update_scheduler.h.

Constructor & Destructor Documentation

◆ KisTestableUpdateScheduler()

KisTestableUpdateScheduler::KisTestableUpdateScheduler ( KisProjectionUpdateListener * projectionUpdateListener,
qint32 threadCount )

Definition at line 447 of file kis_update_scheduler.cpp.

449{
451 m_d->projectionUpdateListener = projectionUpdateListener;
452
453 setThreadsLimit(threadCount);
454 m_d->updaterContext.setTestingMode(true);
455
457}
void setThreadsLimit(int value)
KisProjectionUpdateListener * projectionUpdateListener

References KisUpdateScheduler::connectSignals(), KisUpdateScheduler::m_d, KisUpdateScheduler::projectionUpdateListener, KisUpdateScheduler::setThreadsLimit(), and KisUpdateScheduler::updateSettings().

Member Function Documentation

◆ processQueues()

void KisUpdateScheduler::processQueues ( )

Definition at line 227 of file kis_update_scheduler.cpp.

357{
359
360 if(m_d->processingBlocked) return;
361
362 if(m_d->strokesQueue.needsExclusiveAccess()) {
363 DEBUG_BALANCING_METRICS("STROKES", "X");
364 m_d->strokesQueue.processQueue(m_d->updaterContext,
365 !m_d->updatesQueue.isEmpty());
366
367 if(!m_d->strokesQueue.needsExclusiveAccess()) {
369 }
370 }
371 else if(m_d->balancingRatio() * m_d->strokesQueue.sizeMetric() > m_d->updatesQueue.sizeMetric()) {
372 DEBUG_BALANCING_METRICS("STROKES", "N");
373 m_d->strokesQueue.processQueue(m_d->updaterContext,
374 !m_d->updatesQueue.isEmpty());
376 }
377 else {
378 DEBUG_BALANCING_METRICS("UPDATES", "N");
380 m_d->strokesQueue.processQueue(m_d->updaterContext,
381 !m_d->updatesQueue.isEmpty());
382
383 }
384
386}
#define DEBUG_BALANCING_METRICS(decidedFirst, excl)

◆ updaterContext()

KisUpdaterContext * KisTestableUpdateScheduler::updaterContext ( )

Definition at line 459 of file kis_update_scheduler.cpp.

460{
461 return &m_d->updaterContext;
462}

References KisUpdateScheduler::m_d.


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