diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2019-03-25 22:26:52 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2019-03-25 22:26:52 +0300 |
commit | c602ec74fdd20c17c9ca9c7eb59c048443efc2ce (patch) | |
tree | af55cc2a2da7c385db5a42735e2bbbdea7953e1f /source/blender/editors | |
parent | c41e8b8f6f38b9f5a037e11b83b49c4481256716 (diff) |
GPU: State: Replace GL_BLEND by GPU_blend
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/gpencil/drawgpencil.c | 4 | ||||
-rw-r--r-- | source/blender/editors/gpencil/gpencil_fill.c | 4 | ||||
-rw-r--r-- | source/blender/editors/gpencil/gpencil_utils.c | 12 | ||||
-rw-r--r-- | source/blender/editors/interface/interface_icons_event.c | 4 |
4 files changed, 12 insertions, 12 deletions
diff --git a/source/blender/editors/gpencil/drawgpencil.c b/source/blender/editors/gpencil/drawgpencil.c index 8d642e82208..45498882160 100644 --- a/source/blender/editors/gpencil/drawgpencil.c +++ b/source/blender/editors/gpencil/drawgpencil.c @@ -1385,7 +1385,7 @@ void ED_gp_draw_interpolation(const bContext *C, tGPDinterpolate *tgpi, const in tgpw.dflag = dflag; /* turn on alpha-blending */ - glEnable(GL_BLEND); + GPU_blend(true); for (tgpil = tgpi->ilayers.first; tgpil; tgpil = tgpil->next) { /* calculate parent position */ ED_gpencil_parent_location(depsgraph, obact, tgpi->gpd, tgpil->gpl, tgpw.diff_mat); @@ -1403,7 +1403,7 @@ void ED_gp_draw_interpolation(const bContext *C, tGPDinterpolate *tgpi, const in gp_draw_strokes(&tgpw); } } - glDisable(GL_BLEND); + GPU_blend(false); } /* wrapper to draw strokes for filling operator */ diff --git a/source/blender/editors/gpencil/gpencil_fill.c b/source/blender/editors/gpencil/gpencil_fill.c index a4b4b699e5e..acbf329b783 100644 --- a/source/blender/editors/gpencil/gpencil_fill.c +++ b/source/blender/editors/gpencil/gpencil_fill.c @@ -241,7 +241,7 @@ static void gp_draw_datablock(tGPDfill *tgpf, const float ink[4]) tgpw.disable_fill = 1; tgpw.dflag |= (GP_DRAWFILLS_ONLY3D | GP_DRAWFILLS_NOSTATUS); - glEnable(GL_BLEND); + GPU_blend(true); for (bGPDlayer *gpl = gpd->layers.first; gpl; gpl = gpl->next) { /* calculate parent position */ @@ -309,7 +309,7 @@ static void gp_draw_datablock(tGPDfill *tgpf, const float ink[4]) } } - glDisable(GL_BLEND); + GPU_blend(false); } /* draw strokes in offscreen buffer */ diff --git a/source/blender/editors/gpencil/gpencil_utils.c b/source/blender/editors/gpencil/gpencil_utils.c index 3cab71272fa..f517cc59b7e 100644 --- a/source/blender/editors/gpencil/gpencil_utils.c +++ b/source/blender/editors/gpencil/gpencil_utils.c @@ -1621,7 +1621,7 @@ void ED_gpencil_brush_draw_eraser(Brush *brush, int x, int y) immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); GPU_line_smooth(true); - glEnable(GL_BLEND); + GPU_blend(true); glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ONE_MINUS_SRC_ALPHA); immUniformColor4ub(255, 100, 100, 20); @@ -1648,7 +1648,7 @@ void ED_gpencil_brush_draw_eraser(Brush *brush, int x, int y) immUnbindProgram(); - glDisable(GL_BLEND); + GPU_blend(false); GPU_line_smooth(false); } @@ -1766,7 +1766,7 @@ static void gp_brush_cursor_draw(bContext *C, int x, int y, void *customdata) immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); GPU_line_smooth(true); - glEnable(GL_BLEND); + GPU_blend(true); /* Inner Ring: Color from UI panel */ immUniformColor4f(color[0], color[1], color[2], 0.8f); @@ -1786,7 +1786,7 @@ static void gp_brush_cursor_draw(bContext *C, int x, int y, void *customdata) immUniformColor4f(darkcolor[0], darkcolor[1], darkcolor[2], 0.8f); imm_draw_circle_wire_2d(pos, x, y, radius + 1, 40); - glDisable(GL_BLEND); + GPU_blend(false); GPU_line_smooth(false); /* Draw line for lazy mouse */ @@ -1794,7 +1794,7 @@ static void gp_brush_cursor_draw(bContext *C, int x, int y, void *customdata) (brush->gpencil_settings->flag & GP_BRUSH_STABILIZE_MOUSE_TEMP)) { GPU_line_smooth(true); - glEnable(GL_BLEND); + GPU_blend(true); copy_v3_v3(color, brush->add_col); immUniformColor4f(color[0], color[1], color[2], 0.8f); @@ -1807,7 +1807,7 @@ static void gp_brush_cursor_draw(bContext *C, int x, int y, void *customdata) last_mouse_position[1] + ar->winrct.ymin); immEnd(); - glDisable(GL_BLEND); + GPU_blend(false); GPU_line_smooth(false); } diff --git a/source/blender/editors/interface/interface_icons_event.c b/source/blender/editors/interface/interface_icons_event.c index 8cd60c69b62..2af9bbf9e88 100644 --- a/source/blender/editors/interface/interface_icons_event.c +++ b/source/blender/editors/interface/interface_icons_event.c @@ -127,7 +127,7 @@ static void icon_draw_rect_input_line_prim( const char lines[][2], int lines_len) { GPU_line_smooth(true); - glEnable(GL_BLEND); + GPU_blend(true); BLI_assert(ELEM(prim, GPU_PRIM_LINE_LOOP, GPU_PRIM_LINE_STRIP)); const uint pos_id = GPU_vertformat_attr_add(immVertexFormat(), "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); @@ -145,7 +145,7 @@ static void icon_draw_rect_input_line_prim( immEnd(); immUnbindProgram(); GPU_line_smooth(false); - glDisable(GL_BLEND); + GPU_blend(false); } void icon_draw_rect_input( |