diff options
Diffstat (limited to 'source/blender/editors/space_node/drawnode.c')
-rw-r--r-- | source/blender/editors/space_node/drawnode.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c index a162a863038..12da5086c52 100644 --- a/source/blender/editors/space_node/drawnode.c +++ b/source/blender/editors/space_node/drawnode.c @@ -56,6 +56,7 @@ #include "GPU_batch.h" #include "GPU_immediate.h" #include "GPU_matrix.h" +#include "GPU_state.h" #include "RNA_access.h" #include "RNA_define.h" @@ -562,8 +563,8 @@ static void node_draw_reroute(const bContext *C, ARegion *ar, SpaceNode *UNUSED( /* outline active and selected emphasis */ if (node->flag & SELECT) { - glEnable(GL_BLEND); - glEnable(GL_LINE_SMOOTH); + GPU_blend(true); + GPU_line_smooth(true); /* using different shades of TH_TEXT_HI for the empasis, like triangle */ if (node->flag & NODE_ACTIVE) { UI_GetThemeColorShadeAlpha4fv(TH_TEXT_HI, 0, -40, debug_color); @@ -573,8 +574,8 @@ static void node_draw_reroute(const bContext *C, ARegion *ar, SpaceNode *UNUSED( } UI_draw_roundbox_4fv(false, rct->xmin, rct->ymin, rct->xmax, rct->ymax, size, debug_color); - glDisable(GL_LINE_SMOOTH); - glDisable(GL_BLEND); + GPU_line_smooth(false); + GPU_blend(false); } #endif @@ -3214,12 +3215,12 @@ void draw_nodespace_back_pix(const bContext *C, ARegion *ar, SpaceNode *snode, b GPU_shader_unbind(); } else if (snode->flag & SNODE_USE_ALPHA) { - glEnable(GL_BLEND); - glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ONE_MINUS_SRC_ALPHA); + GPU_blend(true); + GPU_blend_set_func_separate(GPU_SRC_ALPHA, GPU_ONE_MINUS_SRC_ALPHA, GPU_ONE, GPU_ONE_MINUS_SRC_ALPHA); glaDrawImBuf_glsl_ctx(C, ibuf, x, y, GL_NEAREST, snode->zoom, snode->zoom); - glDisable(GL_BLEND); + GPU_blend(false); } else { glaDrawImBuf_glsl_ctx(C, ibuf, x, y, GL_NEAREST, snode->zoom, snode->zoom); @@ -3503,7 +3504,7 @@ static void nodelink_batch_draw(SpaceNode *snode) if (g_batch_link.count == 0) return; - glEnable(GL_BLEND); + GPU_blend(true); float colors[6][4] = {{0.0f}}; UI_GetThemeColor4fv(TH_WIRE_INNER, colors[nodelink_get_color_id(TH_WIRE_INNER)]); @@ -3523,7 +3524,7 @@ static void nodelink_batch_draw(SpaceNode *snode) nodelink_batch_reset(); - glDisable(GL_BLEND); + GPU_blend(false); } void nodelink_batch_start(SpaceNode *UNUSED(snode)) |