Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2011-09-17 14:45:20 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-09-17 14:45:20 +0400
commit100313db6ecec36ad0c8e5b8a8d11bd170ff9349 (patch)
treece9daa0d986c6a5353f770787bd0efffa6cb88b9 /source/blender/blenfont/intern/blf.c
parenta99f2cd01533b79e6e378839d4ee04176f8d47b6 (diff)
Speedup for font drawing, every letter was character was calling:
glGetIntegerv(GL_TEXTURE_2D_BINDING_EXT, &cur_tex); ... with shadow enabled glGetFloatv(GL_CURRENT_COLOR, color) was called twice per character as well. Now only call glGetFloatv(GL_CURRENT_COLOR, ...) once per string and only when drawing with shadow or blur, texture bind is stored in the font. Gives 8% overall FPS speedup when displaying heavy UI in my test.
Diffstat (limited to 'source/blender/blenfont/intern/blf.c')
-rw-r--r--source/blender/blenfont/intern/blf.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/source/blender/blenfont/intern/blf.c b/source/blender/blenfont/intern/blf.c
index fc812d652b3..577697de594 100644
--- a/source/blender/blenfont/intern/blf.c
+++ b/source/blender/blenfont/intern/blf.c
@@ -486,6 +486,13 @@ static void blf_draw__start(FontBLF *font)
if (font->flags & BLF_ROTATION)
glRotatef(font->angle, 0.0f, 0.0f, 1.0f);
+
+ if(font->shadow || font->blur)
+ glGetFloatv(GL_CURRENT_COLOR, font->orig_col);
+
+ /* always bind the texture for the first glyph */
+ font->tex_bind_state= -1;
+
}
static void blf_draw__end(void)