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:
authorMatt Ebb <matt@mke3.net>2007-05-31 11:33:18 +0400
committerMatt Ebb <matt@mke3.net>2007-05-31 11:33:18 +0400
commit270ab2fe18889616355a6c69e1905c32cf11df7f (patch)
tree2a9a504c31ef4f929732116b41ffc767160733e0 /source/blender/nodes/intern/CMP_nodes/CMP_invert.c
parent17a219e3c0af09d682179f3e087472dbd27b6540 (diff)
Fix for invert comp node, was allocating a compbuf unnecessarily.
Diffstat (limited to 'source/blender/nodes/intern/CMP_nodes/CMP_invert.c')
-rw-r--r--source/blender/nodes/intern/CMP_nodes/CMP_invert.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_invert.c b/source/blender/nodes/intern/CMP_nodes/CMP_invert.c
index 4bc026302dd..1d4be2bc09f 100644
--- a/source/blender/nodes/intern/CMP_nodes/CMP_invert.c
+++ b/source/blender/nodes/intern/CMP_nodes/CMP_invert.c
@@ -90,19 +90,22 @@ static void node_composit_exec_invert(void *data, bNode *node, bNodeStack **in,
else {
/* make output size of first available input image, or then size of fac */
CompBuf *cbuf= in[1]->data?in[1]->data:in[0]->data;
- CompBuf *stackbuf= alloc_compbuf(cbuf->x, cbuf->y, CB_RGBA, 1); /* allocs */
-
+
/* if neither RGB or A toggled on, pass through */
- if (node->custom1 == 0) {
+ if (node->custom1 != 0) {
+ CompBuf *stackbuf= alloc_compbuf(cbuf->x, cbuf->y, CB_RGBA, 1); /* allocs */
+
+ if (fac[0] < 1.0f || in[0]->data!=NULL)
+ composit2_pixel_processor(node, stackbuf, in[1]->data, in[1]->vec, in[0]->data, fac, do_invert_fac, CB_RGBA, CB_VAL);
+ else
+ composit1_pixel_processor(node, stackbuf, in[1]->data, in[1]->vec, do_invert, CB_RGBA);
+ out[0]->data= stackbuf;
+ return;
+
+ } else {
out[0]->data = pass_on_compbuf(cbuf);
return;
}
-
- if (fac[0] < 1.0f || in[0]->data!=NULL)
- composit2_pixel_processor(node, stackbuf, in[1]->data, in[1]->vec, in[0]->data, fac, do_invert_fac, CB_RGBA, CB_VAL);
- else
- composit1_pixel_processor(node, stackbuf, in[1]->data, in[1]->vec, do_invert, CB_RGBA);
- out[0]->data= stackbuf;
}
}