Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 844b976d authored by Eoin O'Neill's avatar Eoin O'Neill 🍀

Fix Crash on Frame Priority Caching when Graphics Acceleration is Disabled.

Additional measures had to be taken to ensure that the frame cache exists before
requesting frame regeneration. Additionally, frame cache priority will also
ensure that the user wants background caching before attempting to prioritize
specific frames.

BUG:424037
(cherry picked from krita/4.3 commit 82c952ffbbb295720bc903ec8ab683d13a6bcddb)
parent adc8c597
......@@ -292,7 +292,9 @@ KisAnimationCachePopulator::KisAnimationCachePopulator(KisPart *part)
}
KisAnimationCachePopulator::~KisAnimationCachePopulator()
{}
{
m_d->priorityFrames.clear();
}
bool KisAnimationCachePopulator::regenerate(KisAnimationFrameCacheSP cache, int frame)
{
......@@ -301,6 +303,8 @@ bool KisAnimationCachePopulator::regenerate(KisAnimationFrameCacheSP cache, int
void KisAnimationCachePopulator::requestRegenerationWithPriorityFrame(KisImageSP image, int frameIndex)
{
if (!m_d->calculateAnimationCacheInBackground) return;
m_d->priorityFrames.append(qMakePair(image, frameIndex));
if (m_d->state == Private::NotWaitingForAnything) {
......
......@@ -423,10 +423,13 @@ void KisTimeBasedItemModel::slotInternalScrubPreviewRequested(int time)
void KisTimeBasedItemModel::setScrubState(bool active)
{
if (!m_d->scrubInProgress && active) {
const int currentFrame = m_d->image->animationInterface()->currentUITime();
const bool hasCurrentFrameInCache = m_d->framesCache->frameStatus(currentFrame) == KisAnimationFrameCache::Cached;
if(!hasCurrentFrameInCache) {
KisPart::instance()->prioritizeFrameForCache(m_d->image, currentFrame);
if (m_d->framesCache) {
const int currentFrame = m_d->image->animationInterface()->currentUITime();
const bool hasCurrentFrameInCache = m_d->framesCache->frameStatus(currentFrame) == KisAnimationFrameCache::Cached;
if(!hasCurrentFrameInCache) {
KisPart::instance()->prioritizeFrameForCache(m_d->image, currentFrame);
}
}
m_d->scrubStartFrame = m_d->activeFrameIndex;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment