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