Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/seqcache.c
| Show First 20 Lines • Show All 1,211 Lines • ▼ Show 20 Lines | void BKE_sequencer_cache_cleanup_sequence(Scene *scene, | ||||
| } | } | ||||
| cache->last_key = NULL; | cache->last_key = NULL; | ||||
| seq_cache_unlock(scene); | seq_cache_unlock(scene); | ||||
| } | } | ||||
| struct ImBuf *BKE_sequencer_cache_get( | struct ImBuf *BKE_sequencer_cache_get( | ||||
| const SeqRenderData *context, Sequence *seq, float cfra, int type, bool skip_disk_cache) | const SeqRenderData *context, Sequence *seq, float cfra, int type, bool skip_disk_cache) | ||||
| { | { | ||||
| if (context->skip_cache || context->is_proxy_render || !seq) { | |||||
| return NULL; | |||||
| } | |||||
| Scene *scene = context->scene; | Scene *scene = context->scene; | ||||
| if (context->is_prefetch_render) { | if (context->is_prefetch_render) { | ||||
| context = BKE_sequencer_prefetch_get_original_context(context); | context = BKE_sequencer_prefetch_get_original_context(context); | ||||
| scene = context->scene; | scene = context->scene; | ||||
| seq = BKE_sequencer_prefetch_get_original_sequence(seq, scene); | seq = BKE_sequencer_prefetch_get_original_sequence(seq, scene); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 81 Lines • ▼ Show 20 Lines | |||||
| void BKE_sequencer_cache_put(const SeqRenderData *context, | void BKE_sequencer_cache_put(const SeqRenderData *context, | ||||
| Sequence *seq, | Sequence *seq, | ||||
| float cfra, | float cfra, | ||||
| int type, | int type, | ||||
| ImBuf *i, | ImBuf *i, | ||||
| float cost, | float cost, | ||||
| bool skip_disk_cache) | bool skip_disk_cache) | ||||
| { | { | ||||
| if (i == NULL || context->skip_cache || context->is_proxy_render || !seq) { | |||||
| return; | |||||
| } | |||||
| Scene *scene = context->scene; | Scene *scene = context->scene; | ||||
| if (context->is_prefetch_render) { | if (context->is_prefetch_render) { | ||||
| context = BKE_sequencer_prefetch_get_original_context(context); | context = BKE_sequencer_prefetch_get_original_context(context); | ||||
| scene = context->scene; | scene = context->scene; | ||||
| seq = BKE_sequencer_prefetch_get_original_sequence(seq, scene); | seq = BKE_sequencer_prefetch_get_original_sequence(seq, scene); | ||||
| } | } | ||||
| if (i == NULL || context->skip_cache || context->is_proxy_render || !seq) { | |||||
| return; | |||||
| } | |||||
| /* Prevent reinserting, it breaks cache key linking. */ | /* Prevent reinserting, it breaks cache key linking. */ | ||||
| ImBuf *test = BKE_sequencer_cache_get(context, seq, cfra, type, true); | ImBuf *test = BKE_sequencer_cache_get(context, seq, cfra, type, true); | ||||
| if (test) { | if (test) { | ||||
| IMB_freeImBuf(test); | IMB_freeImBuf(test); | ||||
| return; | return; | ||||
| } | } | ||||
| if (!scene->ed->cache) { | if (!scene->ed->cache) { | ||||
| ▲ Show 20 Lines • Show All 116 Lines • Show Last 20 Lines | |||||