From ddbde6d1c0cf9a33d284184f7a83431ef831d935 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Foucault?= Date: Fri, 30 Mar 2018 22:51:28 +0200 Subject: UI: Perf: Do not use implicit Attrib fill. --- source/blender/editors/interface/interface_panel.c | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'source/blender/editors/interface/interface_panel.c') diff --git a/source/blender/editors/interface/interface_panel.c b/source/blender/editors/interface/interface_panel.c index be49d4b3591..bb086d63917 100644 --- a/source/blender/editors/interface/interface_panel.c +++ b/source/blender/editors/interface/interface_panel.c @@ -1619,30 +1619,36 @@ static void ui_panel_category_draw_tab( immBegin(filled ? GWN_PRIM_TRI_FAN : GWN_PRIM_LINE_STRIP, vert_ct); - immAttrib3ubv(color, col); - /* start with corner right-top */ if (use_highlight) { if (roundboxtype & UI_CNR_TOP_RIGHT) { + immAttrib3ubv(color, col); immVertex2f(pos, maxx, maxy - rad); for (a = 0; a < 4; a++) { + immAttrib3ubv(color, col); immVertex2f(pos, maxx - vec[a][1], maxy - rad + vec[a][0]); } + immAttrib3ubv(color, col); immVertex2f(pos, maxx - rad, maxy); } else { + immAttrib3ubv(color, col); immVertex2f(pos, maxx, maxy); } /* corner left-top */ if (roundboxtype & UI_CNR_TOP_LEFT) { + immAttrib3ubv(color, col); immVertex2f(pos, minx + rad, maxy); for (a = 0; a < 4; a++) { + immAttrib3ubv(color, col); immVertex2f(pos, minx + rad - vec[a][0], maxy - vec[a][1]); } + immAttrib3ubv(color, col); immVertex2f(pos, minx, maxy - rad); } else { + immAttrib3ubv(color, col); immVertex2f(pos, minx, maxy); } } @@ -1651,6 +1657,9 @@ static void ui_panel_category_draw_tab( if (highlight_fade) { immAttrib3ubv(color, highlight_fade); } + else { + immAttrib3ubv(color, col); + } immVertex2f(pos, minx, miny + rad); immEnd(); immUnbindProgram(); @@ -1659,25 +1668,33 @@ static void ui_panel_category_draw_tab( /* corner left-bottom */ if (roundboxtype & UI_CNR_BOTTOM_LEFT) { + immAttrib3ubv(color, col); immVertex2f(pos, minx, miny + rad); for (a = 0; a < 4; a++) { + immAttrib3ubv(color, col); immVertex2f(pos, minx + vec[a][1], miny + rad - vec[a][0]); } + immAttrib3ubv(color, col); immVertex2f(pos, minx + rad, miny); } else { + immAttrib3ubv(color, col); immVertex2f(pos, minx, miny); } /* corner right-bottom */ if (roundboxtype & UI_CNR_BOTTOM_RIGHT) { + immAttrib3ubv(color, col); immVertex2f(pos, maxx - rad, miny); for (a = 0; a < 4; a++) { + immAttrib3ubv(color, col); immVertex2f(pos, maxx - rad + vec[a][0], miny + vec[a][1]); } + immAttrib3ubv(color, col); immVertex2f(pos, maxx, miny + rad); } else { + immAttrib3ubv(color, col); immVertex2f(pos, maxx, miny); } -- cgit v1.2.3