mirror of
https://github.com/love2d/love.git
synced 2026-08-16 08:11:02 +02:00
ImageData: remove automatic mutex locks.
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user