From 78918e761f8b54f08d4e1137b5340d850db7e9bc Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Sun, 24 May 2015 18:35:14 +0200 Subject: [PATCH] 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. --- source/blender/editors/interface/interface_icons.c | 7 ++----- 1 file 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); } }