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>2019-04-22 02:09:06 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-04-22 12:48:16 +0300
commit67454a282d701a852464785f18dd9589d983b3a1 (patch)
tree468ee4d38089c9e078352ddc1eebd46157dd2934 /source/blender/blenfont/intern/blf_glyph.c
parentf24bb62fc2b869f0798a98400ac488d6d6067b71 (diff)
Cleanup: style, use braces for blenfont
Diffstat (limited to 'source/blender/blenfont/intern/blf_glyph.c')
-rw-r--r--source/blender/blenfont/intern/blf_glyph.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/source/blender/blenfont/intern/blf_glyph.c b/source/blender/blenfont/intern/blf_glyph.c
index 8f9db604434..049af7678d5 100644
--- a/source/blender/blenfont/intern/blf_glyph.c
+++ b/source/blender/blenfont/intern/blf_glyph.c
@@ -63,8 +63,9 @@ KerningCacheBLF *blf_kerning_cache_find(FontBLF *font)
p = (KerningCacheBLF *)font->kerning_caches.first;
while (p) {
- if (p->mode == font->kerning_mode)
+ if (p->mode == font->kerning_mode) {
return p;
+ }
p = p->next;
}
return NULL;
@@ -120,8 +121,9 @@ GlyphCacheBLF *blf_glyph_cache_find(FontBLF *font, unsigned int size, unsigned i
p = (GlyphCacheBLF *)font->cache.first;
while (p) {
- if (p->size == size && p->dpi == dpi)
+ if (p->size == size && p->dpi == dpi) {
return p;
+ }
p = p->next;
}
return NULL;
@@ -254,8 +256,9 @@ GlyphBLF *blf_glyph_search(GlyphCacheBLF *gc, unsigned int c)
key = blf_hash(c);
p = gc->bucket[key].first;
while (p) {
- if (p->c == c)
+ if (p->c == c) {
return p;
+ }
p = p->next;
}
return NULL;
@@ -271,8 +274,9 @@ GlyphBLF *blf_glyph_add(FontBLF *font, unsigned int index, unsigned int c)
unsigned int key;
g = blf_glyph_search(font->glyph_cache, c);
- if (g)
+ if (g) {
return g;
+ }
/* glyphs are dynamically created as needed by font rendering. this means that
* to make font rendering thread safe we have to do locking here. note that this
@@ -388,8 +392,9 @@ void blf_glyph_free(GlyphBLF *g)
/* don't need free the texture, the GlyphCache already
* have a list of all the texture and free it.
*/
- if (g->bitmap)
+ if (g->bitmap) {
MEM_freeN(g->bitmap);
+ }
MEM_freeN(g);
}
@@ -480,14 +485,16 @@ static void blf_glyph_calc_rect_shadow(rctf *rect, GlyphBLF *g, float x, float y
void blf_glyph_render(FontBLF *font, GlyphBLF *g, float x, float y)
{
- if ((!g->width) || (!g->height))
+ if ((!g->width) || (!g->height)) {
return;
+ }
if (g->build_tex == 0) {
GlyphCacheBLF *gc = font->glyph_cache;
- if (font->tex_size_max == -1)
+ if (font->tex_size_max == -1) {
font->tex_size_max = GPU_max_texture_size();
+ }
if (gc->texture_current == BLF_TEXTURE_UNSET) {
blf_glyph_cache_texture(font, gc);