bool cropToMask = false;
if(maskInfo && maskInfo->mAlphaMaskUrl.IsValid())
{
- maskInfo->mAlphaMaskId = RequestMaskLoad(maskInfo->mAlphaMaskUrl, maskInfo->mPreappliedMasking ? StorageType::KEEP_PIXEL_BUFFER : StorageType::KEEP_TEXTURE);
+ RequestMaskLoad(maskInfo->mAlphaMaskUrl, maskInfo->mPreappliedMasking ? StorageType::KEEP_PIXEL_BUFFER : StorageType::KEEP_TEXTURE, maskInfo->mAlphaMaskId);
alphaMaskId = maskInfo->mAlphaMaskId;
contentScaleFactor = maskInfo->mContentScaleFactor;
cropToMask = maskInfo->mCropToMask;
loadingStatus = true;
auto preMultiply = TextureManager::MultiplyOnLoad::LOAD_WITHOUT_MULTIPLY;
- textureId = RequestLoadInternal(animatedImageLoading.GetUrl(),
- alphaMaskId,
- contentScaleFactor,
- cropToMask,
- desiredSize,
- FittingMode::SCALE_TO_FILL,
- samplingMode,
- TextureManager::NO_ATLAS,
- StorageType::UPLOAD_TO_TEXTURE,
- textureObserver,
- true,
- TextureManager::ReloadPolicy::CACHED,
- preMultiply,
- animatedImageLoading,
- frameIndex,
- useCache,
- false);
+ RequestLoadInternal(animatedImageLoading.GetUrl(),
+ alphaMaskId,
+ contentScaleFactor,
+ cropToMask,
+ desiredSize,
+ FittingMode::SCALE_TO_FILL,
+ samplingMode,
+ TextureManager::NO_ATLAS,
+ StorageType::UPLOAD_TO_TEXTURE,
+ textureObserver,
+ true,
+ TextureManager::ReloadPolicy::CACHED,
+ preMultiply,
+ animatedImageLoading,
+ frameIndex,
+ useCache,
+ false,
+ textureId);
TextureManager::LoadState loadState = GetTextureStateInternal(textureId);
if(loadState == TextureManager::LoadState::UPLOADED)
}
else
{
- RequestLoadInternal(url, INVALID_TEXTURE_ID, 1.0f, false, desiredSize, fittingMode, samplingMode, TextureManager::NO_ATLAS, StorageType::RETURN_PIXEL_BUFFER, textureObserver, orientationCorrection, TextureManager::ReloadPolicy::FORCED, preMultiplyOnLoad, Dali::AnimatedImageLoading(), 0u, false, false);
+ TextureManager::TextureId textureId = INVALID_TEXTURE_ID;
+ RequestLoadInternal(url, INVALID_TEXTURE_ID, 1.0f, false, desiredSize, fittingMode, samplingMode, TextureManager::NO_ATLAS, StorageType::RETURN_PIXEL_BUFFER, textureObserver, orientationCorrection, TextureManager::ReloadPolicy::FORCED, preMultiplyOnLoad, Dali::AnimatedImageLoading(), 0u, false, false, textureId);
}
return pixelBuffer;
atlasingStatus = false;
if(!maskInfo || !maskInfo->mAlphaMaskUrl.IsValid())
{
- textureId = RequestLoad(url, desiredSize, fittingMode, samplingMode, TextureManager::NO_ATLAS, textureObserver, orientationCorrection, reloadPolicy, preMultiplyOnLoad);
+ RequestLoad(url, desiredSize, fittingMode, samplingMode, TextureManager::NO_ATLAS, textureObserver, orientationCorrection, reloadPolicy, preMultiplyOnLoad, textureId);
}
else
{
- maskInfo->mAlphaMaskId = RequestMaskLoad(maskInfo->mAlphaMaskUrl, maskInfo->mPreappliedMasking ? StorageType::KEEP_PIXEL_BUFFER : StorageType::KEEP_TEXTURE);
- textureId = RequestLoad(url,
- maskInfo->mAlphaMaskId,
- maskInfo->mContentScaleFactor,
- desiredSize,
- fittingMode,
- samplingMode,
- TextureManager::NO_ATLAS,
- maskInfo->mCropToMask,
- textureObserver,
- orientationCorrection,
- reloadPolicy,
- preMultiplyOnLoad);
+ RequestMaskLoad(maskInfo->mAlphaMaskUrl, maskInfo->mPreappliedMasking ? StorageType::KEEP_PIXEL_BUFFER : StorageType::KEEP_TEXTURE, maskInfo->mAlphaMaskId);
+ RequestLoad(url,
+ maskInfo->mAlphaMaskId,
+ maskInfo->mContentScaleFactor,
+ desiredSize,
+ fittingMode,
+ samplingMode,
+ TextureManager::NO_ATLAS,
+ maskInfo->mCropToMask,
+ textureObserver,
+ orientationCorrection,
+ reloadPolicy,
+ preMultiplyOnLoad,
+ textureId);
}
TextureManager::LoadState loadState = GetTextureStateInternal(textureId);
return textureSet;
}
-TextureManager::TextureId TextureManager::RequestLoad(
+void TextureManager::RequestLoad(
const VisualUrl& url,
const ImageDimensions desiredSize,
FittingMode::Type fittingMode,
TextureUploadObserver* observer,
bool orientationCorrection,
TextureManager::ReloadPolicy reloadPolicy,
- TextureManager::MultiplyOnLoad& preMultiplyOnLoad)
+ TextureManager::MultiplyOnLoad& preMultiplyOnLoad,
+ TextureId& textureId)
{
- return RequestLoadInternal(url, INVALID_TEXTURE_ID, 1.0f, false, desiredSize, fittingMode, samplingMode, useAtlas, StorageType::UPLOAD_TO_TEXTURE, observer, orientationCorrection, reloadPolicy, preMultiplyOnLoad, Dali::AnimatedImageLoading(), 0u, true, true);
+ RequestLoadInternal(url, INVALID_TEXTURE_ID, 1.0f, false, desiredSize, fittingMode, samplingMode, useAtlas, StorageType::UPLOAD_TO_TEXTURE, observer, orientationCorrection, reloadPolicy, preMultiplyOnLoad, Dali::AnimatedImageLoading(), 0u, true, true, textureId);
}
-TextureManager::TextureId TextureManager::RequestLoad(
+void TextureManager::RequestLoad(
const VisualUrl& url,
TextureId maskTextureId,
float contentScale,
TextureUploadObserver* observer,
bool orientationCorrection,
TextureManager::ReloadPolicy reloadPolicy,
- TextureManager::MultiplyOnLoad& preMultiplyOnLoad)
+ TextureManager::MultiplyOnLoad& preMultiplyOnLoad,
+ TextureId& textureId)
{
bool loadYuvPlanes = (maskTextureId == INVALID_TEXTURE_ID) ? true : false;
- return RequestLoadInternal(url, maskTextureId, contentScale, cropToMask, desiredSize, fittingMode, samplingMode, useAtlas, StorageType::UPLOAD_TO_TEXTURE, observer, orientationCorrection, reloadPolicy, preMultiplyOnLoad, Dali::AnimatedImageLoading(), 0u, true, loadYuvPlanes);
+ RequestLoadInternal(url, maskTextureId, contentScale, cropToMask, desiredSize, fittingMode, samplingMode, useAtlas, StorageType::UPLOAD_TO_TEXTURE, observer, orientationCorrection, reloadPolicy, preMultiplyOnLoad, Dali::AnimatedImageLoading(), 0u, true, loadYuvPlanes, textureId);
}
-TextureManager::TextureId TextureManager::RequestMaskLoad(const VisualUrl& maskUrl, StorageType storageType)
+void TextureManager::RequestMaskLoad(const VisualUrl& maskUrl, StorageType storageType, TextureId& textureId)
{
// Use the normal load procedure to get the alpha mask.
auto preMultiply = TextureManager::MultiplyOnLoad::LOAD_WITHOUT_MULTIPLY;
- return RequestLoadInternal(maskUrl, INVALID_TEXTURE_ID, 1.0f, false, ImageDimensions(), FittingMode::SCALE_TO_FILL, SamplingMode::NO_FILTER, NO_ATLAS, storageType, NULL, true, TextureManager::ReloadPolicy::CACHED, preMultiply, Dali::AnimatedImageLoading(), 0u, true, false);
+ RequestLoadInternal(maskUrl, INVALID_TEXTURE_ID, 1.0f, false, ImageDimensions(), FittingMode::SCALE_TO_FILL, SamplingMode::NO_FILTER, NO_ATLAS, storageType, NULL, true, TextureManager::ReloadPolicy::CACHED, preMultiply, Dali::AnimatedImageLoading(), 0u, true, false, textureId);
}
-TextureManager::TextureId TextureManager::RequestLoadInternal(
+void TextureManager::RequestLoadInternal(
const VisualUrl& url,
TextureId maskTextureId,
float contentScale,
Dali::AnimatedImageLoading animatedImageLoading,
uint32_t frameIndex,
bool useCache,
- bool loadYuvPlanes)
+ bool loadYuvPlanes,
+ TextureId& textureId)
{
// First check if the requested Texture is cached.
TextureHash textureHash = INITIAL_CACHE_NUMBER;
cacheIndex = FindCachedTexture(textureHash, url.GetUrl(), desiredSize, fittingMode, samplingMode, useAtlas, storageType, maskTextureId, preMultiplyOnLoad, (animatedImageLoading) ? true : false, cropToMask);
}
- TextureManager::TextureId textureId = INVALID_TEXTURE_ID;
+ textureId = INVALID_TEXTURE_ID;
// Check if the requested Texture exists in the cache.
if(cacheIndex != INVALID_CACHE_INDEX)
{
break;
}
}
-
- // Return the TextureId for which this Texture can now be referenced by externally.
- return textureId;
}
void TextureManager::Remove(const TextureManager::TextureId textureId, TextureUploadObserver* observer)
* @param[in] orientationCorrection Whether to rotate image to match embedded orientation data
* @param[in] reloadPolicy Forces a reload of the texture even if already cached
* @param[in,out] preMultiplyOnLoad True if the image color should be multiplied by it's alpha. Set to false if the image has no alpha channel
- * @return A TextureId to use as a handle to reference this Texture
+ * @param[out] textureId The TextureId to use as a handle to reference this Texture
*/
- TextureId RequestLoad(const VisualUrl& url,
+ void RequestLoad(const VisualUrl& url,
const ImageDimensions desiredSize,
FittingMode::Type fittingMode,
Dali::SamplingMode::Type samplingMode,
TextureUploadObserver* observer,
bool orientationCorrection,
TextureManager::ReloadPolicy reloadPolicy,
- MultiplyOnLoad& preMultiplyOnLoad);
+ MultiplyOnLoad& preMultiplyOnLoad,
+ TextureId& textureId);
/**
* @brief Requests an image load of the given URL, when the texture has
* @param[in] reloadPolicy Forces a reload of the texture even if already cached
* @param[in] preMultiplyOnLoad True if the image color should be multiplied by it's alpha. Set to false if the
* image has no alpha channel
- * @return A TextureId to use as a handle to reference this Texture
+ * @param[out] textureId The TextureId to use as a handle to reference this Texture
*/
- TextureId RequestLoad(const VisualUrl& url,
+ void RequestLoad(const VisualUrl& url,
TextureId maskTextureId,
float contentScale,
const ImageDimensions desiredSize,
TextureUploadObserver* observer,
bool orientationCorrection,
TextureManager::ReloadPolicy reloadPolicy,
- MultiplyOnLoad& preMultiplyOnLoad);
+ MultiplyOnLoad& preMultiplyOnLoad,
+ TextureId& textureId);
/**
* Requests a masking image to be loaded. This mask is not uploaded to GL,
* instead, it is stored in CPU memory, and can be used for CPU blending.
*/
- TextureId RequestMaskLoad(const VisualUrl& maskUrl, StorageType storageType);
+ void RequestMaskLoad(const VisualUrl& maskUrl, StorageType storageType, TextureId& textureId);
/**
* @brief Remove a Texture from the TextureManager.
* there is no alpha
* @param[in] animatedImageLoading The AnimatedImageLoading to load animated image
* @param[in] frameIndex The frame index of a frame to be loaded frame
- * @return A TextureId to use as a handle to reference this Texture
+ * @param[in] useCache True if use cached
+ * @param[in] loadYuvPlanes The YUV Planes
+ * @param[out] textureId The TextureId to use as a handle to reference this Texture
*/
- TextureId RequestLoadInternal(
+ void RequestLoadInternal(
const VisualUrl& url,
TextureId maskTextureId,
float contentScale,
Dali::AnimatedImageLoading animatedImageLoading,
uint32_t frameIndex,
bool useCache,
- bool loadYuvPlanes);
+ bool loadYuvPlanes,
+ TextureId& textureId);
/**
* @brief Get the current state of a texture