Krita Source Code Documentation
Loading...
Searching...
No Matches
KisAsyncAnimationCacheRenderer.cpp
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2017 Dmitry Kazakov <dimula73@gmail.com>
3 *
4 * SPDX-License-Identifier: GPL-2.0-or-later
5 */
6
8
10#include "kis_update_info.h"
11
17
18
24
28
30{
31 m_d->requestedCache = cache;
32}
33
35{
36 KisAnimationFrameCacheSP cache = m_d->requestedCache;
37 KisImageSP image = requestedImage();
38 if (!cache || !image) return;
39
40 m_d->requestInfo = cache->fetchFrameData(frame, image, requestedRegion);
42}
43
45{
46 if (!isActive()) return;
47
48 KIS_SAFE_ASSERT_RECOVER(m_d->requestInfo) {
50 return;
51 }
52
53 KisAnimationFrameCacheSP cache = m_d->requestedCache;
54 if (!cache) {
56 return;
57 }
58
59 cache->addConvertedFrameData(m_d->requestInfo, frame);
61}
62
63
65{
66 notifyFrameCancelled(frame, cancelReason);
67}
68
70{
71 m_d->requestInfo.clear();
72 m_d->requestedCache = nullptr; // TODO: implement clear() for weak pointers
73
75}
76
77
connect(this, SIGNAL(optionsChanged()), this, SLOT(saveOptions()))
KisOpenGLUpdateInfoSP fetchFrameData(int time, KisImageSP image, const KisRegion &requestedRegion) const
void addConvertedFrameData(KisOpenGLUpdateInfoSP info, int time)
void setFrameCache(KisAnimationFrameCacheSP cache)
void frameCompletedCallback(int frame, const KisRegion &requestedRegion) override
frameCompletedCallback is called by the renderer when a new frame becomes ready
void frameCancelledCallback(int frame, CancelReason cancelReason) override
frameCancelledCallback is called when the rendering of the frame was cancelled.
void clearFrameRegenerationState(bool isCancelled) override
void sigCompleteRegenerationInternal(int frame)
#define KIS_SAFE_ASSERT_RECOVER(cond)
Definition kis_assert.h:126
void notifyFrameCancelled(int frame, KisAsyncAnimationRendererBase::CancelReason cancelReason)
virtual void clearFrameRegenerationState(bool isCancelled)