diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2020-08-16 15:47:13 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2020-08-18 22:30:10 +0300 |
commit | a1459b2f7a53fc9e7a52260e975c47c48c6c383d (patch) | |
tree | 2a6c612d8efd0fa3240a7618b66490b8be1b8bbd /source/blender/windowmanager/intern | |
parent | 2ae1c895a2f7590d0783a27176085da45ef12bc5 (diff) |
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
Diffstat (limited to 'source/blender/windowmanager/intern')
-rw-r--r-- | source/blender/windowmanager/intern/wm_draw.c | 3 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_gesture.c | 1 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_init_exit.c | 2 |
3 files changed, 1 insertions, 5 deletions
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 */ |