diff options
author | Mike Erwin <significant.bit@gmail.com> | 2016-10-16 02:40:41 +0300 |
---|---|---|
committer | Mike Erwin <significant.bit@gmail.com> | 2016-10-16 02:40:41 +0300 |
commit | a8dc3f4596ef5aed70ceeaa7e3029cb782a0f0ef (patch) | |
tree | 8a25f8bb2cb975acc67704aed72a1c32724eea06 /source/blender/blenfont | |
parent | 878938f203b4a404ad238d63ff1636a6c6067d72 (diff) |
BLF: make blurry text an optional (disabled) feature
While trying to simplify text drawing, noticed no Blender code uses the blur feature. Hopefully scripts don't use it!
Diffstat (limited to 'source/blender/blenfont')
-rw-r--r-- | source/blender/blenfont/BLF_api.h | 6 | ||||
-rw-r--r-- | source/blender/blenfont/intern/blf.c | 2 | ||||
-rw-r--r-- | source/blender/blenfont/intern/blf_font.c | 2 | ||||
-rw-r--r-- | source/blender/blenfont/intern/blf_glyph.c | 5 | ||||
-rw-r--r-- | source/blender/blenfont/intern/blf_internal_types.h | 2 |
5 files changed, 17 insertions, 0 deletions
diff --git a/source/blender/blenfont/BLF_api.h b/source/blender/blenfont/BLF_api.h index 1f38d64924c..3da0434687c 100644 --- a/source/blender/blenfont/BLF_api.h +++ b/source/blender/blenfont/BLF_api.h @@ -34,6 +34,9 @@ #include "BLI_compiler_attrs.h" +/* enable this only if needed (unused circa 2016) */ +#define BLF_BLUR_ENABLE 0 + struct rctf; struct ColorManagedDisplay; struct ResultBLF; @@ -144,7 +147,10 @@ void BLF_rotation(int fontid, float angle); void BLF_clipping(int fontid, float xmin, float ymin, float xmax, float ymax); void BLF_clipping_default(float xmin, float ymin, float xmax, float ymax); void BLF_wordwrap(int fontid, int wrap_width); + +#if BLF_BLUR_ENABLE void BLF_blur(int fontid, int size); +#endif void BLF_enable(int fontid, int option); void BLF_disable(int fontid, int option); diff --git a/source/blender/blenfont/intern/blf.c b/source/blender/blenfont/intern/blf.c index 7ddc540044a..f42057a8475 100644 --- a/source/blender/blenfont/intern/blf.c +++ b/source/blender/blenfont/intern/blf.c @@ -455,6 +455,7 @@ void BLF_size(int fontid, int size, int dpi) } } +#if BLF_BLUR_ENABLE void BLF_blur(int fontid, int size) { FontBLF *font = blf_get(fontid); @@ -463,6 +464,7 @@ void BLF_blur(int fontid, int size) font->blur = size; } } +#endif void BLF_draw_default(float x, float y, float z, const char *str, size_t len) { diff --git a/source/blender/blenfont/intern/blf_font.c b/source/blender/blenfont/intern/blf_font.c index 42717e65d9b..cac3b86b249 100644 --- a/source/blender/blenfont/intern/blf_font.c +++ b/source/blender/blenfont/intern/blf_font.c @@ -951,7 +951,9 @@ static void blf_font_fill(FontBLF *font) font->size = 0; BLI_listbase_clear(&font->cache); font->glyph_cache = NULL; +#if BLF_BLUR_ENABLE font->blur = 0; +#endif font->max_tex_size = -1; font->buf_info.fbuf = NULL; diff --git a/source/blender/blenfont/intern/blf_glyph.c b/source/blender/blenfont/intern/blf_glyph.c index 3d96260f61b..a74210cf961 100644 --- a/source/blender/blenfont/intern/blf_glyph.c +++ b/source/blender/blenfont/intern/blf_glyph.c @@ -490,6 +490,7 @@ void blf_glyph_render(FontBLF *font, GlyphBLF *g, float x, float y) } } +#if BLF_BLUR_ENABLE switch (font->blur) { case 3: blf_texture3_draw(font->orig_col, g->uv, rect.xmin, rect.ymin, rect.xmax, rect.ymax); @@ -501,4 +502,8 @@ void blf_glyph_render(FontBLF *font, GlyphBLF *g, float x, float y) immAttrib4fv(BLF_COLOR_ID, font->orig_col); blf_texture_draw(g->uv, rect.xmin, rect.ymin, rect.xmax, rect.ymax); } +#else + immAttrib4fv(BLF_COLOR_ID, font->orig_col); + blf_texture_draw(g->uv, rect.xmin, rect.ymin, rect.xmax, rect.ymax); +#endif } diff --git a/source/blender/blenfont/intern/blf_internal_types.h b/source/blender/blenfont/intern/blf_internal_types.h index 0fac576a8cc..26d7fd3adac 100644 --- a/source/blender/blenfont/intern/blf_internal_types.h +++ b/source/blender/blenfont/intern/blf_internal_types.h @@ -175,8 +175,10 @@ typedef struct FontBLF { /* angle in radians. */ float angle; +#if BLF_BLUR_ENABLE /* blur: 3 or 5 large kernel */ int blur; +#endif /* shadow level. */ int shadow; |