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. --- source/blender/editors/gpencil/annotate_draw.c | 8 ++++---- source/blender/editors/gpencil/annotate_paint.c | 10 +++++----- source/blender/editors/gpencil/gpencil_fill.c | 4 ++-- source/blender/editors/gpencil/gpencil_paint.c | 6 +++--- source/blender/editors/gpencil/gpencil_utils.c | 14 +++++++------- 5 files changed, 21 insertions(+), 21 deletions(-) (limited to 'source/blender/editors/gpencil') diff --git a/source/blender/editors/gpencil/annotate_draw.c b/source/blender/editors/gpencil/annotate_draw.c index e0e8f72fd16..78f4df8f71a 100644 --- a/source/blender/editors/gpencil/annotate_draw.c +++ b/source/blender/editors/gpencil/annotate_draw.c @@ -734,8 +734,8 @@ static void annotation_draw_data( GPU_line_smooth(true); /* turn on alpha-blending */ - GPU_blend_set_func_separate(GPU_BLEND_ALPHA); - GPU_blend(true); + GPU_blend(GPU_BLEND_ALPHA); + GPU_blend(GPU_BLEND_ALPHA); /* Do not write to depth (avoid self-occlusion). */ bool prev_depth_mask = GPU_depth_mask_get(); @@ -745,8 +745,8 @@ static void annotation_draw_data( annotation_draw_data_layers(gpd, offsx, offsy, winx, winy, cfra, dflag); /* turn off alpha blending, then smooth lines */ - GPU_blend(false); // alpha blending - GPU_line_smooth(false); // smooth lines + GPU_blend(GPU_BLEND_NONE); // alpha blending + GPU_line_smooth(false); // smooth lines GPU_depth_mask(prev_depth_mask); } diff --git a/source/blender/editors/gpencil/annotate_paint.c b/source/blender/editors/gpencil/annotate_paint.c index 52c6dcc5f77..56f554e5b7c 100644 --- a/source/blender/editors/gpencil/annotate_paint.c +++ b/source/blender/editors/gpencil/annotate_paint.c @@ -1700,8 +1700,8 @@ static void annotation_draw_eraser(bContext *UNUSED(C), int x, int y, void *p_pt immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); GPU_line_smooth(true); - GPU_blend(true); - GPU_blend_set_func_separate(GPU_BLEND_ALPHA); + GPU_blend(GPU_BLEND_ALPHA); + GPU_blend(GPU_BLEND_ALPHA); immUniformColor4ub(255, 100, 100, 20); imm_draw_circle_fill_2d(shdr_pos, x, y, p->radius, 40); @@ -1729,7 +1729,7 @@ static void annotation_draw_eraser(bContext *UNUSED(C), int x, int y, void *p_pt immUnbindProgram(); - GPU_blend(false); + GPU_blend(GPU_BLEND_NONE); GPU_line_smooth(false); } } @@ -1767,7 +1767,7 @@ static void annotation_draw_stabilizer(bContext *C, int x, int y, void *p_ptr) uint pos = GPU_vertformat_attr_add(format, "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); GPU_line_smooth(true); - GPU_blend(true); + GPU_blend(GPU_BLEND_ALPHA); GPU_line_width(1.25f); const float color[3] = {1.0f, 0.39f, 0.39f}; @@ -1792,7 +1792,7 @@ static void annotation_draw_stabilizer(bContext *C, int x, int y, void *p_ptr) immEnd(); /* Returns back all GPU settings */ - GPU_blend(false); + GPU_blend(GPU_BLEND_NONE); GPU_line_smooth(false); immUnbindProgram(); diff --git a/source/blender/editors/gpencil/gpencil_fill.c b/source/blender/editors/gpencil/gpencil_fill.c index 9d99773348b..ae9146b3a6a 100644 --- a/source/blender/editors/gpencil/gpencil_fill.c +++ b/source/blender/editors/gpencil/gpencil_fill.c @@ -252,7 +252,7 @@ static void gpencil_draw_datablock(tGPDfill *tgpf, const float ink[4]) tgpw.disable_fill = 1; tgpw.dflag |= (GP_DRAWFILLS_ONLY3D | GP_DRAWFILLS_NOSTATUS); - GPU_blend(true); + GPU_blend(GPU_BLEND_ALPHA); bGPDlayer *gpl_active = BKE_gpencil_layer_active_get(gpd); BLI_assert(gpl_active != NULL); @@ -371,7 +371,7 @@ static void gpencil_draw_datablock(tGPDfill *tgpf, const float ink[4]) } } - GPU_blend(false); + GPU_blend(GPU_BLEND_NONE); } /* draw strokes in offscreen buffer */ diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c index 81999bc7721..251d1b22846 100644 --- a/source/blender/editors/gpencil/gpencil_paint.c +++ b/source/blender/editors/gpencil/gpencil_paint.c @@ -2268,8 +2268,8 @@ static void gpencil_draw_eraser(bContext *UNUSED(C), int x, int y, void *p_ptr) immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); GPU_line_smooth(true); - GPU_blend(true); - GPU_blend_set_func_separate(GPU_BLEND_ALPHA); + GPU_blend(GPU_BLEND_ALPHA); + GPU_blend(GPU_BLEND_ALPHA); immUniformColor4ub(255, 100, 100, 20); imm_draw_circle_fill_2d(shdr_pos, x, y, p->radius, 40); @@ -2297,7 +2297,7 @@ static void gpencil_draw_eraser(bContext *UNUSED(C), int x, int y, void *p_ptr) immUnbindProgram(); - GPU_blend(false); + GPU_blend(GPU_BLEND_NONE); GPU_line_smooth(false); } } diff --git a/source/blender/editors/gpencil/gpencil_utils.c b/source/blender/editors/gpencil/gpencil_utils.c index aa3b6991a82..46de164f381 100644 --- a/source/blender/editors/gpencil/gpencil_utils.c +++ b/source/blender/editors/gpencil/gpencil_utils.c @@ -1760,8 +1760,8 @@ void ED_gpencil_brush_draw_eraser(Brush *brush, int x, int y) immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); GPU_line_smooth(true); - GPU_blend(true); - GPU_blend_set_func_separate(GPU_BLEND_ALPHA); + GPU_blend(GPU_BLEND_ALPHA); + GPU_blend(GPU_BLEND_ALPHA); immUniformColor4ub(255, 100, 100, 20); imm_draw_circle_fill_2d(shdr_pos, x, y, radius, 40); @@ -1789,7 +1789,7 @@ void ED_gpencil_brush_draw_eraser(Brush *brush, int x, int y) immUnbindProgram(); - GPU_blend(false); + GPU_blend(GPU_BLEND_NONE); GPU_line_smooth(false); } @@ -1943,7 +1943,7 @@ static void gpencil_brush_cursor_draw(bContext *C, int x, int y, void *customdat immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); GPU_line_smooth(true); - GPU_blend(true); + GPU_blend(GPU_BLEND_ALPHA); /* Inner Ring: Color from UI panel */ immUniformColor4f(color[0], color[1], color[2], 0.8f); @@ -1962,13 +1962,13 @@ static void gpencil_brush_cursor_draw(bContext *C, int x, int y, void *customdat immUniformColor4f(darkcolor[0], darkcolor[1], darkcolor[2], 0.8f); imm_draw_circle_wire_2d(pos, x, y, radius + 1, 40); - GPU_blend(false); + GPU_blend(GPU_BLEND_NONE); GPU_line_smooth(false); /* Draw line for lazy mouse */ if ((last_mouse_position) && (brush->gpencil_settings->flag & GP_BRUSH_STABILIZE_MOUSE_TEMP)) { GPU_line_smooth(true); - GPU_blend(true); + GPU_blend(GPU_BLEND_ALPHA); copy_v3_v3(color, brush->add_col); immUniformColor4f(color[0], color[1], color[2], 0.8f); @@ -1980,7 +1980,7 @@ static void gpencil_brush_cursor_draw(bContext *C, int x, int y, void *customdat last_mouse_position[1] + region->winrct.ymin); immEnd(); - GPU_blend(false); + GPU_blend(GPU_BLEND_NONE); GPU_line_smooth(false); } -- cgit v1.2.3