diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2020-08-16 02:49:52 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2020-08-18 22:30:10 +0300 |
commit | 0f292dc07265db181bd3ec13f12c48fee755f5b5 (patch) | |
tree | a8ecaf5a361103173273b471a3339efc17010794 /source/blender/editors/interface | |
parent | c78ea96528168760382f919b8cb6251d3faac683 (diff) |
Cleanup: GPUState: remove float variant of GPU_scissor_get
Diffstat (limited to 'source/blender/editors/interface')
-rw-r--r-- | source/blender/editors/interface/interface_draw.c | 37 |
1 files changed, 22 insertions, 15 deletions
diff --git a/source/blender/editors/interface/interface_draw.c b/source/blender/editors/interface/interface_draw.c index fb09320a0f2..0a40c39851a 100644 --- a/source/blender/editors/interface/interface_draw.c +++ b/source/blender/editors/interface/interface_draw.c @@ -748,7 +748,7 @@ void ui_draw_but_IMAGE(ARegion *UNUSED(region), # if 0 /* prevent drawing outside widget area */ int scissor[4]; - GPU_scissor_get_i(scissor); + GPU_scissor_get(scissor); GPU_scissor(rect->xmin, rect->ymin, w, h); # endif @@ -830,11 +830,8 @@ void UI_draw_safe_areas(uint pos, } } -static void draw_scope_end(const rctf *rect, GLint *scissor) +static void draw_scope_end(const rctf *rect) { - /* Restore scissor test. */ - GPU_scissor(scissor[0], scissor[1], scissor[2], scissor[3]); - GPU_blend_set_func_separate( GPU_SRC_ALPHA, GPU_ONE_MINUS_SRC_ALPHA, GPU_ONE, GPU_ONE_MINUS_SRC_ALPHA); @@ -942,7 +939,7 @@ void ui_draw_but_HISTOGRAM(ARegion *UNUSED(region), /* need scissor test, histogram can draw outside of boundary */ int scissor[4]; - GPU_scissor_get_i(scissor); + GPU_scissor_get(scissor); GPU_scissor((rect.xmin - 1), (rect.ymin - 1), (rect.xmax + 1) - (rect.xmin - 1), @@ -999,8 +996,11 @@ void ui_draw_but_HISTOGRAM(ARegion *UNUSED(region), immUnbindProgram(); + /* Restore scissor test. */ + GPU_scissor(UNPACK4(scissor)); + /* outline */ - draw_scope_end(&rect, scissor); + draw_scope_end(&rect); } #undef HISTOGRAM_TOT_GRID_LINES @@ -1082,7 +1082,7 @@ void ui_draw_but_WAVEFORM(ARegion *UNUSED(region), true, rect.xmin - 1, rect.ymin - 1, rect.xmax + 1, rect.ymax + 1, 3.0f, color); /* need scissor test, waveform can draw outside of boundary */ - GPU_scissor_get_i(scissor); + GPU_scissor_get(scissor); GPU_scissor((rect.xmin - 1), (rect.ymin - 1), (rect.xmax + 1) - (rect.xmin - 1), @@ -1257,8 +1257,11 @@ void ui_draw_but_WAVEFORM(ARegion *UNUSED(region), immUnbindProgram(); + /* Restore scissor test. */ + GPU_scissor(UNPACK4(scissor)); + /* outline */ - draw_scope_end(&rect, scissor); + draw_scope_end(&rect); GPU_blend(false); } @@ -1413,7 +1416,7 @@ void ui_draw_but_VECTORSCOPE(ARegion *UNUSED(region), /* need scissor test, hvectorscope can draw outside of boundary */ int scissor[4]; - GPU_scissor_get_i(scissor); + GPU_scissor_get(scissor); GPU_scissor((rect.xmin - 1), (rect.ymin - 1), (rect.xmax + 1) - (rect.xmin - 1), @@ -1481,8 +1484,10 @@ void ui_draw_but_VECTORSCOPE(ARegion *UNUSED(region), immUnbindProgram(); + /* Restore scissor test. */ + GPU_scissor(UNPACK4(scissor)); /* outline */ - draw_scope_end(&rect, scissor); + draw_scope_end(&rect); GPU_blend(false); } @@ -1917,7 +1922,7 @@ void ui_draw_but_CURVE(ARegion *region, uiBut *but, const uiWidgetColors *wcol, /* need scissor test, curve can draw outside of boundary */ int scissor[4]; - GPU_scissor_get_i(scissor); + GPU_scissor_get(scissor); rcti scissor_new = { .xmin = rect->xmin, .ymin = rect->ymin, @@ -2194,7 +2199,7 @@ void ui_draw_but_CURVEPROFILE(ARegion *region, /* Test needed because path can draw outside of boundary. */ int scissor[4]; - GPU_scissor_get_i(scissor); + GPU_scissor_get(scissor); rcti scissor_new = { .xmin = rect->xmin, .ymin = rect->ymin, @@ -2468,7 +2473,7 @@ void ui_draw_but_TRACKPREVIEW(ARegion *UNUSED(region), /* need scissor test, preview image can draw outside of boundary */ int scissor[4]; - GPU_scissor_get_i(scissor); + GPU_scissor_get(scissor); GPU_scissor((rect.xmin - 1), (rect.ymin - 1), (rect.xmax + 1) - (rect.xmin - 1), @@ -2593,8 +2598,10 @@ void ui_draw_but_TRACKPREVIEW(ARegion *UNUSED(region), true, rect.xmin - 1, rect.ymin, rect.xmax + 1, rect.ymax + 1, 3.0f, color); } + /* Restore scissor test. */ + GPU_scissor(UNPACK4(scissor)); /* outline */ - draw_scope_end(&rect, scissor); + draw_scope_end(&rect); GPU_blend(false); } |