ImageData: remove automatic mutex locks.

This commit is contained in:
Sasha Szpakowski
2024-02-18 17:06:40 -04:00
parent d880c48502
commit 007090af14
9 changed files with 25 additions and 123 deletions
+1
View File
@@ -343,6 +343,7 @@ GlyphData *BMFontRasterizer::getGlyphDataForIndex(int index) const
uint8 *pixels = (uint8 *) g->getData();
const uint8 *ipixels = (const uint8 *) imagedata->getData();
// Always lock the mutex since the user can't know when to do it.
love::thread::Lock lock(imagedata->getMutex());
// Copy the subsection of the texture from the ImageData to the GlyphData.
+1 -4
View File
@@ -90,7 +90,7 @@ GlyphData *ImageRasterizer::getGlyphDataForIndex(int index) const
if (gm.width == 0)
return g;
// We don't want another thread modifying our ImageData mid-copy.
// Always lock the mutex since the user can't know when to do it.
love::thread::Lock lock(imageData->getMutex());
Color32 *gdpixels = (Color32 *) g->getData();
@@ -118,9 +118,6 @@ void ImageRasterizer::load(const uint32 *glyphs, int glyphcount)
int imgw = imageData->getWidth();
int imgh = imageData->getHeight();
// We don't want another thread modifying our ImageData mid-parse.
love::thread::Lock lock(imageData->getMutex());
// Set the only metric that matters
metrics.height = imgh;