DRW: Profiling: Batch BLF strings and add shadowing

Shadows makes it more readable and are relatively cheap now.
This commit is contained in:
2018-04-08 14:29:49 +02:00
parent 6b109da114
commit 0c9bc69f42

View File

@@ -225,7 +225,13 @@ void DRW_stats_draw(rcti *rect)
double init_tot_time = 0.0, background_tot_time = 0.0, render_tot_time = 0.0, tot_time = 0.0;
UI_FontThemeColor(BLF_default(), TH_TEXT_HI);
int fontid = BLF_default();
UI_FontThemeColor(fontid, TH_TEXT_HI);
BLF_enable(fontid, BLF_SHADOW);
BLF_shadow(fontid, 5, (const float[4]){0.0f, 0.0f, 0.0f, 0.75f});
BLF_shadow_offset(fontid, 0, -1);
BLF_batch_draw_begin();
/* ------------------------------------------ */
/* ---------------- CPU stats --------------- */
@@ -351,4 +357,7 @@ void DRW_stats_draw(rcti *rect)
draw_stat(rect, 16 + timer->lvl, v, stat_string, sizeof(stat_string));
v++;
}
BLF_batch_draw_end();
BLF_disable(fontid, BLF_SHADOW);
}