Krita Source Code Documentation
Loading...
Searching...
No Matches
KisOnionSkinCache::Private Struct Reference

Public Member Functions

bool checkCacheValid (KisPaintDeviceSP source, KisOnionSkinCompositor *compositor)
 
void updateCacheMetrics (KisPaintDeviceSP source, KisOnionSkinCompositor *compositor)
 

Public Attributes

int cacheConfigSeqNo = 0
 
KisPaintDeviceSP cachedProjection
 
int cacheTime = 0
 
int framesHash = 0
 
QReadWriteLock lock
 

Detailed Description

Definition at line 24 of file kis_onion_skin_cache.cpp.

Member Function Documentation

◆ checkCacheValid()

bool KisOnionSkinCache::Private::checkCacheValid ( KisPaintDeviceSP source,
KisOnionSkinCompositor * compositor )
inline

Definition at line 33 of file kis_onion_skin_cache.cpp.

33 {
34 const KisRasterKeyframeChannel *keyframes = source->keyframeChannel();
35
36 const int time = source->defaultBounds()->currentTime();
37 const KisTimeSpan span = source->keyframeChannel()->identicalFrames(cacheTime);
38 const int seqNo = compositor->configSeqNo();
39 const int hash = keyframes->channelHash();
40
41 return span.contains(time) && cacheConfigSeqNo == seqNo && framesHash == hash;
42 }
KisMagneticGraph::vertex_descriptor source(typename KisMagneticGraph::edge_descriptor e, KisMagneticGraph g)
int channelHash() const
Calculates a pseudo-unique hash based on the relevant internal state of the channel.
The KisRasterKeyframeChannel is a concrete KisKeyframeChannel subclass that stores and manages KisRas...
bool contains(int time) const

References cacheConfigSeqNo, cacheTime, KisKeyframeChannel::channelHash(), KisOnionSkinCompositor::configSeqNo(), KisTimeSpan::contains(), framesHash, and source().

◆ updateCacheMetrics()

void KisOnionSkinCache::Private::updateCacheMetrics ( KisPaintDeviceSP source,
KisOnionSkinCompositor * compositor )
inline

Definition at line 44 of file kis_onion_skin_cache.cpp.

44 {
45 const KisRasterKeyframeChannel *keyframes = source->keyframeChannel();
46
47 const int time = source->defaultBounds()->currentTime();
48 const int seqNo = compositor->configSeqNo();
49 const int hash = keyframes->channelHash();
50
51 cacheTime = time;
52 cacheConfigSeqNo = seqNo;
53 framesHash = hash;
54 }

References cacheConfigSeqNo, cacheTime, KisKeyframeChannel::channelHash(), KisOnionSkinCompositor::configSeqNo(), framesHash, and source().

Member Data Documentation

◆ cacheConfigSeqNo

int KisOnionSkinCache::Private::cacheConfigSeqNo = 0

Definition at line 29 of file kis_onion_skin_cache.cpp.

◆ cachedProjection

KisPaintDeviceSP KisOnionSkinCache::Private::cachedProjection

Definition at line 26 of file kis_onion_skin_cache.cpp.

◆ cacheTime

int KisOnionSkinCache::Private::cacheTime = 0

Definition at line 28 of file kis_onion_skin_cache.cpp.

◆ framesHash

int KisOnionSkinCache::Private::framesHash = 0

Definition at line 30 of file kis_onion_skin_cache.cpp.

◆ lock

QReadWriteLock KisOnionSkinCache::Private::lock

Definition at line 31 of file kis_onion_skin_cache.cpp.


The documentation for this struct was generated from the following file: