diff options
author | mano-wii <germano.costa@ig.com.br> | 2020-02-14 17:25:41 +0300 |
---|---|---|
committer | mano-wii <germano.costa@ig.com.br> | 2020-02-14 17:25:41 +0300 |
commit | a21f5ec56245f7f1fbede4aa3c140a582c3a6a1b (patch) | |
tree | c648f2d534be9e256930fae0ceb52378fd38cc94 /source/blender/blenfont | |
parent | d6d44ccc7786e36d9453a8e24cdc89f159bdd4ab (diff) |
Fix T73763: Laggy with nodes Editor + International Fonts
Two main reasons for the lag:
- Allocation of memory with transfer to GPU.
- BLF_cache_clear();
The memory allocation seems to be unnecessary, so I removed it.
Reviewed By: brecht
Differential Revision: https://developer.blender.org/D6837
Diffstat (limited to 'source/blender/blenfont')
-rw-r--r-- | source/blender/blenfont/intern/blf_glyph.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/source/blender/blenfont/intern/blf_glyph.c b/source/blender/blenfont/intern/blf_glyph.c index 535366b78fa..ba464c76bd1 100644 --- a/source/blender/blenfont/intern/blf_glyph.c +++ b/source/blender/blenfont/intern/blf_glyph.c @@ -265,11 +265,9 @@ static void blf_glyph_cache_texture(FontBLF *font, GlyphCacheBLF *gc) gc->p2_height = font->tex_size_max; } - unsigned char *pixels = MEM_callocN((size_t)gc->p2_width * (size_t)gc->p2_height, - "BLF texture init"); GPUTexture *tex = GPU_texture_create_nD( - gc->p2_width, gc->p2_height, 0, 2, pixels, GPU_R8, GPU_DATA_UNSIGNED_BYTE, 0, false, error); - MEM_freeN(pixels); + gc->p2_width, gc->p2_height, 0, 2, NULL, GPU_R8, GPU_DATA_UNSIGNED_BYTE, 0, false, error); + gc->textures[gc->texture_current] = tex; GPU_texture_bind(tex, 0); GPU_texture_wrap_mode(tex, false); |