Blenfont: Fix texture not being initialized in recent refactor.

Caused some gpus to have issues with the font shadows.

thanks @fclem for helping tracking this one down.
This commit is contained in:
Ray molenkamp 2018-06-22 14:35:32 -06:00
parent 2d7606daa5
commit 575c71b670
Notes: blender-bot 2023-02-14 08:25:14 +01:00
Referenced by issue #55588, BLF Text shadow is broken
Referenced by issue #55596, Crash on mouse right-click on operator button
1 changed files with 3 additions and 1 deletions

View File

@ -238,7 +238,9 @@ static void blf_glyph_cache_texture(FontBLF *font, GlyphCacheBLF *gc)
gc->p2_height = font->tex_size_max;
}
GPUTexture *tex = GPU_texture_create_2D(gc->p2_width, gc->p2_height, GPU_R8, NULL, error);;
unsigned char *pixels = MEM_callocN((size_t)gc->p2_width * (size_t)gc->p2_height, "BLF texture init");
GPUTexture *tex = GPU_texture_create_2D(gc->p2_width, gc->p2_height, GPU_R8, (const float*)pixels, error);
MEM_freeN(pixels);
gc->textures[gc->texture_current] = tex;
GPU_texture_bind(tex, 0);
GPU_texture_wrap_mode(tex, false);