Aras Pranckevicius 11a99fb2b1 Fix #130463, #114592: VSE prefetching uses wrong font for text strips
Prefetching happens on a background thread by design, and so it was not loading
any fonts and using the default monospace font.

Address this by making all font usage within VSE use "unique" BLF font objects,
and protecting concurrent access to them or their state within VSE itself:

- SeqFontMap structure to hold a mutex, file path -> font ID map (for file
  based fonts), name -> font ID map (for datablock fonts).
- seq_load_font_file, seq_load_font_mem, seq_unload_font that use the above
  instead of calling into BLF directly.
- Text effect rendering part guards with a mutex, so that font render state and
  glyph cache does not get trashed.
- SeqFontMap is global instead of some Scene-specific runtime data (e.g.
  scene->ed), because right now there's a hard max limit of total number of
  fonts (64), and if each copy of the VSE data would start to  load their own
  unique fonts, that limit could get easily reached.
- BLF font loading/unloading code is now thread safe. The rest of BLF drawing
  is still not!

If at some point in the future BLF font usage becomes thread safe, and font
drawing becomes "stateless", this whole machinery can be removed.

Pull Request: https://projects.blender.org/blender/blender/pulls/130542
2024-11-25 12:15:22 +01:00
2024-11-14 18:07:16 +01:00
2024-11-25 13:24:46 +11:00
2023-12-08 13:28:13 +11:00

Blender

Blender is the free and open source 3D creation suite. It supports the entirety of the 3D pipeline-modeling, rigging, animation, simulation, rendering, compositing, motion tracking and video editing.

Blender screenshot

Project Pages

Development

License

Blender as a whole is licensed under the GNU General Public License, Version 3. Individual files may have a different, but compatible license.

See blender.org/about/license for details.

Description
No description provided
Readme 841 MiB
Languages
C++ 78%
Python 14.9%
C 2.9%
GLSL 1.9%
CMake 1.2%
Other 0.9%