diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2017-11-24 13:43:16 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2017-11-27 14:11:56 +0300 |
commit | 37fc23dd9e7738de7187e889f058cda845544ffb (patch) | |
tree | b1423676fcc8f2cc07fdeb8125152e4d7d105b6a /source/blender/editors/render | |
parent | ff9cf0664529db88bd2ea6e13dde6f002054c745 (diff) |
Refactor view3d offscreen drawing to avoid having multiple boolean arguments
This is fully unreadable to have lots of boolean arguments scattered across the
whole argument list. What does `false, true, true` mean in terms of behavior?
Replace those with bitfield which has advantage of having more human readable
meaning.
Diffstat (limited to 'source/blender/editors/render')
-rw-r--r-- | source/blender/editors/render/render_opengl.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/source/blender/editors/render/render_opengl.c b/source/blender/editors/render/render_opengl.c index a27026878e1..a2d34ffefa8 100644 --- a/source/blender/editors/render/render_opengl.c +++ b/source/blender/editors/render/render_opengl.c @@ -353,11 +353,15 @@ static void screen_opengl_render_doit(OGLRender *oglrender, RenderResult *rr) ImBuf *ibuf_view; const int alpha_mode = (draw_sky) ? R_ADDSKY : R_ALPHAPREMUL; + unsigned int draw_flags = V3D_OFSDRAW_NONE; + draw_flags |= (oglrender->ofs_full_samples) ? V3D_OFSDRAW_USE_FULL_SAMPLE : 0; + if (view_context) { + draw_flags |= (draw_bgpic) ? V3D_OFSDRAW_USE_BACKGROUND : 0; + ibuf_view = ED_view3d_draw_offscreen_imbuf( scene, v3d, ar, sizex, sizey, - IB_rect, draw_bgpic, - alpha_mode, oglrender->ofs_samples, oglrender->ofs_full_samples, viewname, + IB_rect, draw_flags, alpha_mode, oglrender->ofs_samples, viewname, oglrender->fx, oglrender->ofs, err_out); /* for stamp only */ @@ -366,10 +370,11 @@ static void screen_opengl_render_doit(OGLRender *oglrender, RenderResult *rr) } } else { + draw_flags |= (V3D_OFSDRAW_USE_GPENCIL | V3D_OFSDRAW_USE_BACKGROUND); ibuf_view = ED_view3d_draw_offscreen_imbuf_simple( scene, scene->camera, oglrender->sizex, oglrender->sizey, - IB_rect, OB_SOLID, false, true, true, - alpha_mode, oglrender->ofs_samples, oglrender->ofs_full_samples, viewname, + IB_rect, draw_flags, OB_SOLID, + alpha_mode, oglrender->ofs_samples, viewname, oglrender->fx, oglrender->ofs, err_out); camera = scene->camera; } |