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_internal_types.h
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_internal_types.h')
-rw-r--r--source/blender/blenfont/intern/blf_internal_types.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/source/blender/blenfont/intern/blf_internal_types.h b/source/blender/blenfont/intern/blf_internal_types.h
index 9840e6446ef..1450ad39ad8 100644
--- a/source/blender/blenfont/intern/blf_internal_types.h
+++ b/source/blender/blenfont/intern/blf_internal_types.h
@@ -161,7 +161,10 @@ typedef struct FontBLF {
/* shadow color. */
float shadow_col[4];
-
+
+ /* store color here when drawing shadow or blur. */
+ float orig_col[4];
+
/* Multiplied this matrix with the current one before
* draw the text! see blf_draw__start.
*/
@@ -179,6 +182,9 @@ typedef struct FontBLF {
/* max texture size. */
int max_tex_size;
+ /* current opengl texture bind, avoids calling glGet */
+ int tex_bind_state;
+
/* font options. */
int flags;