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:
authorCampbell Barton <ideasman42@gmail.com>2011-07-05 11:46:25 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-07-05 11:46:25 +0400
commit61fc8392006c54bce2469616487e5f8fd5062456 (patch)
treeaa800cd64848bf6c593d060b3c307e6b7e75899c /source/blender/editors/render/render_opengl.c
parentdb2d737f0e646a49671f7645f22f24cf1cb28a7a (diff)
fix [#27862] OpenGL render animation don't respect .png RGB option.
Diffstat (limited to 'source/blender/editors/render/render_opengl.c')
-rw-r--r--source/blender/editors/render/render_opengl.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/source/blender/editors/render/render_opengl.c b/source/blender/editors/render/render_opengl.c
index a55f9101a0f..3256112426b 100644
--- a/source/blender/editors/render/render_opengl.c
+++ b/source/blender/editors/render/render_opengl.c
@@ -438,8 +438,6 @@ static int screen_opengl_render_anim_step(bContext *C, wmOperator *op)
ibuf= BKE_image_acquire_ibuf(oglrender->ima, &oglrender->iuser, &lock);
if(ibuf) {
- short ibuf_free= FALSE;
-
/* color -> greyscale */
/* editing directly would alter the render view */
if(scene->r.planes == 8) {
@@ -447,8 +445,15 @@ static int screen_opengl_render_anim_step(bContext *C, wmOperator *op)
IMB_color_to_bw(ibuf_bw);
// IMB_freeImBuf(ibuf); /* owned by the image */
ibuf= ibuf_bw;
-
- ibuf_free= TRUE;
+ }
+ else {
+ /* this is lightweight & doesnt re-alloc the buffers, only do this
+ * to save the correct bit depth since the image is always RGBA */
+ ImBuf *ibuf_cpy= IMB_allocImBuf(ibuf->x, ibuf->y, scene->r.planes, 0);
+ ibuf_cpy->rect= ibuf->rect;
+ ibuf_cpy->rect_float= ibuf->rect_float;
+ ibuf_cpy->zbuf_float= ibuf->zbuf_float;
+ ibuf= ibuf_cpy;
}
if(BKE_imtype_is_movie(scene->r.imtype)) {
@@ -472,9 +477,8 @@ static int screen_opengl_render_anim_step(bContext *C, wmOperator *op)
}
}
- if(ibuf_free) {
- IMB_freeImBuf(ibuf);
- }
+ /* imbuf knows which rects are not part of ibuf */
+ IMB_freeImBuf(ibuf);
}
BKE_image_release_ibuf(oglrender->ima, lock);