mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-22 14:15:38 +00:00
Made two optimizations in TextureData.
This commit is contained in:
parent
c5a1555de3
commit
14e1b800fa
|
@ -105,8 +105,9 @@ bool TextureData::initSVGFromMemory(const std::string& fileData)
|
||||||
|
|
||||||
nsvgDeleteRasterizer(rast);
|
nsvgDeleteRasterizer(rast);
|
||||||
|
|
||||||
mDataRGBA.insert(mDataRGBA.begin(), tempVector.data(),
|
mDataRGBA.insert(mDataRGBA.begin(), std::make_move_iterator(tempVector.data()),
|
||||||
tempVector.data() + (mWidth * mHeight * 4));
|
std::make_move_iterator(tempVector.data() + (mWidth * mHeight * 4)));
|
||||||
|
tempVector.erase(tempVector.begin(), tempVector.end());
|
||||||
|
|
||||||
ImageIO::flipPixelsVert(mDataRGBA.data(), mWidth, mHeight);
|
ImageIO::flipPixelsVert(mDataRGBA.data(), mWidth, mHeight);
|
||||||
mPendingRasterization = false;
|
mPendingRasterization = false;
|
||||||
|
@ -160,7 +161,8 @@ bool TextureData::initFromRGBA(const unsigned char* dataRGBA, size_t width, size
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
mDataRGBA.reserve(width * height * 4);
|
mDataRGBA.reserve(width * height * 4);
|
||||||
mDataRGBA.insert(mDataRGBA.begin(), dataRGBA, dataRGBA + (width * height * 4));
|
mDataRGBA.insert(mDataRGBA.begin(), std::make_move_iterator(dataRGBA),
|
||||||
|
std::make_move_iterator(dataRGBA + (width * height * 4)));
|
||||||
|
|
||||||
mWidth = static_cast<int>(width);
|
mWidth = static_cast<int>(width);
|
||||||
mHeight = static_cast<int>(height);
|
mHeight = static_cast<int>(height);
|
||||||
|
|
Loading…
Reference in a new issue