Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChad Fraleigh <chadf@triularity.org>2016-07-14 15:15:43 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2016-07-14 15:17:54 +0300
commit17e40f821e56ec1fc07a4e707d9b86fa8b0a2bda (patch)
treec342c588354dbd344c519983eb803f61e617a3a3 /source/blender/blenkernel/intern/seqeffects.c
parent3a5eff95c59fdf1f2817e5e3ffe7b7f3609d031a (diff)
Consolidate multiple checks for out->rect_float in prepare_effect_imbufs()
Many checks for out->rect_float being [non-]NULL are done back-to-back. Combining them into a single check for slightly more efficient code and less code clutter for easier readability/understanding. Differential Revision: https://developer.blender.org/D2097
Diffstat (limited to 'source/blender/blenkernel/intern/seqeffects.c')
-rw-r--r--source/blender/blenkernel/intern/seqeffects.c44
1 files changed, 25 insertions, 19 deletions
diff --git a/source/blender/blenkernel/intern/seqeffects.c b/source/blender/blenkernel/intern/seqeffects.c
index 3de4a426973..ce7c520438a 100644
--- a/source/blender/blenkernel/intern/seqeffects.c
+++ b/source/blender/blenkernel/intern/seqeffects.c
@@ -123,28 +123,34 @@ static ImBuf *prepare_effect_imbufs(const SeqRenderData *context, ImBuf *ibuf1,
out = IMB_allocImBuf(x, y, 32, IB_rect);
}
- if (ibuf1 && !ibuf1->rect_float && out->rect_float) {
- BKE_sequencer_imbuf_to_sequencer_space(scene, ibuf1, true);
- }
- if (ibuf2 && !ibuf2->rect_float && out->rect_float) {
- BKE_sequencer_imbuf_to_sequencer_space(scene, ibuf2, true);
- }
- if (ibuf3 && !ibuf3->rect_float && out->rect_float) {
- BKE_sequencer_imbuf_to_sequencer_space(scene, ibuf3, true);
- }
+ if (out->rect_float) {
+ if (ibuf1 && !ibuf1->rect_float) {
+ BKE_sequencer_imbuf_to_sequencer_space(scene, ibuf1, true);
+ }
+
+ if (ibuf2 && !ibuf2->rect_float) {
+ BKE_sequencer_imbuf_to_sequencer_space(scene, ibuf2, true);
+ }
+
+ if (ibuf3 && !ibuf3->rect_float) {
+ BKE_sequencer_imbuf_to_sequencer_space(scene, ibuf3, true);
+ }
- if (ibuf1 && !ibuf1->rect && !out->rect_float) {
- IMB_rect_from_float(ibuf1);
- }
- if (ibuf2 && !ibuf2->rect && !out->rect_float) {
- IMB_rect_from_float(ibuf2);
- }
- if (ibuf3 && !ibuf3->rect && !out->rect_float) {
- IMB_rect_from_float(ibuf3);
+ IMB_colormanagement_assign_float_colorspace(out, scene->sequencer_colorspace_settings.name);
}
+ else {
+ if (ibuf1 && !ibuf1->rect) {
+ IMB_rect_from_float(ibuf1);
+ }
- if (out->rect_float)
- IMB_colormanagement_assign_float_colorspace(out, scene->sequencer_colorspace_settings.name);
+ if (ibuf2 && !ibuf2->rect) {
+ IMB_rect_from_float(ibuf2);
+ }
+
+ if (ibuf3 && !ibuf3->rect) {
+ IMB_rect_from_float(ibuf3);
+ }
+ }
/* If effect only affecting a single channel, forward input's metadata to the output. */
if (ibuf1 != NULL && ibuf1 == ibuf2 && ibuf2 == ibuf3) {