|
Krita Source Code Documentation
|
Public Types | |
| enum | RegenerationRequestResult { RequestSuccessful = 0 , RequestRejected , RequestPostponed } |
| enum | State { NotWaitingForAnything , WaitingForIdle , WaitingForFrame , BetweenFrames } |
Public Member Functions | |
| QString | debugStateToString (State newState) |
| void | enterState (State newState) |
| void | generateIfIdle () |
| Private (KisAnimationCachePopulator *_q, KisPart *_part) | |
| RegenerationRequestResult | regenerate (KisAnimationFrameCacheSP cache, int frame) |
| void | timerTimeout () |
| RegenerationRequestResult | tryRequestGeneration () |
| RegenerationRequestResult | tryRequestGeneration (KisAnimationFrameCacheSP cache, KisTimeSpan skipRange, int priorityFrame) |
Public Attributes | |
| bool | calculateAnimationCacheInBackground = true |
| int | idleCounter |
| KisPart * | part |
| QStack< QPair< KisImageWSP, int > > | priorityFrames |
| KisAnimationCachePopulator * | q |
| KisAsyncAnimationCacheRenderer | regenerator |
| State | state |
| QTimer | timer |
Static Public Attributes | |
| static const int | BETWEEN_FRAMES_INTERVAL = 10 |
| static const int | IDLE_CHECK_INTERVAL = 500 |
| static const int | IDLE_COUNT_THRESHOLD = 4 |
Definition at line 36 of file kis_animation_cache_populator.cpp.
| Enumerator | |
|---|---|
| RequestSuccessful | |
| RequestRejected | |
| RequestPostponed | |
Definition at line 63 of file kis_animation_cache_populator.cpp.
| Enumerator | |
|---|---|
| NotWaitingForAnything | |
| WaitingForIdle | |
| WaitingForFrame | |
| BetweenFrames | |
Definition at line 55 of file kis_animation_cache_populator.cpp.
|
inline |
Definition at line 69 of file kis_animation_cache_populator.cpp.
References timer.
|
inline |
Definition at line 282 of file kis_animation_cache_populator.cpp.
References BetweenFrames, NotWaitingForAnything, WaitingForFrame, and WaitingForIdle.
Definition at line 303 of file kis_animation_cache_populator.cpp.
References BETWEEN_FRAMES_INTERVAL, BetweenFrames, IDLE_CHECK_INTERVAL, NotWaitingForAnything, state, timer, timerTimeout(), WaitingForFrame, and WaitingForIdle.
|
inline |
Definition at line 94 of file kis_animation_cache_populator.cpp.
References enterState(), IDLE_COUNT_THRESHOLD, idleCounter, KisPart::idleWatcher, KisIdleWatcher::isIdle(), NotWaitingForAnything, part, RequestPostponed, RequestRejected, tryRequestGeneration(), and WaitingForIdle.
|
inline |
We should enter the state before the frame is requested. Otherwise the signal may come earlier than we enter it.
Definition at line 253 of file kis_animation_cache_populator.cpp.
References KisImage::animationInterface(), KisAsyncAnimationRendererBase::Cancellable, enterState(), KisAnimationFrameCache::image(), regenerator, RequestPostponed, RequestRejected, RequestSuccessful, KisAsyncAnimationCacheRenderer::setFrameCache(), KisAsyncAnimationRendererBase::startFrameRegeneration(), state, and WaitingForFrame.
|
inline |
Definition at line 79 of file kis_animation_cache_populator.cpp.
References BetweenFrames, generateIfIdle(), KIS_ASSERT_RECOVER_NOOP, NotWaitingForAnything, state, WaitingForFrame, and WaitingForIdle.
|
inline |
We have just upgraded the image pointer to the strong pointer, let's check if it is still valid.
It may happen that the view (and the canvas) of this image has already been removed. Hence the cache does not exist anymore. So we should just skip this stinking image.
The frame got cached in the meantime, so skip its recalculation
Definition at line 118 of file kis_animation_cache_populator.cpp.
References KisNodeManager::activeNode(), KisMainWindow::activeView, KisKeyframeChannel::affectedFrames(), KisImage::animationInterface(), KisImageAnimationInterface::backgroundFrameGenerationBlocked(), KisAnimationFrameCache::Cached, KisAnimationFrameCache::cacheForImage(), KisAnimationFrameCache::caches(), KisCanvas2::currentImage(), KisPart::currentMainwindow(), KisImageAnimationInterface::currentUITime(), KisSharedPtr< T >::data(), KisCanvas2::frameCache, KisAnimationFrameCache::frameStatus(), KisImageAnimationInterface::hasAnimation(), KisAnimationFrameCache::image(), KisCanvas2::image(), KisTimeSpan::infinite(), KisPart::instance(), KisBaseNode::keyframeChannels, KIS_SAFE_ASSERT_RECOVER, KisViewManager::nodeManager(), part, priorityFrames, RequestRejected, RequestSuccessful, tryRequestGeneration(), KisCanvas2::viewManager(), and KisPart::views.
|
inline |
Definition at line 227 of file kis_animation_cache_populator.cpp.
References KisImage::animationInterface(), KisImageAnimationInterface::backgroundFrameGenerationBlocked(), KisAsyncAnimationCacheRenderDialog::calcFirstDirtyFrame(), KisImageAnimationInterface::documentPlaybackRange(), KisImageAnimationInterface::hasAnimation(), KisAnimationFrameCache::image(), KIS_SAFE_ASSERT_RECOVER_RETURN_VALUE, regenerate(), RequestPostponed, and RequestRejected.
|
static |
Definition at line 50 of file kis_animation_cache_populator.cpp.
| bool KisAnimationCachePopulator::Private::calculateAnimationCacheInBackground = true |
Definition at line 53 of file kis_animation_cache_populator.cpp.
|
static |
Definition at line 49 of file kis_animation_cache_populator.cpp.
|
static |
Definition at line 48 of file kis_animation_cache_populator.cpp.
| int KisAnimationCachePopulator::Private::idleCounter |
Counts up the number of subsequent times Krita has been detected idle.
Definition at line 46 of file kis_animation_cache_populator.cpp.
| KisPart* KisAnimationCachePopulator::Private::part |
Definition at line 39 of file kis_animation_cache_populator.cpp.
| QStack<QPair<KisImageWSP, int> > KisAnimationCachePopulator::Private::priorityFrames |
Definition at line 47 of file kis_animation_cache_populator.cpp.
| KisAnimationCachePopulator* KisAnimationCachePopulator::Private::q |
Definition at line 38 of file kis_animation_cache_populator.cpp.
| KisAsyncAnimationCacheRenderer KisAnimationCachePopulator::Private::regenerator |
Definition at line 52 of file kis_animation_cache_populator.cpp.
| State KisAnimationCachePopulator::Private::state |
Definition at line 61 of file kis_animation_cache_populator.cpp.
| QTimer KisAnimationCachePopulator::Private::timer |
Definition at line 41 of file kis_animation_cache_populator.cpp.