76 timer.setSingleShot(
true);
89 KIS_ASSERT_RECOVER_NOOP(0 &&
"NotWaitingForAnything cannot have a timeout. Just skip this message and report a bug");
129 if (!image)
continue;
143 auto it = std::find_if(views.constBegin(), views.constEnd(),
145 return view && KisImageSP(view->image()) == image;
147 const bool foundExistingViewForImage = it != views.constEnd();
152 [image] (
auto requestPair) {
153 return KisImageSP(requestPair.first) == image;
176 if (activeWindow && activeWindow->
activeView()) {
179 if (activeCanvas && activeCanvas->
frameCache() &&
182 activeDocumentCache = activeCanvas->
frameCache();
208 Q_FOREACH (cache, caches) {
209 if (cache == activeDocumentCache.
data()) {
262 if (!lock.owns_lock()) {
283 QString str =
"<unknown>";
287 str =
"WaitingForIdle";
290 str =
"WaitingForFrame";
293 str =
"NotWaitingForAnything";
296 str =
"BetweenFrames";
350 m_d->priorityFrames.clear();
355 return m_d->regenerate(cache, frame);
360 if (!
m_d->calculateAnimationCacheInBackground)
return;
364 m_d->priorityFrames.append(qMakePair(image, frameIndex));
367 m_d->generateIfIdle();
379 if (!
m_d->calculateAnimationCacheInBackground)
return;
quint64 part(quint64 n1, quint64 n2, int p)
connect(this, SIGNAL(optionsChanged()), this, SLOT(saveOptions()))
void slotRequestRegeneration()
KisAnimationCachePopulator(KisPart *part)
~KisAnimationCachePopulator() override
void requestRegenerationWithPriorityFrame(KisImageSP image, int frameIndex)
QScopedPointer< Private > m_d
void slotRegeneratorFrameCancelled()
bool regenerate(KisAnimationFrameCacheSP cache, int frame)
void slotRegeneratorFrameReady()
static const QList< KisAnimationFrameCache * > caches()
CacheStatus frameStatus(int time) const
static const KisAnimationFrameCacheSP cacheForImage(KisImageWSP image)
static int calcFirstDirtyFrame(KisAnimationFrameCacheSP cache, const KisTimeSpan &playbackRange, const KisTimeSpan &skipRange)
void setFrameCache(KisAnimationFrameCacheSP cache)
KisAnimationFrameCacheSP frameCache
KisImageWSP currentImage() const
KisImageWSP image() const
KisViewManager * viewManager() const
static KisConfigNotifier * instance()
bool calculateAnimationCacheInBackground(bool defaultValue=false) const
int currentUITime() const
const KisTimeSpan & documentPlaybackRange() const
documentPlaybackRange
bool hasAnimation() const
bool backgroundFrameGenerationBlocked() const
KisImageAnimationInterface * animationInterface() const
KisKeyframeChannel stores and manages KisKeyframes. Maps units of time to virtual keyframe values....
virtual KisTimeSpan affectedFrames(int time) const
Get the set of frames affected by any changes to the value or content of the active keyframe at the g...
QPointer< KisView > activeView
KisNodeSP activeNode()
Convenience function to get the active layer or mask.
static KisPart * instance()
KisMainWindow * currentMainwindow() const
KisIdleWatcher idleWatcher
QList< QPointer< KisView > > views
static KisTimeSpan infinite(int start)
KisNodeManager * nodeManager() const
The node manager handles everything about nodes.
#define KIS_SAFE_ASSERT_RECOVER(cond)
#define KIS_SAFE_ASSERT_RECOVER_RETURN_VALUE(cond, val)
#define KIS_ASSERT_RECOVER_RETURN(cond)
#define KIS_ASSERT_RECOVER_NOOP(cond)
KisSharedPtr< KisAnimationFrameCache > KisAnimationFrameCacheSP
RegenerationRequestResult tryRequestGeneration(KisAnimationFrameCacheSP cache, KisTimeSpan skipRange, int priorityFrame)
static const int IDLE_COUNT_THRESHOLD
QStack< QPair< KisImageWSP, int > > priorityFrames
static const int BETWEEN_FRAMES_INTERVAL
static const int IDLE_CHECK_INTERVAL
KisAsyncAnimationCacheRenderer regenerator
RegenerationRequestResult regenerate(KisAnimationFrameCacheSP cache, int frame)
RegenerationRequestResult tryRequestGeneration()
void enterState(State newState)
KisAnimationCachePopulator * q
QString debugStateToString(State newState)
RegenerationRequestResult
bool calculateAnimationCacheInBackground
Private(KisAnimationCachePopulator *_q, KisPart *_part)
void startFrameRegeneration(KisImageSP image, int frame, const KisRegion ®ionOfInterest, Flags flags, KisLockFrameGenerationLock &&frameGenerationLock)
QMap< QString, KisKeyframeChannel * > keyframeChannels