diff options
author | Hans Goudey <h.goudey@me.com> | 2020-09-01 20:35:14 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2020-09-01 20:38:05 +0300 |
commit | baca8611e5fe4b3dcd6f5065fb125bc0a9d65934 (patch) | |
tree | bb1230387cd53b15f9621f10c4d0e5e2050b5580 /source/blender/editors/space_node/drawnode.c | |
parent | 31705201dddebf7e3be5c4533b89f380aad1ede1 (diff) | |
parent | 2930d4fcea405985f2212c5f28c061af7c4849f8 (diff) |
Merge branch 'master' into active-fcurve-keyframeactive-fcurve-keyframe
Diffstat (limited to 'source/blender/editors/space_node/drawnode.c')
-rw-r--r-- | source/blender/editors/space_node/drawnode.c | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c index 37daa881317..5866b5cc12f 100644 --- a/source/blender/editors/space_node/drawnode.c +++ b/source/blender/editors/space_node/drawnode.c @@ -456,7 +456,6 @@ static void node_draw_frame(const bContext *C, bNodeInstanceKey UNUSED(key)) { rctf *rct = &node->totr; - int color_id = node_get_colorid(node); float color[4]; float alpha; @@ -499,8 +498,6 @@ static void node_draw_frame(const bContext *C, /* label */ node_draw_frame_label(ntree, node, snode->aspect); - UI_ThemeClearColor(color_id); - UI_block_end(C, node->block); UI_block_draw(C, node->block); node->block = NULL; @@ -602,7 +599,7 @@ static void node_draw_reroute(const bContext *C, /* outline active and selected emphasis */ if (node->flag & SELECT) { - GPU_blend(true); + GPU_blend(GPU_BLEND_ALPHA); GPU_line_smooth(true); /* using different shades of TH_TEXT_HI for the empasis, like triangle */ if (node->flag & NODE_ACTIVE) { @@ -614,7 +611,7 @@ static void node_draw_reroute(const bContext *C, UI_draw_roundbox_4fv(false, rct->xmin, rct->ymin, rct->xmax, rct->ymax, size, debug_color); GPU_line_smooth(false); - GPU_blend(false); + GPU_blend(GPU_BLEND_NONE); } #endif @@ -3688,13 +3685,11 @@ void draw_nodespace_back_pix(const bContext *C, GPU_shader_unbind(); } else if (snode->flag & SNODE_USE_ALPHA) { - GPU_blend(true); - GPU_blend_set_func_separate( - GPU_SRC_ALPHA, GPU_ONE_MINUS_SRC_ALPHA, GPU_ONE, GPU_ONE_MINUS_SRC_ALPHA); + GPU_blend(GPU_BLEND_ALPHA); ED_draw_imbuf_ctx(C, ibuf, x, y, false, snode->zoom, snode->zoom); - GPU_blend(false); + GPU_blend(GPU_BLEND_NONE); } else { ED_draw_imbuf_ctx(C, ibuf, x, y, false, snode->zoom, snode->zoom); @@ -4013,7 +4008,7 @@ static void nodelink_batch_draw(SpaceNode *snode) return; } - GPU_blend(true); + GPU_blend(GPU_BLEND_ALPHA); float colors[6][4] = {{0.0f}}; UI_GetThemeColor4fv(TH_WIRE_INNER, colors[nodelink_get_color_id(TH_WIRE_INNER)]); @@ -4026,14 +4021,14 @@ static void nodelink_batch_draw(SpaceNode *snode) GPU_vertbuf_use(g_batch_link.inst_vbo); /* force update. */ GPU_batch_program_set_builtin(g_batch_link.batch, GPU_SHADER_2D_NODELINK_INST); - GPU_batch_uniform_4fv_array(g_batch_link.batch, "colors", 6, (float *)colors); + GPU_batch_uniform_4fv_array(g_batch_link.batch, "colors", 6, colors); GPU_batch_uniform_1f(g_batch_link.batch, "expandSize", snode->aspect * LINK_WIDTH); GPU_batch_uniform_1f(g_batch_link.batch, "arrowSize", ARROW_SIZE); GPU_batch_draw(g_batch_link.batch); nodelink_batch_reset(); - GPU_blend(false); + GPU_blend(GPU_BLEND_NONE); } void nodelink_batch_start(SpaceNode *UNUSED(snode)) @@ -4108,8 +4103,8 @@ void node_draw_link_bezier( GPUBatch *batch = g_batch_link.batch_single; GPU_batch_program_set_builtin(batch, GPU_SHADER_2D_NODELINK); - GPU_batch_uniform_2fv_array(batch, "bezierPts", 4, (float *)vec); - GPU_batch_uniform_4fv_array(batch, "colors", 3, (float *)colors); + GPU_batch_uniform_2fv_array(batch, "bezierPts", 4, vec); + GPU_batch_uniform_4fv_array(batch, "colors", 3, colors); GPU_batch_uniform_1f(batch, "expandSize", snode->aspect * LINK_WIDTH); GPU_batch_uniform_1f(batch, "arrowSize", ARROW_SIZE); GPU_batch_uniform_1i(batch, "doArrow", drawarrow); |