mirror of
https://github.com/love2d/love.git
synced 2026-08-18 03:34:23 +02:00
Improved performance and reduced temporary memory usage of love.graphics.newScreenshot and Canvas:getImageData
This commit is contained in:
@@ -45,11 +45,15 @@ ImageData::ImageData(int width, int height)
|
||||
memset(data, 0, width*height*sizeof(pixel));
|
||||
}
|
||||
|
||||
ImageData::ImageData(int width, int height, void *data)
|
||||
ImageData::ImageData(int width, int height, void *data, bool own)
|
||||
{
|
||||
this->width = width;
|
||||
this->height = height;
|
||||
create(width, height, data);
|
||||
|
||||
if (own)
|
||||
this->data = (unsigned char *) data;
|
||||
else
|
||||
create(width, height, data);
|
||||
}
|
||||
|
||||
ImageData::~ImageData()
|
||||
|
||||
Reference in New Issue
Block a user