summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
863460d)
When using enums as bitfields, the Microsoft C++ compiler will generated
shift intructions to when comparing the enum with one of its constants.
As by default enums are signed interegers, the compiler will generated
signed shifts, yielding trash values.
We define the enums in the TextureInfo class as unsigned ints to avoid
this bug.
Change-Id: Icdd49c3b417b09313964c71381b7c8230c844f12
Debug::Filter* gTextureManagerLogFilter = Debug::Filter::New( Debug::NoLogging, false, "LOG_TEXTURE_MANAGER" );
#define GET_LOAD_STATE_STRING( loadState ) \
Debug::Filter* gTextureManagerLogFilter = Debug::Filter::New( Debug::NoLogging, false, "LOG_TEXTURE_MANAGER" );
#define GET_LOAD_STATE_STRING( loadState ) \
- loadState == TextureManager::NOT_STARTED ? "NOT_STARTED" : \
- loadState == TextureManager::LOADING ? "LOADING" : \
- loadState == TextureManager::LOAD_FINISHED ? "LOAD_FINISHED" : \
- loadState == TextureManager::WAITING_FOR_MASK ? "WAITING_FOR_MASK" : \
- loadState == TextureManager::MASK_APPLYING ? "MASK_APPLYING" : \
- loadState == TextureManager::MASK_APPLIED ? "MASK_APPLIED" : \
- loadState == TextureManager::UPLOADED ? "UPLOADED" : \
- loadState == TextureManager::CANCELLED ? "CANCELLED" : \
- loadState == TextureManager::LOAD_FAILED ? "LOAD_FAILED" : "Unknown"
+ loadState == TextureManager::LoadState::NOT_STARTED ? "NOT_STARTED" : \
+ loadState == TextureManager::LoadState::LOADING ? "LOADING" : \
+ loadState == TextureManager::LoadState::LOAD_FINISHED ? "LOAD_FINISHED" : \
+ loadState == TextureManager::LoadState::WAITING_FOR_MASK ? "WAITING_FOR_MASK" : \
+ loadState == TextureManager::LoadState::MASK_APPLYING ? "MASK_APPLYING" : \
+ loadState == TextureManager::LoadState::MASK_APPLIED ? "MASK_APPLIED" : \
+ loadState == TextureManager::LoadState::UPLOADED ? "UPLOADED" : \
+ loadState == TextureManager::LoadState::CANCELLED ? "CANCELLED" : \
+ loadState == TextureManager::LoadState::LOAD_FAILED ? "LOAD_FAILED" : "Unknown"
{
auto preMultiply = TextureManager::MultiplyOnLoad::LOAD_WITHOUT_MULTIPLY;
textureId = RequestLoadInternal( animatedImageLoading.GetUrl(), INVALID_TEXTURE_ID, 1.0f, ImageDimensions(), FittingMode::SCALE_TO_FILL,
{
auto preMultiply = TextureManager::MultiplyOnLoad::LOAD_WITHOUT_MULTIPLY;
textureId = RequestLoadInternal( animatedImageLoading.GetUrl(), INVALID_TEXTURE_ID, 1.0f, ImageDimensions(), FittingMode::SCALE_TO_FILL,
- SamplingMode::BOX_THEN_LINEAR, TextureManager::NO_ATLAS, false, UPLOAD_TO_TEXTURE, textureObserver,
+ SamplingMode::BOX_THEN_LINEAR, TextureManager::NO_ATLAS, false, StorageType::UPLOAD_TO_TEXTURE, textureObserver,
true, TextureManager::ReloadPolicy::CACHED, preMultiply, animatedImageLoading, frameIndex );
TextureManager::LoadState loadState = GetTextureStateInternal( textureId );
true, TextureManager::ReloadPolicy::CACHED, preMultiply, animatedImageLoading, frameIndex );
TextureManager::LoadState loadState = GetTextureStateInternal( textureId );
- if( loadState == TextureManager::UPLOADED )
+ if( loadState == TextureManager::LoadState::UPLOADED )
{
// UploadComplete has already been called - keep the same texture set
textureSet = GetTextureSet( textureId );
{
// UploadComplete has already been called - keep the same texture set
textureSet = GetTextureSet( textureId );
else
{
RequestLoadInternal( url, INVALID_TEXTURE_ID, 1.0f, desiredSize, fittingMode, samplingMode, TextureManager::NO_ATLAS,
else
{
RequestLoadInternal( url, INVALID_TEXTURE_ID, 1.0f, desiredSize, fittingMode, samplingMode, TextureManager::NO_ATLAS,
- false, RETURN_PIXEL_BUFFER, textureObserver, orientationCorrection, TextureManager::ReloadPolicy::FORCED,
+ false, StorageType::RETURN_PIXEL_BUFFER, textureObserver, orientationCorrection, TextureManager::ReloadPolicy::FORCED,
preMultiplyOnLoad, Dali::AnimatedImageLoading(), 0u );
}
preMultiplyOnLoad, Dali::AnimatedImageLoading(), 0u );
}
}
TextureManager::LoadState loadState = GetTextureStateInternal( textureId );
}
TextureManager::LoadState loadState = GetTextureStateInternal( textureId );
- if( loadState == TextureManager::UPLOADED )
+ if( loadState == TextureManager::LoadState::UPLOADED )
{
// UploadComplete has already been called - keep the same texture set
textureSet = GetTextureSet( textureId );
{
// UploadComplete has already been called - keep the same texture set
textureSet = GetTextureSet( textureId );
// If we are loading the texture, or waiting for the ready signal handler to complete, inform
// caller that they need to wait.
// If we are loading the texture, or waiting for the ready signal handler to complete, inform
// caller that they need to wait.
- loadingStatus = ( loadState == TextureManager::LOADING ||
- loadState == TextureManager::WAITING_FOR_MASK ||
- loadState == TextureManager::MASK_APPLYING ||
- loadState == TextureManager::MASK_APPLIED ||
- loadState == TextureManager::NOT_STARTED ||
+ loadingStatus = ( loadState == TextureManager::LoadState::LOADING ||
+ loadState == TextureManager::LoadState::WAITING_FOR_MASK ||
+ loadState == TextureManager::LoadState::MASK_APPLYING ||
+ loadState == TextureManager::LoadState::MASK_APPLIED ||
+ loadState == TextureManager::LoadState::NOT_STARTED ||
TextureManager::MultiplyOnLoad& preMultiplyOnLoad )
{
return RequestLoadInternal( url, INVALID_TEXTURE_ID, 1.0f, desiredSize, fittingMode, samplingMode, useAtlas,
TextureManager::MultiplyOnLoad& preMultiplyOnLoad )
{
return RequestLoadInternal( url, INVALID_TEXTURE_ID, 1.0f, desiredSize, fittingMode, samplingMode, useAtlas,
- false, UPLOAD_TO_TEXTURE, observer, orientationCorrection, reloadPolicy,
+ false, StorageType::UPLOAD_TO_TEXTURE, observer, orientationCorrection, reloadPolicy,
preMultiplyOnLoad, Dali::AnimatedImageLoading(), 0u );
}
preMultiplyOnLoad, Dali::AnimatedImageLoading(), 0u );
}
TextureManager::MultiplyOnLoad& preMultiplyOnLoad )
{
return RequestLoadInternal( url, maskTextureId, contentScale, desiredSize, fittingMode, samplingMode, useAtlas,
TextureManager::MultiplyOnLoad& preMultiplyOnLoad )
{
return RequestLoadInternal( url, maskTextureId, contentScale, desiredSize, fittingMode, samplingMode, useAtlas,
- cropToMask, UPLOAD_TO_TEXTURE, observer, orientationCorrection, reloadPolicy,
+ cropToMask, StorageType::UPLOAD_TO_TEXTURE, observer, orientationCorrection, reloadPolicy,
preMultiplyOnLoad, Dali::AnimatedImageLoading(), 0u );
}
preMultiplyOnLoad, Dali::AnimatedImageLoading(), 0u );
}
// 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, ImageDimensions(), FittingMode::SCALE_TO_FILL,
// 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, ImageDimensions(), FittingMode::SCALE_TO_FILL,
- SamplingMode::NO_FILTER, NO_ATLAS, false, KEEP_PIXEL_BUFFER, NULL, true,
+ SamplingMode::NO_FILTER, NO_ATLAS, false, StorageType::KEEP_PIXEL_BUFFER, NULL, true,
TextureManager::ReloadPolicy::CACHED, preMultiply, Dali::AnimatedImageLoading(), 0u );
}
TextureManager::ReloadPolicy::CACHED, preMultiply, Dali::AnimatedImageLoading(), 0u );
}
// Force reloading of texture by setting loadState unless already loading or cancelled.
if ( TextureManager::ReloadPolicy::FORCED == reloadPolicy &&
// Force reloading of texture by setting loadState unless already loading or cancelled.
if ( TextureManager::ReloadPolicy::FORCED == reloadPolicy &&
- TextureManager::LOADING != textureInfo.loadState &&
- TextureManager::WAITING_FOR_MASK != textureInfo.loadState &&
- TextureManager::MASK_APPLYING != textureInfo.loadState &&
- TextureManager::MASK_APPLIED != textureInfo.loadState &&
- TextureManager::CANCELLED != textureInfo.loadState )
+ TextureManager::LoadState::LOADING != textureInfo.loadState &&
+ TextureManager::LoadState::WAITING_FOR_MASK != textureInfo.loadState &&
+ TextureManager::LoadState::MASK_APPLYING != textureInfo.loadState &&
+ TextureManager::LoadState::MASK_APPLIED != textureInfo.loadState &&
+ TextureManager::LoadState::CANCELLED != textureInfo.loadState )
{
DALI_LOG_INFO( gTextureManagerLogFilter, Debug::Verbose, "TextureManager::RequestLoad( url=%s observer=%p ) ForcedReload cacheIndex:%d, textureId=%d\n",
url.GetUrl().c_str(), observer, cacheIndex, textureId );
{
DALI_LOG_INFO( gTextureManagerLogFilter, Debug::Verbose, "TextureManager::RequestLoad( url=%s observer=%p ) ForcedReload cacheIndex:%d, textureId=%d\n",
url.GetUrl().c_str(), observer, cacheIndex, textureId );
- textureInfo.loadState = TextureManager::NOT_STARTED;
+ textureInfo.loadState = TextureManager::LoadState::NOT_STARTED;
}
// Check if we should add the observer.
// Only do this if we have not loaded yet and it will not have loaded by the end of this method.
switch( textureInfo.loadState )
{
}
// Check if we should add the observer.
// Only do this if we have not loaded yet and it will not have loaded by the end of this method.
switch( textureInfo.loadState )
{
- case TextureManager::LOAD_FAILED: // Failed notifies observer which then stops observing.
- case TextureManager::NOT_STARTED:
+ case TextureManager::LoadState::LOAD_FAILED: // Failed notifies observer which then stops observing.
+ case TextureManager::LoadState::NOT_STARTED:
{
LoadOrQueueTexture( textureInfo, observer ); // If called inside NotifyObservers, queues until afterwards
break;
}
{
LoadOrQueueTexture( textureInfo, observer ); // If called inside NotifyObservers, queues until afterwards
break;
}
- case TextureManager::LOADING:
- case TextureManager::WAITING_FOR_MASK:
- case TextureManager::MASK_APPLYING:
- case TextureManager::MASK_APPLIED:
+ case TextureManager::LoadState::LOADING:
+ case TextureManager::LoadState::WAITING_FOR_MASK:
+ case TextureManager::LoadState::MASK_APPLYING:
+ case TextureManager::LoadState::MASK_APPLIED:
{
ObserveTexture( textureInfo, observer );
break;
}
{
ObserveTexture( textureInfo, observer );
break;
}
- case TextureManager::UPLOADED:
+ case TextureManager::LoadState::UPLOADED:
- case TextureManager::CANCELLED:
+ case TextureManager::LoadState::CANCELLED:
{
// A cancelled texture hasn't finished loading yet. Treat as a loading texture
// (it's ref count has already been incremented, above)
{
// A cancelled texture hasn't finished loading yet. Treat as a loading texture
// (it's ref count has already been incremented, above)
- textureInfo.loadState = TextureManager::LOADING;
+ textureInfo.loadState = TextureManager::LoadState::LOADING;
ObserveTexture( textureInfo, observer );
break;
}
ObserveTexture( textureInfo, observer );
break;
}
- case TextureManager::LOAD_FINISHED:
+ case TextureManager::LoadState::LOAD_FINISHED:
{
// Loading has already completed.
if( observer && textureInfo.storageType == StorageType::RETURN_PIXEL_BUFFER )
{
// Loading has already completed.
if( observer && textureInfo.storageType == StorageType::RETURN_PIXEL_BUFFER )
bool removeTextureInfo = false;
// If loaded, we can remove the TextureInfo and the Atlas (if atlased).
bool removeTextureInfo = false;
// If loaded, we can remove the TextureInfo and the Atlas (if atlased).
- if( textureInfo.loadState == UPLOADED )
+ if( textureInfo.loadState == LoadState::UPLOADED )
{
if( textureInfo.atlas )
{
{
if( textureInfo.atlas )
{
}
removeTextureInfo = true;
}
}
removeTextureInfo = true;
}
- else if( textureInfo.loadState == LOADING )
+ else if( textureInfo.loadState == LoadState::LOADING )
{
// We mark the textureInfo for removal.
// Once the load has completed, this method will be called again.
{
// We mark the textureInfo for removal.
// Once the load has completed, this method will be called again.
- textureInfo.loadState = CANCELLED;
+ textureInfo.loadState = LoadState::CANCELLED;
TextureManager::LoadState TextureManager::GetTextureState( TextureId textureId )
{
TextureManager::LoadState TextureManager::GetTextureState( TextureId textureId )
{
- LoadState loadState = TextureManager::NOT_STARTED;
+ LoadState loadState = TextureManager::LoadState::NOT_STARTED;
int cacheIndex = GetCacheIndexFromId( textureId );
if( cacheIndex != INVALID_CACHE_INDEX )
int cacheIndex = GetCacheIndexFromId( textureId );
if( cacheIndex != INVALID_CACHE_INDEX )
TextureManager::LoadState TextureManager::GetTextureStateInternal( TextureId textureId )
{
TextureManager::LoadState TextureManager::GetTextureStateInternal( TextureId textureId )
{
- LoadState loadState = TextureManager::NOT_STARTED;
+ LoadState loadState = TextureManager::LoadState::NOT_STARTED;
int cacheIndex = GetCacheIndexFromId( textureId );
if( cacheIndex != INVALID_CACHE_INDEX )
int cacheIndex = GetCacheIndexFromId( textureId );
if( cacheIndex != INVALID_CACHE_INDEX )
{
switch( textureInfo.loadState )
{
{
switch( textureInfo.loadState )
{
- case NOT_STARTED:
- case LOAD_FAILED:
+ case LoadState::NOT_STARTED:
+ case LoadState::LOAD_FAILED:
+ case LoadState::UPLOADED:
- case LOADING:
- case CANCELLED:
- case LOAD_FINISHED:
- case WAITING_FOR_MASK:
- case MASK_APPLYING:
- case MASK_APPLIED:
+ case LoadState::LOADING:
+ case LoadState::CANCELLED:
+ case LoadState::LOAD_FINISHED:
+ case LoadState::WAITING_FOR_MASK:
+ case LoadState::MASK_APPLYING:
+ case LoadState::MASK_APPLIED:
DALI_LOG_INFO( gTextureManagerLogFilter, Debug::Concise, "TextureManager::LoadTexture(): url:%s sync:%s\n",
textureInfo.url.GetUrl().c_str(), textureInfo.loadSynchronously?"T":"F" );
DALI_LOG_INFO( gTextureManagerLogFilter, Debug::Concise, "TextureManager::LoadTexture(): url:%s sync:%s\n",
textureInfo.url.GetUrl().c_str(), textureInfo.loadSynchronously?"T":"F" );
- textureInfo.loadState = LOADING;
+ textureInfo.loadState = LoadState::LOADING;
if( !textureInfo.loadSynchronously )
{
auto& loadersContainer = textureInfo.url.IsLocalResource() ? mAsyncLocalLoaders : mAsyncRemoteLoaders;
if( !textureInfo.loadSynchronously )
{
auto& loadersContainer = textureInfo.url.IsLocalResource() ? mAsyncLocalLoaders : mAsyncRemoteLoaders;
if( cacheIndex != INVALID_CACHE_INDEX )
{
TextureInfo& textureInfo( mTextureInfoContainer[cacheIndex] );
if( cacheIndex != INVALID_CACHE_INDEX )
{
TextureInfo& textureInfo( mTextureInfoContainer[cacheIndex] );
- if( textureInfo.loadState == UPLOADED )
+ if( textureInfo.loadState == LoadState::UPLOADED )
{
element.mObserver->UploadComplete( true, textureInfo.textureId, textureInfo.textureSet,
textureInfo.useAtlas, textureInfo.atlasRect,
textureInfo.preMultiplied );
}
{
element.mObserver->UploadComplete( true, textureInfo.textureId, textureInfo.textureSet,
textureInfo.useAtlas, textureInfo.atlasRect,
textureInfo.preMultiplied );
}
- else if ( textureInfo.loadState == LOAD_FINISHED && textureInfo.storageType == StorageType::RETURN_PIXEL_BUFFER )
+ else if ( textureInfo.loadState == LoadState::LOAD_FINISHED && textureInfo.storageType == StorageType::RETURN_PIXEL_BUFFER )
{
element.mObserver->LoadComplete( true, textureInfo.pixelBuffer, textureInfo.url, textureInfo.preMultiplied );
}
{
element.mObserver->LoadComplete( true, textureInfo.pixelBuffer, textureInfo.url, textureInfo.preMultiplied );
}
" textureId:%d Url:%s CacheIndex:%d LoadState: %d\n",
textureInfo.textureId, textureInfo.url.GetUrl().c_str(), cacheIndex, textureInfo.loadState );
" textureId:%d Url:%s CacheIndex:%d LoadState: %d\n",
textureInfo.textureId, textureInfo.url.GetUrl().c_str(), cacheIndex, textureInfo.loadState );
- if( textureInfo.loadState != CANCELLED )
+ if( textureInfo.loadState != LoadState::CANCELLED )
{
// textureInfo can be invalidated after this call (as the mTextureInfoContainer may be modified)
PostLoad( textureInfo, pixelBuffer );
{
// textureInfo can be invalidated after this call (as the mTextureInfoContainer may be modified)
PostLoad( textureInfo, pixelBuffer );
textureInfo.useAtlas = NO_ATLAS;
textureInfo.preMultiplied = pixelBuffer.IsAlphaPreMultiplied();
textureInfo.useAtlas = NO_ATLAS;
textureInfo.preMultiplied = pixelBuffer.IsAlphaPreMultiplied();
- if( textureInfo.storageType == UPLOAD_TO_TEXTURE )
+ if( textureInfo.storageType == StorageType::UPLOAD_TO_TEXTURE )
{
// If there is a mask texture ID associated with this texture, then apply the mask
// if it's already loaded. If it hasn't, and the mask is still loading,
// wait for the mask to finish loading.
if( textureInfo.maskTextureId != INVALID_TEXTURE_ID )
{
{
// If there is a mask texture ID associated with this texture, then apply the mask
// if it's already loaded. If it hasn't, and the mask is still loading,
// wait for the mask to finish loading.
if( textureInfo.maskTextureId != INVALID_TEXTURE_ID )
{
- if( textureInfo.loadState == MASK_APPLYING )
+ if( textureInfo.loadState == LoadState::MASK_APPLYING )
- textureInfo.loadState = MASK_APPLIED;
+ textureInfo.loadState = LoadState::MASK_APPLIED;
UploadTexture( pixelBuffer, textureInfo );
NotifyObservers( textureInfo, true );
}
UploadTexture( pixelBuffer, textureInfo );
NotifyObservers( textureInfo, true );
}
{
LoadState maskLoadState = GetTextureStateInternal( textureInfo.maskTextureId );
textureInfo.pixelBuffer = pixelBuffer; // Store the pixel buffer temporarily
{
LoadState maskLoadState = GetTextureStateInternal( textureInfo.maskTextureId );
textureInfo.pixelBuffer = pixelBuffer; // Store the pixel buffer temporarily
- if( maskLoadState == LOADING )
+ if( maskLoadState == LoadState::LOADING )
- textureInfo.loadState = WAITING_FOR_MASK;
+ textureInfo.loadState = LoadState::WAITING_FOR_MASK;
- else if( maskLoadState == LOAD_FINISHED )
+ else if( maskLoadState == LoadState::LOAD_FINISHED )
{
// Send New Task to Thread
ApplyMask( textureInfo, textureInfo.maskTextureId );
{
// Send New Task to Thread
ApplyMask( textureInfo, textureInfo.maskTextureId );
else
{
textureInfo.pixelBuffer = pixelBuffer; // Store the pixel data
else
{
textureInfo.pixelBuffer = pixelBuffer; // Store the pixel data
- textureInfo.loadState = LOAD_FINISHED;
+ textureInfo.loadState = LoadState::LOAD_FINISHED;
if( textureInfo.storageType == StorageType::RETURN_PIXEL_BUFFER )
{
if( textureInfo.storageType == StorageType::RETURN_PIXEL_BUFFER )
{
else
{
// @todo If the load was unsuccessful, upload the broken image.
else
{
// @todo If the load was unsuccessful, upload the broken image.
- textureInfo.loadState = LOAD_FAILED;
+ textureInfo.loadState = LoadState::LOAD_FAILED;
CheckForWaitingTexture( textureInfo );
NotifyObservers( textureInfo, false );
}
CheckForWaitingTexture( textureInfo );
NotifyObservers( textureInfo, false );
}
for( unsigned int cacheIndex = 0; cacheIndex < size; ++cacheIndex )
{
if( mTextureInfoContainer[cacheIndex].maskTextureId == maskTextureInfo.textureId &&
for( unsigned int cacheIndex = 0; cacheIndex < size; ++cacheIndex )
{
if( mTextureInfoContainer[cacheIndex].maskTextureId == maskTextureInfo.textureId &&
- mTextureInfoContainer[cacheIndex].loadState == WAITING_FOR_MASK )
+ mTextureInfoContainer[cacheIndex].loadState == LoadState::WAITING_FOR_MASK )
{
TextureInfo& textureInfo( mTextureInfoContainer[cacheIndex] );
{
TextureInfo& textureInfo( mTextureInfoContainer[cacheIndex] );
- if( maskTextureInfo.loadState == LOAD_FINISHED )
+ if( maskTextureInfo.loadState == LoadState::LOAD_FINISHED )
{
// Send New Task to Thread
ApplyMask( textureInfo, maskTextureInfo.textureId );
{
// Send New Task to Thread
ApplyMask( textureInfo, maskTextureInfo.textureId );
else
{
textureInfo.pixelBuffer.Reset();
else
{
textureInfo.pixelBuffer.Reset();
- textureInfo.loadState = LOAD_FAILED;
+ textureInfo.loadState = LoadState::LOAD_FAILED;
NotifyObservers( textureInfo, false );
}
}
NotifyObservers( textureInfo, false );
}
}
DALI_LOG_INFO( gTextureManagerLogFilter, Debug::Concise, "TextureManager::ApplyMask(): url:%s sync:%s\n",
textureInfo.url.GetUrl().c_str(), textureInfo.loadSynchronously?"T":"F" );
DALI_LOG_INFO( gTextureManagerLogFilter, Debug::Concise, "TextureManager::ApplyMask(): url:%s sync:%s\n",
textureInfo.url.GetUrl().c_str(), textureInfo.loadSynchronously?"T":"F" );
- textureInfo.loadState = MASK_APPLYING;
+ textureInfo.loadState = LoadState::MASK_APPLYING;
auto& loadersContainer = textureInfo.url.IsLocalResource() ? mAsyncLocalLoaders : mAsyncRemoteLoaders;
auto loadingHelperIt = loadersContainer.GetNext();
auto premultiplyOnLoad = textureInfo.preMultiplyOnLoad ? DevelAsyncImageLoader::PreMultiplyOnLoad::ON : DevelAsyncImageLoader::PreMultiplyOnLoad::OFF;
auto& loadersContainer = textureInfo.url.IsLocalResource() ? mAsyncLocalLoaders : mAsyncRemoteLoaders;
auto loadingHelperIt = loadersContainer.GetNext();
auto premultiplyOnLoad = textureInfo.preMultiplyOnLoad ? DevelAsyncImageLoader::PreMultiplyOnLoad::ON : DevelAsyncImageLoader::PreMultiplyOnLoad::OFF;
// Note: This is regardless of success as we care about whether a
// load attempt is in progress or not. If unsuccessful, a broken
// image is still loaded.
// Note: This is regardless of success as we care about whether a
// load attempt is in progress or not. If unsuccessful, a broken
// image is still loaded.
- textureInfo.loadState = UPLOADED;
+ textureInfo.loadState = LoadState::UPLOADED;
}
void TextureManager::NotifyObservers( TextureInfo& textureInfo, bool success )
}
void TextureManager::NotifyObservers( TextureInfo& textureInfo, bool success )
// Bit-pack the FittingMode, SamplingMode and atlasing.
// FittingMode=2bits, SamplingMode=3bits, useAtlas=1bit, storageType=2bits
// Bit-pack the FittingMode, SamplingMode and atlasing.
// FittingMode=2bits, SamplingMode=3bits, useAtlas=1bit, storageType=2bits
- *hashTargetPtr = ( fittingMode << 6u ) | ( samplingMode << 3 ) | ( useAtlas << 2 ) | storageType;
+ *hashTargetPtr = ( fittingMode << 6u ) | ( samplingMode << 3 ) | ( useAtlas << 2 ) | static_cast<unsigned int>(storageType);
/**
* Whether the pixel data should be kept in TextureManager, returned with pixelBuffer or uploaded for rendering
*/
/**
* Whether the pixel data should be kept in TextureManager, returned with pixelBuffer or uploaded for rendering
*/
+ enum class StorageType: uint8_t
{
KEEP_PIXEL_BUFFER,
RETURN_PIXEL_BUFFER,
{
KEEP_PIXEL_BUFFER,
RETURN_PIXEL_BUFFER,
/**
* Whether the texture should be loaded synchronously or asynchronously.
*/
/**
* Whether the texture should be loaded synchronously or asynchronously.
*/
+ enum class LoadType: uint8_t
{
LOAD_ASYNCHRONOUSLY,
LOAD_SYNCHRONOUSLY
{
LOAD_ASYNCHRONOUSLY,
LOAD_SYNCHRONOUSLY
/**
* @brief The LoadState Enumeration represents the current state of a particular Texture's life-cycle.
*/
/**
* @brief The LoadState Enumeration represents the current state of a particular Texture's life-cycle.
*/
+ enum class LoadState: uint8_t
{
NOT_STARTED, ///< Default
LOADING, ///< Loading has been started, but not finished.
{
NOT_STARTED, ///< Default
LOADING, ///< Loading has been started, but not finished.
hash( hash ),
scaleFactor( scaleFactor ),
referenceCount( 1u ),
hash( hash ),
scaleFactor( scaleFactor ),
referenceCount( 1u ),
- loadState( NOT_STARTED ),
+ loadState( LoadState::NOT_STARTED ),
fittingMode( fittingMode ),
samplingMode( samplingMode ),
fittingMode( fittingMode ),
samplingMode( samplingMode ),
- storageType( UPLOAD_TO_TEXTURE ),
+ storageType( StorageType::UPLOAD_TO_TEXTURE ),
animatedImageLoading( animatedImageLoading ),
frameIndex( frameIndex ),
loadSynchronously( loadSynchronously ),
animatedImageLoading( animatedImageLoading ),
frameIndex( frameIndex ),
loadSynchronously( loadSynchronously ),
TextureManager::TextureHash hash; ///< The hash used to cache this Texture
float scaleFactor; ///< The scale factor to apply to the Texture when masking
int16_t referenceCount; ///< The reference count of clients using this Texture
TextureManager::TextureHash hash; ///< The hash used to cache this Texture
float scaleFactor; ///< The scale factor to apply to the Texture when masking
int16_t referenceCount; ///< The reference count of clients using this Texture
- LoadState loadState:4; ///< The load state showing the load progress of the Texture
+ LoadState loadState; ///< The load state showing the load progress of the Texture
FittingMode::Type fittingMode:3; ///< The requested FittingMode
Dali::SamplingMode::Type samplingMode:3; ///< The requested SamplingMode
FittingMode::Type fittingMode:3; ///< The requested FittingMode
Dali::SamplingMode::Type samplingMode:3; ///< The requested SamplingMode
- StorageType storageType:2; ///< CPU storage / GPU upload;
+ StorageType storageType; ///< CPU storage / GPU upload;
Dali::AnimatedImageLoading animatedImageLoading; ///< AnimatedImageLoading that contains animated image information.
uint32_t frameIndex; ///< frame index that be loaded, in case of animated image
bool loadSynchronously:1; ///< True if synchronous loading was requested
Dali::AnimatedImageLoading animatedImageLoading; ///< AnimatedImageLoading that contains animated image information.
uint32_t frameIndex; ///< frame index that be loaded, in case of animated image
bool loadSynchronously:1; ///< True if synchronous loading was requested