From bf1b622dd962416fef94ccb2f47878eced31e20d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Foucault?= Date: Sun, 16 Aug 2020 15:38:34 +0200 Subject: GPUState: GPU_blend final API renaming We now use GPU_blend for enabling / disabling blending and explicitly set the blend equation. --- .../editors/gizmo_library/gizmo_types/arrow3d_gizmo.c | 8 ++++---- .../editors/gizmo_library/gizmo_types/button2d_gizmo.c | 8 ++++---- .../blender/editors/gizmo_library/gizmo_types/cage2d_gizmo.c | 8 ++++---- .../blender/editors/gizmo_library/gizmo_types/cage3d_gizmo.c | 8 ++++---- .../blender/editors/gizmo_library/gizmo_types/dial3d_gizmo.c | 4 ++-- .../blender/editors/gizmo_library/gizmo_types/move3d_gizmo.c | 12 ++++++------ .../editors/gizmo_library/gizmo_types/primitive3d_gizmo.c | 8 ++++---- 7 files changed, 28 insertions(+), 28 deletions(-) (limited to 'source/blender/editors/gizmo_library/gizmo_types') diff --git a/source/blender/editors/gizmo_library/gizmo_types/arrow3d_gizmo.c b/source/blender/editors/gizmo_library/gizmo_types/arrow3d_gizmo.c index 341f43d0662..d4d9f9bf424 100644 --- a/source/blender/editors/gizmo_library/gizmo_types/arrow3d_gizmo.c +++ b/source/blender/editors/gizmo_library/gizmo_types/arrow3d_gizmo.c @@ -195,9 +195,9 @@ static void arrow_draw_intern(ArrowGizmo3D *arrow, const bool select, const bool GPU_matrix_push(); GPU_matrix_mul(matrix_final); - GPU_blend(true); + GPU_blend(GPU_BLEND_ALPHA); arrow_draw_geom(arrow, select, color); - GPU_blend(false); + GPU_blend(GPU_BLEND_NONE); GPU_matrix_pop(); @@ -207,9 +207,9 @@ static void arrow_draw_intern(ArrowGizmo3D *arrow, const bool select, const bool GPU_matrix_push(); GPU_matrix_mul(inter->init_matrix_final); - GPU_blend(true); + GPU_blend(GPU_BLEND_ALPHA); arrow_draw_geom(arrow, select, (const float[4]){0.5f, 0.5f, 0.5f, 0.5f}); - GPU_blend(false); + GPU_blend(GPU_BLEND_NONE); GPU_matrix_pop(); } diff --git a/source/blender/editors/gizmo_library/gizmo_types/button2d_gizmo.c b/source/blender/editors/gizmo_library/gizmo_types/button2d_gizmo.c index ef3381110d4..13f3903f0b2 100644 --- a/source/blender/editors/gizmo_library/gizmo_types/button2d_gizmo.c +++ b/source/blender/editors/gizmo_library/gizmo_types/button2d_gizmo.c @@ -195,7 +195,7 @@ static void button2d_draw_intern(const bContext *C, } else { - GPU_blend(true); + GPU_blend(GPU_BLEND_ALPHA); if (draw_options & ED_GIZMO_BUTTON_SHOW_BACKDROP) { const float fill_alpha = RNA_float_get(gz->ptr, "backdrop_fill_alpha"); @@ -265,7 +265,7 @@ static void button2d_draw_intern(const bContext *C, UI_icon_draw_alpha(pos[0], pos[1], button->icon, alpha); GPU_polygon_smooth(true); } - GPU_blend(false); + GPU_blend(GPU_BLEND_NONE); } if (need_to_pop) { @@ -283,9 +283,9 @@ static void gizmo_button2d_draw(const bContext *C, wmGizmo *gz) { const bool is_highlight = (gz->state & WM_GIZMO_STATE_HIGHLIGHT) != 0; - GPU_blend(true); + GPU_blend(GPU_BLEND_ALPHA); button2d_draw_intern(C, gz, false, is_highlight); - GPU_blend(false); + GPU_blend(GPU_BLEND_NONE); } static int gizmo_button2d_test_select(bContext *C, wmGizmo *gz, const int mval[2]) diff --git a/source/blender/editors/gizmo_library/gizmo_types/cage2d_gizmo.c b/source/blender/editors/gizmo_library/gizmo_types/cage2d_gizmo.c index 406d66dfd8f..be5f488d759 100644 --- a/source/blender/editors/gizmo_library/gizmo_types/cage2d_gizmo.c +++ b/source/blender/editors/gizmo_library/gizmo_types/cage2d_gizmo.c @@ -626,14 +626,14 @@ static void gizmo_cage2d_draw_intern(wmGizmo *gz, /* Handy for quick testing draw (if it's outside bounds). */ if (false) { - GPU_blend(true); + GPU_blend(GPU_BLEND_ALPHA); uint pos = GPU_vertformat_attr_add(immVertexFormat(), "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immUniformColor4fv((const float[4]){1, 1, 1, 0.5f}); float s = 0.5f; immRectf(pos, -s, -s, s, s); immUnbindProgram(); - GPU_blend(false); + GPU_blend(GPU_BLEND_NONE); } if (select) { @@ -722,7 +722,7 @@ static void gizmo_cage2d_draw_intern(wmGizmo *gz, float color[4], black[3] = {0, 0, 0}; gizmo_color_get(gz, highlight, color); - GPU_blend(true); + GPU_blend(GPU_BLEND_ALPHA); float outline_line_width = gz->line_width + 3.0f; cage2d_draw_circle_wire(&r, margin, black, transform_flag, draw_options, outline_line_width); @@ -732,7 +732,7 @@ static void gizmo_cage2d_draw_intern(wmGizmo *gz, cage2d_draw_circle_handles(&r, margin, color, transform_flag, true); cage2d_draw_circle_handles(&r, margin, (const float[3]){0, 0, 0}, transform_flag, false); - GPU_blend(false); + GPU_blend(GPU_BLEND_NONE); } else { BLI_assert(0); diff --git a/source/blender/editors/gizmo_library/gizmo_types/cage3d_gizmo.c b/source/blender/editors/gizmo_library/gizmo_types/cage3d_gizmo.c index 0bc65fe10a5..644a4247d84 100644 --- a/source/blender/editors/gizmo_library/gizmo_types/cage3d_gizmo.c +++ b/source/blender/editors/gizmo_library/gizmo_types/cage3d_gizmo.c @@ -303,14 +303,14 @@ static void gizmo_cage3d_draw_intern( /* Handy for quick testing draw (if it's outside bounds). */ if (false) { - GPU_blend(true); + GPU_blend(GPU_BLEND_ALPHA); uint pos = GPU_vertformat_attr_add(immVertexFormat(), "pos", GPU_COMP_F32, 3, GPU_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_3D_UNIFORM_COLOR); immUniformColor4fv((const float[4]){1, 1, 1, 0.5f}); float s = 0.5f; immRectf(pos, -s, -s, s, s); immUnbindProgram(); - GPU_blend(false); + GPU_blend(GPU_BLEND_NONE); } if (select) { @@ -382,7 +382,7 @@ static void gizmo_cage3d_draw_intern( float color[4], black[3] = {0, 0, 0}; gizmo_color_get(gz, highlight, color); - GPU_blend(true); + GPU_blend(GPU_BLEND_ALPHA); cage3d_draw_circle_wire( size_real, margin, black, transform_flag, draw_options, gz->line_width + 3.0f); @@ -395,7 +395,7 @@ static void gizmo_cage3d_draw_intern( cage3d_draw_circle_handles(rv3d, matrix_final, size_real, margin, color, true, 40); GPU_polygon_smooth(false); - GPU_blend(false); + GPU_blend(GPU_BLEND_NONE); } else { BLI_assert(0); diff --git a/source/blender/editors/gizmo_library/gizmo_types/dial3d_gizmo.c b/source/blender/editors/gizmo_library/gizmo_types/dial3d_gizmo.c index 5d7c3a9e717..e1860d5d0fd 100644 --- a/source/blender/editors/gizmo_library/gizmo_types/dial3d_gizmo.c +++ b/source/blender/editors/gizmo_library/gizmo_types/dial3d_gizmo.c @@ -482,9 +482,9 @@ static void gizmo_dial_draw(const bContext *C, wmGizmo *gz) clip_plane[3] += DIAL_CLIP_BIAS; } - GPU_blend(true); + GPU_blend(GPU_BLEND_ALPHA); dial_draw_intern(C, gz, false, is_highlight, clip_plane); - GPU_blend(false); + GPU_blend(GPU_BLEND_NONE); } static int gizmo_dial_modal(bContext *C, diff --git a/source/blender/editors/gizmo_library/gizmo_types/move3d_gizmo.c b/source/blender/editors/gizmo_library/gizmo_types/move3d_gizmo.c index db57a33f543..ad7036f4460 100644 --- a/source/blender/editors/gizmo_library/gizmo_types/move3d_gizmo.c +++ b/source/blender/editors/gizmo_library/gizmo_types/move3d_gizmo.c @@ -207,9 +207,9 @@ static void move3d_draw_intern(const bContext *C, GPU_matrix_mul(matrix_align); } - GPU_blend(true); + GPU_blend(GPU_BLEND_ALPHA); move_geom_draw(gz, color, select, draw_options); - GPU_blend(false); + GPU_blend(GPU_BLEND_NONE); GPU_matrix_pop(); if (gz->interaction_data) { @@ -220,9 +220,9 @@ static void move3d_draw_intern(const bContext *C, GPU_matrix_mul(matrix_align); } - GPU_blend(true); + GPU_blend(GPU_BLEND_ALPHA); move_geom_draw(gz, (const float[4]){0.5f, 0.5f, 0.5f, 0.5f}, select, draw_options); - GPU_blend(false); + GPU_blend(GPU_BLEND_NONE); GPU_matrix_pop(); } } @@ -240,9 +240,9 @@ static void gizmo_move_draw(const bContext *C, wmGizmo *gz) (void)is_modal; - GPU_blend(true); + GPU_blend(GPU_BLEND_ALPHA); move3d_draw_intern(C, gz, false, is_highlight); - GPU_blend(false); + GPU_blend(GPU_BLEND_NONE); } static int gizmo_move_modal(bContext *C, diff --git a/source/blender/editors/gizmo_library/gizmo_types/primitive3d_gizmo.c b/source/blender/editors/gizmo_library/gizmo_types/primitive3d_gizmo.c index 48b2e3348c9..177687b6afd 100644 --- a/source/blender/editors/gizmo_library/gizmo_types/primitive3d_gizmo.c +++ b/source/blender/editors/gizmo_library/gizmo_types/primitive3d_gizmo.c @@ -96,9 +96,9 @@ static void gizmo_primitive_draw_intern(wmGizmo *gz, GPU_matrix_push(); GPU_matrix_mul(matrix_final); - GPU_blend(true); + GPU_blend(GPU_BLEND_ALPHA); gizmo_primitive_draw_geom(color_inner, color_outer, draw_style); - GPU_blend(false); + GPU_blend(GPU_BLEND_NONE); GPU_matrix_pop(); @@ -112,9 +112,9 @@ static void gizmo_primitive_draw_intern(wmGizmo *gz, GPU_matrix_push(); GPU_matrix_mul(inter->init_matrix_final); - GPU_blend(true); + GPU_blend(GPU_BLEND_ALPHA); gizmo_primitive_draw_geom(color_inner, color_outer, draw_style); - GPU_blend(false); + GPU_blend(GPU_BLEND_NONE); GPU_matrix_pop(); } -- cgit v1.2.3