From a1459b2f7a53fc9e7a52260e975c47c48c6c383d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Foucault?= Date: Sun, 16 Aug 2020 14:47:13 +0200 Subject: Cleanup: GPU: Move towards an explicit Blend state This make use of the GLStateStack functions for: - `GPU_blend()` - `GPU_blend_set_func()` - `GPU_blend_set_func_separate()` The goal is to unify them using an explicit state setting. This will remove the need to use obscure blend functions --- source/blender/windowmanager/intern/wm_draw.c | 3 +-- source/blender/windowmanager/intern/wm_gesture.c | 1 - source/blender/windowmanager/intern/wm_init_exit.c | 2 -- 3 files changed, 1 insertion(+), 5 deletions(-) (limited to 'source/blender/windowmanager') diff --git a/source/blender/windowmanager/intern/wm_draw.c b/source/blender/windowmanager/intern/wm_draw.c index bfc155dce16..a9af4f16747 100644 --- a/source/blender/windowmanager/intern/wm_draw.c +++ b/source/blender/windowmanager/intern/wm_draw.c @@ -577,8 +577,8 @@ void wm_draw_region_blend(ARegion *region, int view, bool blend) if (blend) { /* GL_ONE because regions drawn offscreen have premultiplied alpha. */ - GPU_blend_set_func(GPU_ONE, GPU_ONE_MINUS_SRC_ALPHA); GPU_blend(true); + GPU_blend_set_func(GPU_ONE, GPU_ONE_MINUS_SRC_ALPHA); } /* setup actual texture */ @@ -603,7 +603,6 @@ void wm_draw_region_blend(ARegion *region, int view, bool blend) GPU_texture_unbind(texture); if (blend) { - GPU_blend_set_func(GPU_SRC_ALPHA, GPU_ONE_MINUS_SRC_ALPHA); GPU_blend(false); } } diff --git a/source/blender/windowmanager/intern/wm_gesture.c b/source/blender/windowmanager/intern/wm_gesture.c index 55233168ab2..abe8364d7c3 100644 --- a/source/blender/windowmanager/intern/wm_gesture.c +++ b/source/blender/windowmanager/intern/wm_gesture.c @@ -370,7 +370,6 @@ static void draw_filled_lasso(wmGesture *gt) MEM_freeN(pixel_buf); GPU_blend(false); - GPU_blend_set_func(GPU_SRC_ALPHA, GPU_ONE_MINUS_SRC_ALPHA); } MEM_freeN(mcoords); diff --git a/source/blender/windowmanager/intern/wm_init_exit.c b/source/blender/windowmanager/intern/wm_init_exit.c index 075469743ec..e8f663b0c4a 100644 --- a/source/blender/windowmanager/intern/wm_init_exit.c +++ b/source/blender/windowmanager/intern/wm_init_exit.c @@ -350,8 +350,6 @@ void WM_init(bContext *C, int argc, const char **argv) BKE_material_copybuf_clear(); ED_render_clear_mtex_copybuf(); - // GPU_blend_set_func(GPU_SRC_ALPHA, GPU_ONE_MINUS_SRC_ALPHA, GPU_ONE, GPU_ONE_MINUS_SRC_ALPHA); - wm_history_file_read(); /* allow a path of "", this is what happens when making a new file */ -- cgit v1.2.3