Speedup for font drawing, every letter was character was calling:
authorCampbell Barton <ideasman42@gmail.com>
Sat, 17 Sep 2011 10:45:20 +0000 (10:45 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Sat, 17 Sep 2011 10:45:20 +0000 (10:45 +0000)
commit100313db6ecec36ad0c8e5b8a8d11bd170ff9349
treece9daa0d986c6a5353f770787bd0efffa6cb88b9
parenta99f2cd01533b79e6e378839d4ee04176f8d47b6
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.
source/blender/blenfont/intern/blf.c
source/blender/blenfont/intern/blf_glyph.c
source/blender/blenfont/intern/blf_internal_types.h