Fix T57115: buttons drawing wrong after recent icon drawing changes.
authorBrecht Van Lommel <brechtvanlommel@gmail.com>
Tue, 9 Oct 2018 11:36:28 +0000 (13:36 +0200)
committerBrecht Van Lommel <brechtvanlommel@gmail.com>
Tue, 9 Oct 2018 12:05:57 +0000 (14:05 +0200)
source/blender/editors/interface/interface_icons.c

index 5c53fbb739b7525ade6f48eb80cc03bc12b1e9fe..bedc4ac92cf9fa5fb4259089d842ce4a1d5e4cc4 100644 (file)
@@ -1332,7 +1332,6 @@ static void icon_draw_cache_flush_ex(void)
                return;
 
        /* We need to flush widget base first to ensure correct ordering. */
-       GPU_blend_set_func_separate(GPU_SRC_ALPHA, GPU_ONE_MINUS_SRC_ALPHA, GPU_ONE, GPU_ONE_MINUS_SRC_ALPHA);
        UI_widgetbase_draw_cache_flush();
 
        GPU_blend_set_func(GPU_ONE, GPU_ONE_MINUS_SRC_ALPHA);
@@ -1354,6 +1353,8 @@ static void icon_draw_cache_flush_ex(void)
        glBindTexture(GL_TEXTURE_2D, 0);
 
        g_icon_draw_cache.calls = 0;
+
+       GPU_blend_set_func_separate(GPU_SRC_ALPHA, GPU_ONE_MINUS_SRC_ALPHA, GPU_ONE, GPU_ONE_MINUS_SRC_ALPHA);
 }
 
 void UI_icon_draw_cache_end(void)
@@ -1366,11 +1367,7 @@ void UI_icon_draw_cache_end(void)
                return;
 
        GPU_blend(true);
-       GPU_blend_set_func(GPU_ONE, GPU_ONE_MINUS_SRC_ALPHA);
-
        icon_draw_cache_flush_ex();
-
-       GPU_blend_set_func_separate(GPU_SRC_ALPHA, GPU_ONE_MINUS_SRC_ALPHA, GPU_ONE, GPU_ONE_MINUS_SRC_ALPHA);
        GPU_blend(false);
 }