|
Krita Source Code Documentation
|
#include <kis_simple_update_queue.h>
Inheritance diagram for KisSimpleUpdateQueue:Public Member Functions | |
| void | addFullRefreshJob (KisNodeSP node, const QRect &rc, const QRect &cropRect, int levelOfDetail) |
| void | addFullRefreshJob (KisNodeSP node, const QVector< QRect > &rects, const QRect &cropRect, int levelOfDetail, KisProjectionUpdateFlags flags) |
| void | addSpontaneousJob (KisSpontaneousJob *spontaneousJob) |
| void | addUpdateJob (KisNodeSP node, const QRect &rc, const QRect &cropRect, int levelOfDetail) |
| void | addUpdateJob (KisNodeSP node, const QVector< QRect > &rects, const QRect &cropRect, int levelOfDetail, KisProjectionUpdateFlags flags) |
| bool | isEmpty () const |
| bool | isIdle () const |
| KisSimpleUpdateQueue () | |
| void | optimize () |
| int | overrideLevelOfDetail () const |
| void | processQueue (KisUpdaterContext &updaterContext) |
| qint32 | sizeMetric () const |
| void | updateSettings () |
| virtual | ~KisSimpleUpdateQueue () |
Protected Member Functions | |
| void | addJob (KisNodeSP node, const QVector< QRect > &rects, const QRect &cropRect, int levelOfDetail, KisBaseRectsWalker::UpdateType type, bool dontInvalidateFrames) |
| void | collectJobs (KisBaseRectsWalkerSP &baseWalker, QRect baseRect, const qreal maxAlpha) |
| bool | joinRects (QRect &baseRect, const QRect &newRect, qreal maxAlpha) |
| bool | processOneJob (KisUpdaterContext &updaterContext) |
| bool | tryMergeJob (KisNodeSP node, const QRect &rc, const QRect &cropRect, int levelOfDetail, KisBaseRectsWalker::UpdateType type, bool dontInvalidateFrames) |
| bool | trySplitJob (KisNodeSP node, const QRect &rc, const QRect &cropRect, int levelOfDetail, KisBaseRectsWalker::UpdateType type, bool dontInvalidateFrames) |
Protected Attributes | |
| QMutex | m_lock |
| qreal | m_maxCollectAlpha |
| qreal | m_maxMergeAlpha |
| qreal | m_maxMergeCollectAlpha |
| int | m_overrideLevelOfDetail |
| qint32 | m_patchHeight |
| qint32 | m_patchWidth |
| KisSpontaneousJobsList | m_spontaneousJobsList |
| KisWalkersList | m_updatesList |
Definition at line 23 of file kis_simple_update_queue.h.
| KisSimpleUpdateQueue::KisSimpleUpdateQueue | ( | ) |
Definition at line 44 of file kis_simple_update_queue.cpp.
References updateSettings().
|
virtual |
Definition at line 50 of file kis_simple_update_queue.cpp.
References m_lock, and m_spontaneousJobsList.
| void KisSimpleUpdateQueue::addFullRefreshJob | ( | KisNodeSP | node, |
| const QRect & | rc, | ||
| const QRect & | cropRect, | ||
| int | levelOfDetail ) |
Definition at line 178 of file kis_simple_update_queue.cpp.
References addFullRefreshJob(), and None.
| void KisSimpleUpdateQueue::addFullRefreshJob | ( | KisNodeSP | node, |
| const QVector< QRect > & | rects, | ||
| const QRect & | cropRect, | ||
| int | levelOfDetail, | ||
| KisProjectionUpdateFlags | flags ) |
Definition at line 161 of file kis_simple_update_queue.cpp.
References addJob(), DontInvalidateFrames, KisBaseRectsWalker::FULL_REFRESH, KisBaseRectsWalker::FULL_REFRESH_NO_FILTHY, and NoFilthy.
|
protected |
Definition at line 183 of file kis_simple_update_queue.cpp.
References KisMergeWalker::CLONES_DONT_INVALIDATE_FRAMES, KisRefreshSubtreeWalker::ClonesDontInvalidateFrames, KisBaseRectsWalker::collectRects(), KisMergeWalker::DEFAULT, KisBaseRectsWalker::FULL_REFRESH, KisBaseRectsWalker::FULL_REFRESH_NO_FILTHY, KisBaseRectsWalker::isEmpty(), m_lock, m_updatesList, KisMergeWalker::NO_FILTHY, KisBaseRectsWalker::NoFilthyMode, KisBaseRectsWalker::None, tryMergeJob(), trySplitJob(), KisBaseRectsWalker::UPDATE, and KisBaseRectsWalker::UPDATE_NO_FILTHY.
| void KisSimpleUpdateQueue::addSpontaneousJob | ( | KisSpontaneousJob * | spontaneousJob | ) |
Definition at line 246 of file kis_simple_update_queue.cpp.
References m_lock, m_spontaneousJobsList, and KisSpontaneousJob::overrides().
| void KisSimpleUpdateQueue::addUpdateJob | ( | KisNodeSP | node, |
| const QRect & | rc, | ||
| const QRect & | cropRect, | ||
| int | levelOfDetail ) |
Definition at line 173 of file kis_simple_update_queue.cpp.
References addUpdateJob(), and None.
| void KisSimpleUpdateQueue::addUpdateJob | ( | KisNodeSP | node, |
| const QVector< QRect > & | rects, | ||
| const QRect & | cropRect, | ||
| int | levelOfDetail, | ||
| KisProjectionUpdateFlags | flags ) |
Definition at line 149 of file kis_simple_update_queue.cpp.
References addJob(), DontInvalidateFrames, NoFilthy, KisBaseRectsWalker::UPDATE, and KisBaseRectsWalker::UPDATE_NO_FILTHY.
|
protected |
Definition at line 374 of file kis_simple_update_queue.cpp.
References KisBaseRectsWalker::clonesDontInvalidateFrames(), KisBaseRectsWalker::collectRects(), KisBaseRectsWalker::cropRect(), joinRects(), KisBaseRectsWalker::levelOfDetail(), m_updatesList, KisBaseRectsWalker::requestedRect(), KisBaseRectsWalker::startNode(), and KisBaseRectsWalker::type().
| bool KisSimpleUpdateQueue::isEmpty | ( | ) | const |
Returns true if the update queue is empty, i.e. there are no update or spontaneous jobs pending
Definition at line 267 of file kis_simple_update_queue.cpp.
References m_lock, m_spontaneousJobsList, and m_updatesList.
| bool KisSimpleUpdateQueue::isIdle | ( | ) | const |
Works in the same way as isEmpty(), except that it will not wait on the mutex in case there is any contestion on the queue.
If some other threads are contending on the queue, it will just return false, whatever the state of the queue is.
Definition at line 273 of file kis_simple_update_queue.cpp.
References m_lock, m_spontaneousJobsList, and m_updatesList.
|
protected |
Definition at line 401 of file kis_simple_update_queue.cpp.
References ACCUMULATOR_ADD, ACCUMULATOR_DEBUG, DEBUG_JOIN, DECLARE_ACCUMULATOR, m_patchHeight, and m_patchWidth.
| void KisSimpleUpdateQueue::optimize | ( | ) |
Definition at line 362 of file kis_simple_update_queue.cpp.
References collectJobs(), m_lock, m_maxCollectAlpha, m_updatesList, and KisBaseRectsWalker::requestedRect().
| int KisSimpleUpdateQueue::overrideLevelOfDetail | ( | ) | const |
Definition at line 73 of file kis_simple_update_queue.cpp.
References m_overrideLevelOfDetail.
|
protected |
WARNING: Please note that this still doesn't guarantee that the spontaneous jobs are exclusive, since updates and/or strokes can be added after them. The only thing it guarantees that two spontaneous jobs will not be executed in parallel.
Right now it works as it is. Probably will need to be fixed in the future.
Definition at line 88 of file kis_simple_update_queue.cpp.
References KisUpdaterContext::addMergeJob(), KisUpdaterContext::addSpontaneousJob(), KisBaseRectsWalker::checksumValid(), KisUpdaterContext::currentLevelOfDetail(), KisUpdaterContext::getJobsSnapshot(), KisUpdaterContext::isJobAllowed(), KisBaseRectsWalker::levelOfDetail(), m_lock, m_overrideLevelOfDetail, m_spontaneousJobsList, m_updatesList, KisBaseRectsWalker::recalculate(), and KisBaseRectsWalker::requestedRect().
| void KisSimpleUpdateQueue::processQueue | ( | KisUpdaterContext & | updaterContext | ) |
Definition at line 78 of file kis_simple_update_queue.cpp.
References KisUpdaterContext::hasSpareThread(), KisUpdaterContext::lock(), processOneJob(), and KisUpdaterContext::unlock().
| qint32 KisSimpleUpdateQueue::sizeMetric | ( | ) | const |
Definition at line 280 of file kis_simple_update_queue.cpp.
References m_lock, m_spontaneousJobsList, and m_updatesList.
|
protected |
We add new jobs to the tail of the list, so it's more probable to find a good candidate here.
Definition at line 320 of file kis_simple_update_queue.cpp.
References KisBaseRectsWalker::clonesDontInvalidateFrames(), collectJobs(), KisBaseRectsWalker::cropRect(), joinRects(), KisBaseRectsWalker::levelOfDetail(), m_lock, m_maxMergeAlpha, m_maxMergeCollectAlpha, m_updatesList, KisBaseRectsWalker::requestedRect(), KisBaseRectsWalker::startNode(), and KisBaseRectsWalker::type().
|
protected |
Definition at line 286 of file kis_simple_update_queue.cpp.
References addJob(), KIS_SAFE_ASSERT_RECOVER_NOOP, m_patchHeight, and m_patchWidth.
| void KisSimpleUpdateQueue::updateSettings | ( | ) |
Definition at line 59 of file kis_simple_update_queue.cpp.
References m_lock, m_maxCollectAlpha, m_maxMergeAlpha, m_maxMergeCollectAlpha, m_patchHeight, m_patchWidth, KisImageConfig::maxCollectAlpha(), KisImageConfig::maxMergeAlpha(), KisImageConfig::maxMergeCollectAlpha(), KisImageConfig::updatePatchHeight(), and KisImageConfig::updatePatchWidth().
|
mutableprotected |
Definition at line 80 of file kis_simple_update_queue.h.
|
protected |
Maximum coefficient of work while regular optimization()
Definition at line 100 of file kis_simple_update_queue.h.
|
protected |
Maximum coefficient of work when to rects are considered similar and are merged in tryMergeJob()
Definition at line 106 of file kis_simple_update_queue.h.
|
protected |
The coefficient of work used while collecting phase of tryToMerge()
Definition at line 111 of file kis_simple_update_queue.h.
|
protected |
Definition at line 113 of file kis_simple_update_queue.h.
|
protected |
Definition at line 95 of file kis_simple_update_queue.h.
|
protected |
Parameters of optimization (loaded from a configuration file) Big update areas are split into a set of smaller ones, m_patchWidth and m_patchHeight represent the size of these areas.
Definition at line 94 of file kis_simple_update_queue.h.
|
protected |
Definition at line 82 of file kis_simple_update_queue.h.
|
protected |
Definition at line 81 of file kis_simple_update_queue.h.