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/sculpt_paint/paint_cursor.c | 18 +++++++++--------- source/blender/editors/sculpt_paint/paint_image.c | 4 ++-- source/blender/editors/sculpt_paint/paint_stroke.c | 4 ++-- 3 files changed, 13 insertions(+), 13 deletions(-) (limited to 'source/blender/editors/sculpt_paint') diff --git a/source/blender/editors/sculpt_paint/paint_cursor.c b/source/blender/editors/sculpt_paint/paint_cursor.c index a80339d4cf7..bb4139cc510 100644 --- a/source/blender/editors/sculpt_paint/paint_cursor.c +++ b/source/blender/editors/sculpt_paint/paint_cursor.c @@ -634,8 +634,8 @@ static bool paint_draw_tex_overlay(UnifiedPaintSettings *ups, uint texCoord = GPU_vertformat_attr_add(format, "texCoord", GPU_COMP_F32, 2, GPU_FETCH_FLOAT); /* Premultiplied alpha blending. */ - GPU_blend(true); - GPU_blend_set_func_separate(GPU_BLEND_ALPHA_PREMULT); + GPU_blend(GPU_BLEND_ALPHA); + GPU_blend(GPU_BLEND_ALPHA_PREMULT); immBindBuiltinProgram(GPU_SHADER_2D_IMAGE_COLOR); @@ -727,8 +727,8 @@ static bool paint_draw_cursor_overlay( uint pos = GPU_vertformat_attr_add(format, "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT); uint texCoord = GPU_vertformat_attr_add(format, "texCoord", GPU_COMP_F32, 2, GPU_FETCH_FLOAT); - GPU_blend(true); - GPU_blend_set_func_separate(GPU_BLEND_ALPHA_PREMULT); + GPU_blend(GPU_BLEND_ALPHA); + GPU_blend(GPU_BLEND_ALPHA_PREMULT); immBindBuiltinProgram(GPU_SHADER_2D_IMAGE_COLOR); @@ -918,7 +918,7 @@ static void paint_draw_curve_cursor(Brush *brush, ViewContext *vc) PaintCurvePoint *cp = pc->points; GPU_line_smooth(true); - GPU_blend(true); + GPU_blend(GPU_BLEND_ALPHA); /* Draw the bezier handles and the curve segment between the current and next point. */ uint pos = GPU_vertformat_attr_add(immVertexFormat(), "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT); @@ -979,7 +979,7 @@ static void paint_draw_curve_cursor(Brush *brush, ViewContext *vc) draw_rect_point( pos, selec_col, handle_col, &cp->bez.vec[2][0], 8.0f, cp->bez.f3 || cp->bez.f2); - GPU_blend(false); + GPU_blend(GPU_BLEND_NONE); GPU_line_smooth(false); immUnbindProgram(); @@ -1835,7 +1835,7 @@ static void paint_cursor_update_anchored_location(PaintCursorContext *pcontext) static void paint_cursor_setup_2D_drawing(PaintCursorContext *pcontext) { GPU_line_width(2.0f); - GPU_blend(true); + GPU_blend(GPU_BLEND_ALPHA); GPU_line_smooth(true); pcontext->pos = GPU_vertformat_attr_add( immVertexFormat(), "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT); @@ -1845,7 +1845,7 @@ static void paint_cursor_setup_2D_drawing(PaintCursorContext *pcontext) static void paint_cursor_setup_3D_drawing(PaintCursorContext *pcontext) { GPU_line_width(2.0f); - GPU_blend(true); + GPU_blend(GPU_BLEND_ALPHA); GPU_line_smooth(true); pcontext->pos = GPU_vertformat_attr_add( immVertexFormat(), "pos", GPU_COMP_F32, 3, GPU_FETCH_FLOAT); @@ -1855,7 +1855,7 @@ static void paint_cursor_setup_3D_drawing(PaintCursorContext *pcontext) static void paint_cursor_restore_drawing_state(void) { immUnbindProgram(); - GPU_blend(false); + GPU_blend(GPU_BLEND_NONE); GPU_line_smooth(false); } diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c index 431ab998f62..d2ae6912fc3 100644 --- a/source/blender/editors/sculpt_paint/paint_image.c +++ b/source/blender/editors/sculpt_paint/paint_image.c @@ -438,7 +438,7 @@ static void gradient_draw_line(bContext *UNUSED(C), int x, int y, void *customda if (pop) { GPU_line_smooth(true); - GPU_blend(true); + GPU_blend(GPU_BLEND_ALPHA); GPUVertFormat *format = immVertexFormat(); uint pos = GPU_vertformat_attr_add(format, "pos", GPU_COMP_I32, 2, GPU_FETCH_INT_TO_FLOAT); @@ -467,7 +467,7 @@ static void gradient_draw_line(bContext *UNUSED(C), int x, int y, void *customda immUnbindProgram(); - GPU_blend(false); + GPU_blend(GPU_BLEND_NONE); GPU_line_smooth(false); } } diff --git a/source/blender/editors/sculpt_paint/paint_stroke.c b/source/blender/editors/sculpt_paint/paint_stroke.c index 071042e6728..52cdebf3fd5 100644 --- a/source/blender/editors/sculpt_paint/paint_stroke.c +++ b/source/blender/editors/sculpt_paint/paint_stroke.c @@ -143,7 +143,7 @@ static void paint_draw_smooth_cursor(bContext *C, int x, int y, void *customdata if (stroke && brush) { GPU_line_smooth(true); - GPU_blend(true); + GPU_blend(GPU_BLEND_ALPHA); ARegion *region = stroke->vc.region; @@ -161,7 +161,7 @@ static void paint_draw_smooth_cursor(bContext *C, int x, int y, void *customdata immUnbindProgram(); - GPU_blend(false); + GPU_blend(GPU_BLEND_NONE); GPU_line_smooth(false); } } -- cgit v1.2.3