diff options
author | Brecht Van Lommel <brecht@blender.org> | 2022-07-14 21:16:34 +0300 |
---|---|---|
committer | Brecht Van Lommel <brecht@blender.org> | 2022-07-15 14:40:04 +0300 |
commit | 9ea1b88f0f01a617f452d5eaa44ecbebbaa95c4e (patch) | |
tree | 87dd1c363d2e8ea17178559b6df61bf9d54fbe13 /source/blender/editors/render/render_opengl.cc | |
parent | b8ffd43bd28ff93c5420d8a50c2cde5a061be118 (diff) |
Cleanup: add utlity function to compute render resolution
Instead of duplicating logic many times.
Diffstat (limited to 'source/blender/editors/render/render_opengl.cc')
-rw-r--r-- | source/blender/editors/render/render_opengl.cc | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/source/blender/editors/render/render_opengl.cc b/source/blender/editors/render/render_opengl.cc index 7bd9812a178..77ad23f1e3f 100644 --- a/source/blender/editors/render/render_opengl.cc +++ b/source/blender/editors/render/render_opengl.cc @@ -758,8 +758,7 @@ static bool screen_opengl_render_init(bContext *C, wmOperator *op) WM_jobs_kill_all_except(wm, CTX_wm_screen(C)); /* create offscreen buffer */ - sizex = (scene->r.size * scene->r.xsch) / 100; - sizey = (scene->r.size * scene->r.ysch) / 100; + BKE_render_resolution(&scene->r, false, &sizex, &sizey); /* corrects render size with actual size, not every card supports non-power-of-two dimensions */ DRW_opengl_context_enable(); /* Off-screen creation needs to be done in DRW context. */ |