diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2020-08-16 16:16:21 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2020-08-18 22:30:10 +0300 |
commit | 969bcf0793dca0e75bf42998aba92b1abd90ec23 (patch) | |
tree | 26456f72a028a27e32b0311072749e34813894fe /source/blender/editors/interface/interface_icons.c | |
parent | a1459b2f7a53fc9e7a52260e975c47c48c6c383d (diff) |
Cleanup: GPUState: Replace blend func separate by enum
Diffstat (limited to 'source/blender/editors/interface/interface_icons.c')
-rw-r--r-- | source/blender/editors/interface/interface_icons.c | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/source/blender/editors/interface/interface_icons.c b/source/blender/editors/interface/interface_icons.c index a7b7bad2fe6..2dc4081a4c6 100644 --- a/source/blender/editors/interface/interface_icons.c +++ b/source/blender/editors/interface/interface_icons.c @@ -1605,8 +1605,7 @@ static void icon_draw_cache_flush_ex(bool only_full_caches) icon_draw_cache_texture_flush_ex(icongltex.tex[1], &g_icon_draw_cache.border); } - GPU_blend_set_func_separate( - GPU_SRC_ALPHA, GPU_ONE_MINUS_SRC_ALPHA, GPU_ONE, GPU_ONE_MINUS_SRC_ALPHA); + GPU_blend_set_func_separate(GPU_BLEND_ALPHA); } } @@ -1726,8 +1725,7 @@ static void icon_draw_texture(float x, GPU_texture_unbind(texture); - GPU_blend_set_func_separate( - GPU_SRC_ALPHA, GPU_ONE_MINUS_SRC_ALPHA, GPU_ONE, GPU_ONE_MINUS_SRC_ALPHA); + GPU_blend_set_func_separate(GPU_BLEND_ALPHA); } /* Drawing size for preview images */ @@ -1815,11 +1813,9 @@ static void icon_draw_size(float x, di->data.geom.inverted = invert; } - GPU_blend_set_func_separate( - GPU_ONE, GPU_ONE_MINUS_SRC_ALPHA, GPU_ONE, GPU_ONE_MINUS_SRC_ALPHA); + GPU_blend_set_func_separate(GPU_BLEND_ALPHA_PREMULT); icon_draw_rect(x, y, w, h, aspect, w, h, ibuf->rect, alpha, desaturate); - GPU_blend_set_func_separate( - GPU_SRC_ALPHA, GPU_ONE_MINUS_SRC_ALPHA, GPU_ONE, GPU_ONE_MINUS_SRC_ALPHA); + GPU_blend_set_func_separate(GPU_BLEND_ALPHA); } else if (di->type == ICON_TYPE_EVENT) { const short event_type = di->data.input.event_type; @@ -1900,12 +1896,10 @@ static void icon_draw_size(float x, } /* Preview images use premultiplied alpha. */ - GPU_blend_set_func_separate( - GPU_ONE, GPU_ONE_MINUS_SRC_ALPHA, GPU_ONE, GPU_ONE_MINUS_SRC_ALPHA); + GPU_blend_set_func_separate(GPU_BLEND_ALPHA_PREMULT); icon_draw_rect( x, y, w, h, aspect, pi->w[size], pi->h[size], pi->rect[size], alpha, desaturate); - GPU_blend_set_func_separate( - GPU_SRC_ALPHA, GPU_ONE_MINUS_SRC_ALPHA, GPU_ONE, GPU_ONE_MINUS_SRC_ALPHA); + GPU_blend_set_func_separate(GPU_BLEND_ALPHA); } } else if (di->type == ICON_TYPE_GPLAYER) { |