diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2013-06-28 17:05:15 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2013-06-28 17:05:15 +0400 |
commit | 0d7dbbb6e1fc0bb85d236ca1e04ff966f4ad39c9 (patch) | |
tree | 2bce40d958d1ac50361d6d3c58aab714dbb0a55b /source/blender/blenfont/intern/blf_internal_types.h | |
parent | ca33bea285c1ffe74e9f6d3c6b28d7b26ebc84ab (diff) |
Fix #35884: crash opening .blend with generated color grid image and preview render.
Printing text on the color grid image would initialize font glyphs from a thread at
the same time as the UI, causing conflicts. The freetype glyph renderer needs to be
mutex locked because it uses a shared buffer internally even when rendering for
different fonts. Also needed to change the image generate function to use the render
monospace font to avoid conflicts in blenfont.
What's still weak in the blenfont API is that there is no distinction between a font
and a thread using that font to render with some particular size, style, etc.
Diffstat (limited to 'source/blender/blenfont/intern/blf_internal_types.h')
-rw-r--r-- | source/blender/blenfont/intern/blf_internal_types.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/source/blender/blenfont/intern/blf_internal_types.h b/source/blender/blenfont/intern/blf_internal_types.h index 36294bfe3b5..096ff50a3ca 100644 --- a/source/blender/blenfont/intern/blf_internal_types.h +++ b/source/blender/blenfont/intern/blf_internal_types.h @@ -217,6 +217,9 @@ typedef struct FontBLF { /* freetype2 lib handle. */ FT_Library ft_lib; + /* Mutex lock for library */ + SpinLock *ft_lib_mutex; + /* freetype2 face. */ FT_Face face; |