For some dest of memory copy action, they don't need to initialize.
And previous Dali::Vector.Resize action repeat PushBack().
This patch replace these resize action as ResizeUninitialized() function.
That function just Reserve + SetCount so don't initialize data internally.
Most of memory-related jobs don't care about the number of items
Inside of Dali::Vector. So it is effective
It make jpg image load more faster
Change-Id: I0c429e73ad20469384910df971d8922b53fc9192
Signed-off-by: Eunki, Hong <eunkiki.hong@samsung.com>
NULL, // Pclist_y. Optional pointers to contributor lists from another instance of a Resampler.
FILTER_SCALE, // src_x_ofs,
FILTER_SCALE); // src_y_ofs. Offset input image by specified amount (fractional values okay).
- samples[0].Resize(srcWidth);
+ samples[0].ResizeUninitialized(srcWidth);
for(int i = 1; i < numChannels; ++i)
{
resamplers[i] = new Resampler(srcWidth,
resamplers[0]->get_clist_y(),
FILTER_SCALE,
FILTER_SCALE);
- samples[i].Resize(srcWidth);
+ samples[i].ResizeUninitialized(srcWidth);
}
const int srcPitch = srcWidth * numChannels;
{
return false;
}
- map.Resize(fsize);
+ map.ResizeUninitialized(fsize);
if(fread(&map[0], 1, fsize, fp) != fsize)
{
}
// Set up the surface as soon as we have the width and height, so we have a black image if there are any further errors.
- surface.Resize(w * h * 4);
+ surface.ResizeUninitialized(w * h * 4);
memset(&surface[0], 0, w * h * 4);
if(!read_ushort(&map[0], fsize, &position, &word))
unsigned int bitStride = ((w + 31) / 32) * 4;
// Pixbuf only ever contains one scanline worth of data.
- pixbuf.Resize(stride);
- maskbuf.Resize(bitStride * h);
+ pixbuf.ResizeUninitialized(stride);
+ maskbuf.ResizeUninitialized(bitStride * h);
// Handle different bits-per-pixel.
if(!HandleBitsPerPixel(bitcount, map, pix, surface, w, h, fsize, position, pixbuf, stride, pal))
{
using PixelT = PixelType<N>;
Vector<PixelT> data;
- data.Resize(width * height);
+ data.ResizeUninitialized(width * height);
auto dataPtr = data.Begin();
auto original = reinterpret_cast<PixelT*>(buffer);
{
using PixelT = PixelType<N>;
Vector<PixelT> data;
- data.Resize(width * height);
+ data.ResizeUninitialized(width * height);
auto dataPtr = data.Begin();
auto original = reinterpret_cast<PixelT*>(buffer);
{
using PixelT = PixelType<N>;
Vector<PixelT> data;
- data.Resize(width * height);
+ data.ResizeUninitialized(width * height);
auto dataPtr = data.Begin();
auto original = reinterpret_cast<PixelT*>(buffer);
{
using PixelT = PixelType<N>;
Vector<PixelT> data;
- data.Resize(width * height);
+ data.ResizeUninitialized(width * height);
auto dataPtr = data.Begin();
auto original = reinterpret_cast<PixelT*>(buffer);
Vector<unsigned char> jpegBuffer;
try
{
- jpegBuffer.Resize(jpegBufferSize);
+ jpegBuffer.ResizeUninitialized(jpegBufferSize);
}
catch(...)
{
#else
if(tjDecompressHeader2(jpeg.get(), jpegBufferPtr, jpegBufferSize, &preXformImageWidth, &preXformImageHeight, &chrominanceSubsampling) == -1)
{
- DALI_LOG_ERROR("%s\n", tjGetErrorStr());
+ //DALI_LOG_ERROR("%s\n", tjGetErrorStr());
// Do not set width and height to 0 or return early as this sometimes fails only on determining subsampling type.
}
#endif
return false;
}
- encodedPixels.Resize(dstBufferSize);
+ encodedPixels.ResizeUninitialized(dstBufferSize);
memcpy(encodedPixels.Begin(), dstBuffer.get(), dstBufferSize);
}
return true;
DALI_LOG_ERROR("Error: WBMP size is too large!\n");
return false;
}
- map.Resize(fsize);
+ map.ResizeUninitialized(fsize);
if(fread(&map[0], 1, fsize, fp) != fsize)
{
return false;
}
- surface.Resize(w * h); //(w * h * 4);
- memset(&surface[0], 0, w * h); // w * h * 4
+ surface.ResizeUninitialized(w * h); //(w * h * 4);
+ memset(&surface[0], 0, w * h); // w * h * 4
line_length = (w + 7) >> 3;
for(y = 0; y < h; y++)
unsigned int headerSize = 1 + 1 + 4 + 4; // 8 + 8 + 32 + 32;
headerSize = std::min(headerSize, fsize);
- map.Resize(headerSize);
+ map.ResizeUninitialized(headerSize);
if(fread(&map[0], 1, headerSize, fp) != headerSize)
{
DALI_LOG_WARNING("image file read opeation error!\n");