[Bf-blender-cvs] [0c9bc69f428] blender2.8: DRW: Profiling: Batch BLF strings and add shadowing

Clément Foucault noreply at git.blender.org
Sun Apr 8 15:50:53 CEST 2018


Commit: 0c9bc69f4288fdee22cc546f56bc2f75ecfdebbb
Author: Clément Foucault
Date:   Sun Apr 8 14:29:49 2018 +0200
Branches: blender2.8
https://developer.blender.org/rB0c9bc69f4288fdee22cc546f56bc2f75ecfdebbb

DRW: Profiling: Batch BLF strings and add shadowing

Shadows makes it more readable and are relatively cheap now.

===================================================================

M	source/blender/draw/intern/draw_manager_profiling.c

===================================================================

diff --git a/source/blender/draw/intern/draw_manager_profiling.c b/source/blender/draw/intern/draw_manager_profiling.c
index 47769b1fb18..d2ed22c57b7 100644
--- a/source/blender/draw/intern/draw_manager_profiling.c
+++ b/source/blender/draw/intern/draw_manager_profiling.c
@@ -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);
 }



More information about the Bf-blender-cvs mailing list