+ // If we need to decompress, create new memory and replace ownership.
+ if(data.compressionType != TextAbstraction::GlyphBufferData::CompressionType::NO_COMPRESSION)
+ {
+ uint8_t* newBuffer = (uint8_t*)malloc(widthOut * heightOut * pixelSize);
+ if(DALI_LIKELY(newBuffer != nullptr))
+ {
+ TextAbstraction::GlyphBufferData::Decompress(data, newBuffer);
+ if(data.isBufferOwned)
+ {
+ // Release previous buffer
+ free(data.buffer);
+ }
+ data.isBufferOwned = true;
+ data.buffer = newBuffer;
+ data.compressionType = TextAbstraction::GlyphBufferData::CompressionType::NO_COMPRESSION;
+ }
+ else
+ {
+ DALI_LOG_ERROR("malloc is failed. request malloc size : %u x %u x %u\n", widthOut, heightOut, pixelSize);
+ }
+ }
+