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:
authorBastien Montagne <b.mont29@gmail.com>2020-02-28 12:45:29 +0300
committerBastien Montagne <b.mont29@gmail.com>2020-02-28 12:45:29 +0300
commiteb043d44f26bc8c245f2a3ad42d65ab5626003e4 (patch)
tree40c355a26858d81296da08a06c2a8ec502f55297 /source/blender/blenfont/intern/blf_glyph.c
parent88e1152d4acc2852bb45f0726e27f507a502fbeb (diff)
parent9cac5fa681c55edcf6e856e59e07e90e2ae25965 (diff)
Merge branch 'master' into id-ensure-unique-memory-addressid-ensure-unique-memory-address
Diffstat (limited to 'source/blender/blenfont/intern/blf_glyph.c')
-rw-r--r--source/blender/blenfont/intern/blf_glyph.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/source/blender/blenfont/intern/blf_glyph.c b/source/blender/blenfont/intern/blf_glyph.c
index 8e88bda37a5..3ab6814c531 100644
--- a/source/blender/blenfont/intern/blf_glyph.c
+++ b/source/blender/blenfont/intern/blf_glyph.c
@@ -461,7 +461,7 @@ void blf_glyph_render(FontBLF *font, GlyphCacheBLF *gc, GlyphBLF *g, float x, fl
return;
}
- if (!g->cached) {
+ if (g->glyph_cache == NULL) {
if (font->tex_size_max == -1) {
font->tex_size_max = GPU_max_texture_size();
}
@@ -492,7 +492,7 @@ void blf_glyph_render(FontBLF *font, GlyphCacheBLF *gc, GlyphBLF *g, float x, fl
gc->bitmap_len = bitmap_len;
gc->glyphs_len_free--;
- g->cached = true;
+ g->glyph_cache = gc;
}
if (font->flags & BLF_CLIPPING) {
@@ -505,8 +505,10 @@ void blf_glyph_render(FontBLF *font, GlyphCacheBLF *gc, GlyphBLF *g, float x, fl
}
}
- g_batch.glyph_cache = gc;
- BLI_assert(g->offset < gc->bitmap_len);
+ if (g_batch.glyph_cache != g->glyph_cache) {
+ blf_batch_draw();
+ g_batch.glyph_cache = g->glyph_cache;
+ }
if (font->flags & BLF_SHADOW) {
rctf rect_ofs;