diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2015-05-24 19:35:14 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2015-05-24 19:35:14 +0300 |
commit | 78918e761f8b54f08d4e1137b5340d850db7e9bc (patch) | |
tree | 1bd73ed47a8e2c7b83b29ffe5411383d73f5000e /source | |
parent | a28adf1b356e0431665ebe9998e3baa133c18ef9 (diff) |
Fix T44814: 'preview' icons would not greyout.
Since they are premultiplied, we need separated handling of colors and alpha blending
if we want additional alpha factor to work OK.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/interface/interface_icons.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/source/blender/editors/interface/interface_icons.c b/source/blender/editors/interface/interface_icons.c index 420af1e2e71..efd91b9c36b 100644 --- a/source/blender/editors/interface/interface_icons.c +++ b/source/blender/editors/interface/interface_icons.c @@ -1224,15 +1224,12 @@ static void icon_draw_size( PreviewImage *pi = (icon->type != 0) ? BKE_previewimg_id_ensure((ID *)icon->obj) : icon->obj; if (pi) { - /* Do deferred loading/generation if needed. */ -// BKE_previewimg_ensure(pi, size); - /* no create icon on this level in code */ if (!pi->rect[size]) return; /* something has gone wrong! */ /* preview images use premul alpha ... */ - glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA); - icon_draw_rect(x, y, w, h, aspect, pi->w[size], pi->h[size], pi->rect[size], 1.0f, NULL, is_preview); + glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ONE_MINUS_SRC_ALPHA); + icon_draw_rect(x, y, w, h, aspect, pi->w[size], pi->h[size], pi->rect[size], alpha, rgb, is_preview); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); } } |