mirror of
https://github.com/love2d/love.git
synced 2026-08-16 00:02:12 +02:00
ImageData: remove automatic mutex locks.
This commit is contained in:
@@ -192,6 +192,7 @@ GraphicsReadback::Status GraphicsReadback::readbackBuffer(Buffer *buffer, size_t
|
||||
|
||||
if (imageData.get())
|
||||
{
|
||||
// Always lock the mutex since the user can't know when to do it.
|
||||
love::thread::Lock lock(imageData->getMutex());
|
||||
|
||||
if (imageData->getWidth() != rect.w)
|
||||
|
||||
@@ -451,12 +451,6 @@ void Texture::drawLayer(Graphics *gfx, int layer, Quad *q, const Matrix4 &m)
|
||||
|
||||
void Texture::uploadImageData(love::image::ImageDataBase *d, int level, int slice, int x, int y)
|
||||
{
|
||||
love::image::ImageData *id = dynamic_cast<love::image::ImageData *>(d);
|
||||
|
||||
love::thread::EmptyLock lock;
|
||||
if (id != nullptr)
|
||||
lock.setLock(id->getMutex());
|
||||
|
||||
Rect rect = {x, y, d->getWidth(), d->getHeight()};
|
||||
uploadByteData(d->getData(), d->getSize(), level, slice, rect);
|
||||
}
|
||||
|
||||
@@ -68,8 +68,6 @@ GraphicsReadback::GraphicsReadback(love::graphics::Graphics *gfx, ReadbackMethod
|
||||
{
|
||||
void *dest = prepareReadbackDest(size);
|
||||
|
||||
love::thread::Lock lock(imageData->getMutex());
|
||||
|
||||
// Direct readback without copying avoids the need for a staging buffer,
|
||||
// and lowers the system requirements of immediate RT readback.
|
||||
Texture *t = (Texture *) texture;
|
||||
|
||||
Reference in New Issue
Block a user