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
-10
View File
@@ -194,10 +194,7 @@ love::filesystem::FileData *ImageData::encode(FormatHandler::EncodedFormat encod
}
if (encoder != nullptr)
{
thread::Lock lock(mutex);
encodedimage = encoder->encode(rawimage, encodedFormat);
}
if (encoder == nullptr || encodedimage.data == nullptr)
throw love::Exception("No suitable image encoder for the %s pixel format.", getPixelFormatName(format));
@@ -537,8 +534,6 @@ void ImageData::setPixel(int x, int y, const Colorf &c)
if (pixelSetFunction == nullptr)
throw love::Exception("ImageData:setPixel does not currently support the %s pixel format.", getPixelFormatName(format));
Lock lock(mutex);
pixelSetFunction(c, p);
}
@@ -553,8 +548,6 @@ void ImageData::getPixel(int x, int y, Colorf &c) const
if (pixelGetFunction == nullptr)
throw love::Exception("ImageData:getPixel does not currently support the %s pixel format.", getPixelFormatName(format));
Lock lock(mutex);
pixelGetFunction(p, c);
}
@@ -701,9 +694,6 @@ void ImageData::paste(ImageData *src, int dx, int dy, int sx, int sy, int sw, in
if (sy + sh > srcH)
sh = srcH - sy;
Lock lock2(src->mutex);
Lock lock1(mutex);
uint8 *s = (uint8 *) src->getData();
uint8 *d = (uint8 *) getData();