|
Krita Source Code Documentation
|
#include <kis_strokes_queue.h>
Inheritance diagram for KisStrokesQueue:Classes | |
| class | LodNUndoStrokesFacade |
Public Attributes | |
| qreal | balancingRatioOverride |
| bool | currentStrokeLoaded |
| int | desiredLevelOfDetail |
| KisLodSyncStrokeStrategyFactory | lod0ToNStrokeStrategyFactory |
| bool | lodNNeedsSynchronization |
| KisPostExecutionUndoAdapter | lodNPostExecutionUndoAdapter |
| LodNUndoStrokesFacade | lodNStrokesFacade |
| KisSurrogateUndoStore | lodNUndoStore |
| KisLodPreferences | lodPreferences |
| QMutex | mutex |
| bool | needsExclusiveAccess |
| int | nextDesiredLevelOfDetail |
| int | openedStrokesCounter |
| std::function< void()> | postSyncLod0GUIPlaneRequestForResume |
| std::function< void()> | purgeRedoStateCallback |
| KisStrokesQueue * | q |
| StrokesQueue | strokesQueue |
| KisSuspendResumeStrategyPairFactory | suspendResumeUpdatesStrokeStrategyFactory |
| bool | wrapAroundModeSupported |
Public Attributes inherited from Private | |
| KisCanvas2 * | canvas |
| int | displayedFrame |
| int | intendedFrame |
Private Member Functions | |
| bool | checkBarrierProperty (bool hasMergeJobs, bool hasStrokeJobs, bool externalJobsPending) |
| bool | checkExclusiveProperty (bool hasMergeJobs, bool hasStrokeJobs) |
| bool | checkLevelOfDetailProperty (int runningLevelOfDetail) |
| bool | checkSequentialProperty (KisUpdaterContextSnapshotEx snapshot, bool externalJobsPending) |
| bool | checkStrokeState (bool hasStrokeJobsRunning, int runningLevelOfDetail) |
| bool | processOneJob (KisUpdaterContext &updaterContext, bool externalJobsPending) |
| KisStrokeId | startLodNUndoStroke (KisStrokeStrategy *strokeStrategy) |
Private Attributes | |
| Private *const | m_d |
Definition at line 62 of file kis_strokes_queue.cpp.
| KisStrokesQueue::KisStrokesQueue | ( | ) |
Definition at line 114 of file kis_strokes_queue.cpp.
| KisStrokesQueue::~KisStrokesQueue | ( | ) |
Definition at line 119 of file kis_strokes_queue.cpp.
References m_d.
| void KisStrokesQueue::addJob | ( | KisStrokeId | id, |
| KisStrokeJobData * | data ) |
Definition at line 342 of file kis_strokes_queue.cpp.
References KisStrokeJobData::createLodClone(), KIS_ASSERT_RECOVER_RETURN, KIS_SAFE_ASSERT_RECOVER_RETURN, and m_d.
|
finaloverridevirtual |
Implements KisStrokesQueueMutatedJobInterface.
Definition at line 361 of file kis_strokes_queue.cpp.
References KIS_SAFE_ASSERT_RECOVER_RETURN, and m_d.
| qreal KisStrokesQueue::balancingRatioOverride | ( | ) | const |
| void KisStrokesQueue::cancelForgettableStrokes | ( | ) |
| bool KisStrokesQueue::cancelStroke | ( | KisStrokeId | id | ) |
Definition at line 386 of file kis_strokes_queue.cpp.
References m_d.
|
private |
|
private |
Definition at line 867 of file kis_strokes_queue.cpp.
References m_d.
|
private |
Definition at line 914 of file kis_strokes_queue.cpp.
References m_d.
|
private |
Definition at line 876 of file kis_strokes_queue.cpp.
References KisStrokeJobData::BARRIER, HasBarrierJob, HasConcurrentJob, HasMergeJob, HasSequentialJob, HasUniquelyConcurrentJob, m_d, KisStrokeJobData::SEQUENTIAL, and KisStrokeJobData::UNIQUELY_CONCURRENT.
|
private |
We cannot start/continue a stroke if its LOD differs from the one that is running on CPU
The stroke may be cancelled very fast. In this case it will end up in the state:
!stroke->isInitialized() && stroke->isEnded() && !stroke->hasJobs()
This means that !isInitialised() doesn't imply there are any jobs present.
It might happen that the stroke got initialized, but its job was not started due to some other reasons like exclusivity. Therefore the stroke might end up in loaded, but uninitialized state.
If the stroke has no initialization phase, then it can arrive here unloaded.
If the Lod0 stroke has been cancelled without even being started, it means that the GUI still has LodN tiles active, so we should reread the data from the image to switch GUI tiles into Lod0 mode.
Definition at line 788 of file kis_strokes_queue.cpp.
References checkLevelOfDetailProperty(), checkStrokeState(), KisStroke::LOD0, and m_d.
| std::pair< StrokesQueueIterator, StrokesQueueIterator > KisStrokesQueue::currentLodRange | ( | ) |
| KUndo2MagicString KisStrokesQueue::currentStrokeName | ( | ) | const |
Definition at line 728 of file kis_strokes_queue.cpp.
References m_d.
| void KisStrokesQueue::debugDumpAllStrokes | ( | ) |
Definition at line 692 of file kis_strokes_queue.cpp.
| void KisStrokesQueue::endStroke | ( | KisStrokeId | id | ) |
Definition at line 371 of file kis_strokes_queue.cpp.
References KIS_SAFE_ASSERT_RECOVER_RETURN, and m_d.
| void KisStrokesQueue::explicitRegenerateLevelOfDetail | ( | ) |
Definition at line 679 of file kis_strokes_queue.cpp.
References m_d.
| StrokesQueueIterator KisStrokesQueue::findNewLod0Pos | ( | ) |
| StrokesQueueIterator KisStrokesQueue::findNewLodNPos | ( | KisStrokeSP | lodN | ) |
| void KisStrokesQueue::forceResetLodAndCloseCurrentLodRange | ( | ) |
| bool KisStrokesQueue::hasOpenedStrokes | ( | ) | const |
Definition at line 736 of file kis_strokes_queue.cpp.
References m_d.
| bool KisStrokesQueue::hasUnfinishedStrokes | ( | ) | const |
| bool KisStrokesQueue::isEmpty | ( | ) | const |
Definition at line 643 of file kis_strokes_queue.cpp.
References m_d.
| void KisStrokesQueue::loadStroke | ( | KisStrokeSP | stroke | ) |
| KisPostExecutionUndoAdapter * KisStrokesQueue::lodNPostExecutionUndoAdapter | ( | ) | const |
|
overridevirtual |
Implements KisStrokesQueueMutatedJobInterface.
| bool KisStrokesQueue::needsExclusiveAccess | ( | ) | const |
| void KisStrokesQueue::notifyUFOChangedImage | ( | ) |
Notifies the queue, that someone else (neither strokes nor the queue itself have changed the image. It means that the caches should be regenerated
Definition at line 685 of file kis_strokes_queue.cpp.
References m_d.
|
inline |
Definition at line 63 of file kis_strokes_queue.cpp.
|
private |
Definition at line 742 of file kis_strokes_queue.cpp.
References KisUpdaterContext::addStrokeJob(), checkExclusiveProperty(), checkSequentialProperty(), checkStrokeState(), ContextEmpty, KisUpdaterContext::currentLevelOfDetail(), KisUpdaterContext::getContextSnapshotEx(), HasMergeJob, and m_d.
| void KisStrokesQueue::processQueue | ( | KisUpdaterContext & | updaterContext, |
| bool | externalJobsPending ) |
Definition at line 589 of file kis_strokes_queue.cpp.
References KisUpdaterContext::hasSpareThread(), KisUpdaterContext::lock(), m_d, processOneJob(), and KisUpdaterContext::unlock().
| void KisStrokesQueue::setLod0ToNStrokeStrategyFactory | ( | const KisLodSyncStrokeStrategyFactory & | factory | ) |
Definition at line 703 of file kis_strokes_queue.cpp.
References m_d.
| void KisStrokesQueue::setLodPreferences | ( | const KisLodPreferences & | value | ) |
Definition at line 629 of file kis_strokes_queue.cpp.
| void KisStrokesQueue::setPostSyncLod0GUIPlaneRequestForResumeCallback | ( | const std::function< void()> & | callback | ) |
Definition at line 713 of file kis_strokes_queue.cpp.
References m_d.
| void KisStrokesQueue::setSuspendResumeUpdatesStrokeStrategyFactory | ( | const KisSuspendResumeStrategyPairFactory & | factory | ) |
Definition at line 708 of file kis_strokes_queue.cpp.
References m_d.
| bool KisStrokesQueue::shouldWrapInSuspendUpdatesStroke | ( | ) |
| qint32 KisStrokesQueue::sizeMetric | ( | ) | const |
| void KisStrokesQueue::startLod0ToNStroke | ( | int | levelOfDetail, |
| bool | forgettable ) |
|
private |
Definition at line 264 of file kis_strokes_queue.cpp.
References KIS_SAFE_ASSERT_RECOVER_NOOP, KisStroke::LODN, m_d, and KisStrokeStrategy::setMutatedJobsInterface().
| KisStrokeId KisStrokesQueue::startStroke | ( | KisStrokeStrategy * | strokeStrategy | ) |
Definition at line 281 of file kis_strokes_queue.cpp.
References KisStrokeStrategy::canForgetAboutMe(), KisStrokeStrategy::createLodClone(), executeStrokePair(), KisStrokeStrategy::forceLodModeIfPossible(), KisStroke::LEGACY, KisStroke::LOD0, KisStroke::LODN, m_d, KisStroke::RESUME, KisStrokeStrategy::setMutatedJobsInterface(), and KisStroke::SUSPEND.
| void KisStrokesQueue::switchDesiredLevelOfDetail | ( | bool | forced | ) |
| bool KisStrokesQueue::tryCancelCurrentStrokeAsync | ( | ) |
We cancel only ended strokes. This is done to avoid handling dangling pointers problem (KisStrokeId). The owner of a stroke will cancel the stroke itself if needed.
1) We can cancel only cancellable strokes 2) We can only cancel a continuous set of strokes
Basically, a non-cancellable stroke adds a barrier wall into the strokes queue, preventing cancellation of any strokes that we added into the queue earlier.
If the buddy has already finished, we cannot undo it because it doesn't store any undo data. Therefore we just regenerate the LOD caches.
NOTE: We do not touch the openedStrokesCounter here since we work with closed id's only here
Definition at line 414 of file kis_strokes_queue.cpp.
References KisStroke::isAsynchronouslyCancellable(), KIS_ASSERT_RECOVER_NOOP, KisStroke::LOD0, and m_d.
| void KisStrokesQueue::tryClearUndoOnStrokeCompletion | ( | KisStrokeSP | finishingStroke | ) |
| UndoResult KisStrokesQueue::tryUndoLastStrokeAsync | ( | ) |
Definition at line 476 of file kis_strokes_queue.cpp.
References KIS_SAFE_ASSERT_RECOVER, KIS_SAFE_ASSERT_RECOVER_NOOP, KisStroke::LEGACY, KisStroke::LOD0, KisStroke::LODN, m_d, UNDO_FAIL, UNDO_OK, and UNDO_WAIT.
| bool KisStrokesQueue::wrapAroundModeSupported | ( | ) | const |
| qreal KisStrokesQueue::balancingRatioOverride |
Definition at line 81 of file kis_strokes_queue.cpp.
| bool KisStrokesQueue::currentStrokeLoaded |
Definition at line 82 of file kis_strokes_queue.cpp.
| int KisStrokesQueue::desiredLevelOfDetail |
Definition at line 85 of file kis_strokes_queue.cpp.
| KisLodSyncStrokeStrategyFactory KisStrokesQueue::lod0ToNStrokeStrategyFactory |
Definition at line 88 of file kis_strokes_queue.cpp.
| bool KisStrokesQueue::lodNNeedsSynchronization |
Definition at line 84 of file kis_strokes_queue.cpp.
| KisPostExecutionUndoAdapter * KisStrokesQueue::lodNPostExecutionUndoAdapter |
Definition at line 94 of file kis_strokes_queue.cpp.
| LodNUndoStrokesFacade KisStrokesQueue::lodNStrokesFacade |
Definition at line 93 of file kis_strokes_queue.cpp.
| KisSurrogateUndoStore KisStrokesQueue::lodNUndoStore |
Definition at line 92 of file kis_strokes_queue.cpp.
| KisLodPreferences KisStrokesQueue::lodPreferences |
The desired level of detail might have not been activated due to multi-stage activation process
Definition at line 95 of file kis_strokes_queue.cpp.
|
private |
Definition at line 93 of file kis_strokes_queue.h.
| QMutex KisStrokesQueue::mutex |
Definition at line 87 of file kis_strokes_queue.cpp.
| bool KisStrokesQueue::needsExclusiveAccess |
Definition at line 79 of file kis_strokes_queue.cpp.
| int KisStrokesQueue::nextDesiredLevelOfDetail |
Definition at line 86 of file kis_strokes_queue.cpp.
| int KisStrokesQueue::openedStrokesCounter |
Definition at line 78 of file kis_strokes_queue.cpp.
| std::function<void()> KisStrokesQueue::postSyncLod0GUIPlaneRequestForResume |
Definition at line 91 of file kis_strokes_queue.cpp.
| std::function<void()> KisStrokesQueue::purgeRedoStateCallback |
Definition at line 90 of file kis_strokes_queue.cpp.
| KisStrokesQueue* KisStrokesQueue::q |
Definition at line 76 of file kis_strokes_queue.cpp.
| StrokesQueue KisStrokesQueue::strokesQueue |
Definition at line 77 of file kis_strokes_queue.cpp.
| KisSuspendResumeStrategyPairFactory KisStrokesQueue::suspendResumeUpdatesStrokeStrategyFactory |
Definition at line 89 of file kis_strokes_queue.cpp.
| bool KisStrokesQueue::wrapAroundModeSupported |
Definition at line 80 of file kis_strokes_queue.cpp.