diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2018-03-30 23:51:28 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2018-03-30 23:51:28 +0300 |
commit | ddbde6d1c0cf9a33d284184f7a83431ef831d935 (patch) | |
tree | c681032fa98a775ec6031a6d4a5fe605c1ea2f9d /source/blender/editors | |
parent | 4241d6a9ccd0790f90ab1cc63446474dcbc08719 (diff) |
UI: Perf: Do not use implicit Attrib fill.
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/interface/interface_panel.c | 21 |
1 files changed, 19 insertions, 2 deletions
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); } |