Workaround T56752: redo panel alpha flicker
authorCampbell Barton <ideasman42@gmail.com>
Tue, 11 Sep 2018 03:49:37 +0000 (13:49 +1000)
committerCampbell Barton <ideasman42@gmail.com>
Tue, 11 Sep 2018 03:50:30 +0000 (13:50 +1000)
The bug applies to tooltips, but isn't as noticeable.

source/blender/editors/interface/interface_region_hud.c

index 89b34f3f152d6089e17538e71871da7c68069721..914b16586ed5249d6d580875b604093e5bd92315 100644 (file)
@@ -39,6 +39,7 @@
 #include "BLI_rect.h"
 #include "BLI_listbase.h"
 #include "BLI_utildefines.h"
+#include "BLI_math_color.h"
 
 #include "BKE_context.h"
 #include "BKE_screen.h"
@@ -203,7 +204,20 @@ static void hud_region_draw(const bContext *C, ARegion *ar)
        GPU_clear(GPU_COLOR_BIT);
 
        if ((ar->flag & RGN_FLAG_HIDDEN) == 0) {
-               ui_draw_menu_back(NULL, NULL, &(rcti){.xmax = ar->winx, .ymax = ar->winy});
+               if (0) {
+                       /* Has alpha flickering glitch, see T56752. */
+                       ui_draw_menu_back(NULL, NULL, &(rcti){.xmax = ar->winx, .ymax = ar->winy});
+               }
+               else {
+                       /* Use basic drawing instead. */
+                       bTheme *btheme = UI_GetTheme();
+                       float color[4];
+                       rgba_uchar_to_float(color, (const uchar *)btheme->tui.wcol_menu_back.inner);
+                       const float radius = U.widget_unit * btheme->tui.wcol_menu_back.roundness;
+                       UI_draw_roundbox_corner_set(UI_CNR_ALL);
+                       UI_draw_roundbox_4fv(true, 0, 0, ar->winx, ar->winy, radius, color);
+               }
+
                ED_region_panels_draw(C, ar);
        }
 }