if(encodedImageBuffer)
{
textureId = targetId;
+
+ // Increase EncodedImageBuffer reference during it contains mTextureInfoContainer.
+ UseExternalResource(url.GetUrl());
+
// Insert this buffer at mTextureInfoContainer.
// This buffer will decode at ImageLoaderThread.
bool preMultiply = (preMultiplyOnLoad == TextureManager::MultiplyOnLoad::MULTIPLY_ON_LOAD);
// If the state allows us to remove the TextureInfo data, we do so.
if(removeTextureInfo)
{
+ // If url location is BUFFER, decrease reference count of EncodedImageBuffer.
+ if(textureInfo.url.IsBufferResource())
+ {
+ RemoveExternalEncodedImageBuffer(textureInfo.url.GetUrl());
+ }
// Permanently remove the textureInfo struct.
mTextureInfoContainer.erase(mTextureInfoContainer.begin() + textureInfoIndex);
}
DevelAsyncImageLoader::PreMultiplyOnLoad preMultiplyOnLoad)
{
mLoadingInfoContainer.push_back(AsyncLoadingInfo(textureId));
- auto id = GetImplementation(mLoader).Load(url, desiredSize, fittingMode, samplingMode, orientationCorrection, preMultiplyOnLoad);
- mLoadingInfoContainer.back().loadId = id;
+ if(DALI_UNLIKELY(url.IsBufferResource()))
+ {
+ auto id = GetImplementation(mLoader).LoadEncodedImageBuffer(mTextureManager.GetEncodedImageBuffer(url.GetUrl()), desiredSize, fittingMode, samplingMode, orientationCorrection, preMultiplyOnLoad);
+ mLoadingInfoContainer.back().loadId = id;
+ }
+ else
+ {
+ auto id = GetImplementation(mLoader).Load(url, desiredSize, fittingMode, samplingMode, orientationCorrection, preMultiplyOnLoad);
+ mLoadingInfoContainer.back().loadId = id;
+ }
}
void TextureManager::AsyncLoadingHelper::ApplyMask(TextureId textureId,