[meta] Make text rendering code thread-safe, to allow use of Canvas2d text APIs in workers
Categories
(Core :: Layout: Text and Fonts, task, P2)
Tracking
()
People
(Reporter: jfkthame, Unassigned)
References
(Depends on 1 open bug, Blocks 1 open bug)
Details
(Keywords: meta)
To allow OffscreenCanvas to use the full Canvas2d API, including text-rendering methods, we need to allow multithreaded use of the font-loading and text-shaping code.
Unless we make a lot of font-related objects thread-local (which is probably not desirable from a memory footprint point of view, and would lose some of the performance benefits of caching font instances and shaping results), we'll need appropriate locking in a number of places, I think.
Most of the font-related objects are read much more often than written, so when rendering threads are only reading font data they needn't block each other. We can use RWLock
locks so that multiple threads can have simultaneous read access, and only block in the less-common case where something actually needs to be updated.
I propose to file dependent bugs here for the various specific classes that need added locking.
Reporter | ||
Updated•3 years ago
|
Description
•