ImBuf *BKE_sequencer_preprocessed_cache_get(const SeqRenderData *context, Sequence *seq, float cfra, seq_stripelem_ibuf_t type) { SeqPreprocessCacheElem *elem; if (!preprocess_cache) return NULL; if (preprocess_cache->cfra != cfra) return NULL; for (elem = preprocess_cache->elems.first; elem; elem = elem->next) { if (elem->seq != seq) continue; if (elem->type != type) continue; if (seq_cmp_render_data(&elem->context, context) != 0) continue; IMB_refImBuf(elem->ibuf); return elem->ibuf; } return NULL; }
static int HashCmp(const void *a_, const void *b_) { const seqCacheKey * a = (seqCacheKey*) a_; const seqCacheKey * b = (seqCacheKey*) b_; if (a->seq < b->seq) { return -1; } if (a->seq > b->seq) { return 1; } if (a->cfra < b->cfra) { return -1; } if (a->cfra > b->cfra) { return 1; } if (a->type < b->type) { return -1; } if (a->type > b->type) { return 1; } return seq_cmp_render_data(&a->context, &b->context); }
static bool seqcache_hashcmp(const void *a_, const void *b_) { const SeqCacheKey *a = (SeqCacheKey *) a_; const SeqCacheKey *b = (SeqCacheKey *) b_; return ((a->seq != b->seq) || (a->cfra != b->cfra) || (a->type != b->type) || seq_cmp_render_data(&a->context, &b->context)); }