atlasRectSize,
atlasingStatus,
loadingStatus,
- WrapMode::DEFAULT,
- WrapMode::DEFAULT,
&observer,
atlasUploadObserver,
atlasManager,
atlasRectSize,
atlasingStatus,
loadingStatus,
- WrapMode::DEFAULT,
- WrapMode::DEFAULT,
&observer,
atlasUploadObserver,
atlasManager,
atlasRectSize,
atlasingStatus,
loadingStatus,
- WrapMode::DEFAULT,
- WrapMode::DEFAULT,
&observer,
atlasUploadObserver,
atlasManager,
atlasRectSize,
atlasingStatus,
loadingStatus,
- WrapMode::DEFAULT,
- WrapMode::DEFAULT,
&observer,
atlasUploadObserver,
atlasManager,
atlasRectSize,
atlasingStatus,
loadingStatus,
- WrapMode::DEFAULT,
- WrapMode::DEFAULT,
&observer,
atlasUploadObserver,
atlasManager,
atlasRectSize,
atlasingStatus,
loadingStatus,
- WrapMode::DEFAULT,
- WrapMode::DEFAULT,
&asyncObserver,
atlasUploadObserver,
atlasManager,
atlasRectSize,
atlasingStatus,
asyncLoadingStatus1,
- WrapMode::DEFAULT,
- WrapMode::DEFAULT,
&asyncObserver1,
atlasUploadObserver,
atlasManager,
atlasRectSize,
atlasingStatus,
syncLoadingStatus,
- WrapMode::DEFAULT,
- WrapMode::DEFAULT,
&syncObserver,
atlasUploadObserver,
atlasManager,
atlasRectSize,
atlasingStatus,
asyncLoadingStatus2,
- WrapMode::DEFAULT,
- WrapMode::DEFAULT,
&asyncObserver2,
atlasUploadObserver,
atlasManager,
DALI_TEST_EQUALS(asyncLoadingStatus2, false, TEST_LOCATION); // texture is loaded by previous sync request
DALI_TEST_CHECK(asyncTextureSet2); // texture is loaded
- DALI_TEST_CHECK(asyncTextureSet2 == syncTextureSet); // check loaded two texture is same.
+ Texture syncTexture = syncTextureSet.GetTexture(0u);
+ Texture asyncTexture2 = asyncTextureSet2.GetTexture(0u);
+ DALI_TEST_CHECK(syncTexture);
+ DALI_TEST_CHECK(asyncTexture2);
+ DALI_TEST_CHECK(asyncTexture2 == syncTexture); // check loaded two texture is same.
// observer is called synchronously because the texture is cached.
DALI_TEST_EQUALS(asyncObserver2.mLoaded, true, TEST_LOCATION);
DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION);
DALI_TEST_EQUALS(asyncObserver1.mLoaded, true, TEST_LOCATION);
DALI_TEST_EQUALS(asyncObserver1.mObserverCalled, true, TEST_LOCATION);
- DALI_TEST_CHECK(asyncObserver1.mTextureSet == asyncTextureSet2); // check loaded two texture is same.
+ DALI_TEST_CHECK(asyncObserver1.mTextureSet);
+
+ Texture observerTexture = asyncObserver1.mTextureSet.GetTexture(0u);
+ DALI_TEST_CHECK(observerTexture == asyncTexture2); // check loaded two texture is same.
// asyncObserver2 was already called so it isn't called here.
DALI_TEST_EQUALS(asyncObserver2.mLoaded, false, TEST_LOCATION);
atlasRectSize,
atlasingStatus,
loadingStatus,
- WrapMode::DEFAULT,
- WrapMode::DEFAULT,
&observer1,
atlasUploadObserver,
atlasManager,
DALI_TEST_EQUALS(textureTrace.FindMethod("GenTextures"), true, TEST_LOCATION);
textureTrace.Reset();
- // Ensure TextureSet is same after detach/attach on stage when texture used the DESTROYED release policy
- // 1. Get TextureSet
- TextureSet textureSetBefore = actor.GetRendererAt(0u).GetTextures();
+ // Ensure Texture is same after detach/attach on stage when texture used the DESTROYED release policy
+ // 1. Get Texture
+ Texture textureBefore = actor.GetRendererAt(0u).GetTextures().GetTexture(0u);
// 2.Remove actor from stage. In this case, renderer also is deleted.
tet_infoline("Remove actor from stage");
DALI_TEST_EQUALS(textureTrace.CountMethod("GenTextures"), 0, TEST_LOCATION);
textureTrace.Reset();
- // 4.Compare Texture with before and after. textureSet need to be same because release policy is the DESTROYED.
- tet_infoline("Ensure a textureSet is not deleted because it is used the DESTROYED release policy");
- TextureSet textureSetAfter = actor.GetRendererAt(0u).GetTextures();
- DALI_TEST_CHECK(textureSetBefore == textureSetAfter);
- textureSetBefore.Reset();
- textureSetAfter.Reset();
+ // 4.Compare Texture with before and after. texture need to be same because release policy is the DESTROYED.
+ tet_infoline("Ensure a texture is not deleted because it is used the DESTROYED release policy");
+ Texture textureAfter = actor.GetRendererAt(0u).GetTextures().GetTexture(0u);
+ DALI_TEST_CHECK(textureBefore == textureAfter);
+ textureBefore.Reset();
+ textureAfter.Reset();
dummyImpl.UnregisterVisual(DummyControl::Property::TEST_VISUAL);
DALI_TEST_CHECK(actor.GetRendererCount() == 0u);
return loadState;
}
-TextureSet TextureCacheManager::GetTextureSet(const TextureCacheManager::TextureId& textureId)
+Texture TextureCacheManager::GetTexture(const TextureCacheManager::TextureId& textureId, uint32_t textureIndex)
{
- TextureSet textureSet; // empty handle
- TextureCacheIndex cacheIndex = static_cast<TextureCacheIndex>(mTextureIdConverter[static_cast<std::uint32_t>(textureId)]);
+ Texture texture; // empty handle
+ TextureCacheIndex cacheIndex = GetCacheIndexFromId(textureId);
switch(static_cast<TextureCacheIndexType>(cacheIndex.detailValue.type))
{
case TextureCacheIndexType::TEXTURE_CACHE_INDEX_TYPE_LOCAL:
{
TextureInfo& cachedTextureInfo(mTextureInfoContainer[cacheIndex.GetIndex()]);
- textureSet = cachedTextureInfo.textureSet;
- break;
- }
- case TextureCacheIndexType::TEXTURE_CACHE_INDEX_TYPE_TEXTURE:
- {
- textureSet = mExternalTextures[cacheIndex.GetIndex()].textureSet;
+ if(textureIndex < static_cast<uint32_t>(cachedTextureInfo.textures.size()))
+ {
+ texture = cachedTextureInfo.textures[textureIndex];
+ }
break;
}
default:
}
}
- return textureSet;
+ return texture;
}
TextureSet TextureCacheManager::GetExternalTextureSet(const TextureCacheManager::TextureId& textureId)
/**
* @brief Get the current state of a texture
* @note This API doesn't consider encodedimagebuffer.
- * @param[in] textureId The texture id to query
+ * @param[in] textureId The texture id to query.defaul value is 0.
* @return The loading state if the texture is valid, or NOT_STARTED if the textureId
* is not valid.
*/
/**
* @brief Get the associated texture set if the texture id is valid
* @param[in] textureId The texture Id to look up
- * @return the associated texture set, or an empty handle if textureId is not valid
+ * @param[in] textureIndex The texture index to query
+ * @return the associated texture, or an empty handle if textureId is not valid
*/
- TextureSet GetTextureSet(const TextureCacheManager::TextureId& textureId);
+ Texture GetTexture(const TextureCacheManager::TextureId& textureId, uint32_t textureIndex = 0);
/**
* @brief Get the external texture set if the texture id is valid
constexpr auto DEFAULT_NUMBER_OF_LOCAL_LOADER_THREADS = size_t{4u};
constexpr auto DEFAULT_NUMBER_OF_REMOTE_LOADER_THREADS = size_t{8u};
+constexpr auto TEXTURE_INDEX = 0u; ///< The Index for texture
+constexpr auto MASK_TEXTURE_INDEX = 1u; ///< The Index for mask texture
+
constexpr auto NUMBER_OF_LOCAL_LOADER_THREADS_ENV = "DALI_TEXTURE_LOCAL_THREADS";
constexpr auto NUMBER_OF_REMOTE_LOADER_THREADS_ENV = "DALI_TEXTURE_REMOTE_THREADS";
constexpr auto LOAD_IMAGE_YUV_PLANES_ENV = "DALI_LOAD_IMAGE_YUV_PLANES";
TextureManager::TextureId& textureId,
MaskingDataPointer& maskInfo,
const Dali::SamplingMode::Type& samplingMode,
- const Dali::WrapMode::Type& wrapModeU,
- const Dali::WrapMode::Type& wrapModeV,
const bool& synchronousLoading,
TextureUploadObserver* textureObserver,
TextureManager::MultiplyOnLoad& preMultiplyOnLoad)
Texture texture = Texture::New(Dali::TextureType::TEXTURE_2D, pixelData.GetPixelFormat(), pixelData.GetWidth(), pixelData.GetHeight());
texture.Upload(pixelData);
textureSet = TextureSet::New();
- textureSet.SetTexture(0u, texture);
+ textureSet.SetTexture(TEXTURE_INDEX, texture);
if(maskTexture)
{
- textureSet.SetTexture(1u, maskTexture);
+ textureSet.SetTexture(MASK_TEXTURE_INDEX, maskTexture);
}
}
}
}
}
- if(textureSet)
- {
- Sampler sampler = Sampler::New();
- sampler.SetWrapMode(wrapModeU, wrapModeV);
- textureSet.SetSampler(0u, sampler);
- }
-
return textureSet;
}
Dali::ImageDimensions& textureRectSize,
bool& atlasingStatus,
bool& loadingStatus,
- const Dali::WrapMode::Type& wrapModeU,
- const Dali::WrapMode::Type& wrapModeV,
TextureUploadObserver* textureObserver,
AtlasUploadObserver* atlasObserver,
ImageAtlasManagerPtr imageAtlasManager,
if(loadState == TextureManager::LoadState::UPLOADED)
{
// LoadComplete has already been called - keep the same texture set
- textureSet = mTextureCacheManager.GetTextureSet(textureId);
+ textureSet = GetTextureSet(textureId);
}
// If we are loading the texture, or waiting for the ready signal handler to complete, inform
}
}
- if(!atlasingStatus && textureSet)
- {
- Sampler sampler = Sampler::New();
- sampler.SetWrapMode(wrapModeU, wrapModeV);
- textureSet.SetSampler(0u, sampler);
- }
-
if(synchronousLoading)
{
loadingStatus = false;
{
if(mTextureCacheManager[maskCacheIndex].storageType == StorageType::KEEP_TEXTURE)
{
- TextureSet maskTextures = mTextureCacheManager[maskCacheIndex].textureSet;
- if(maskTextures && maskTextures.GetTextureCount())
+ if(!mTextureCacheManager[maskCacheIndex].textures.empty())
{
- maskTexture = maskTextures.GetTexture(0u);
+ maskTexture = mTextureCacheManager[maskCacheIndex].textures[0];
}
}
else if(mTextureCacheManager[maskCacheIndex].storageType == StorageType::KEEP_PIXEL_BUFFER)
// Upload texture
UploadTextures(pixelBuffers, textureInfo);
- if(maskTexture && textureInfo.textureSet)
- {
- textureInfo.textureSet.SetTexture(1u, maskTexture);
- }
}
}
}
+
return textureId;
}
{
// Upload image texture. textureInfo.loadState will be UPLOADED.
UploadTextures(pixelBuffers, textureInfo);
- if(maskTextureInfo.textureSet.GetTextureCount() > 0u)
- {
- Texture maskTexture = maskTextureInfo.textureSet.GetTexture(0u);
- textureInfo.textureSet.SetTexture(1u, maskTexture);
- }
+
// notify mask texture set.
NotifyObservers(textureInfo, true);
}
std::vector<Devel::PixelBuffer> pixelBuffers;
pixelBuffers.push_back(textureInfo.pixelBuffer);
UploadTextures(pixelBuffers, textureInfo);
- if(maskTextureInfo.textureSet.GetTextureCount() > 0u)
- {
- Texture maskTexture = maskTextureInfo.textureSet.GetTexture(0u);
- textureInfo.textureSet.SetTexture(1u, maskTexture);
- }
+
// notify mask texture set.
NotifyObservers(textureInfo, true);
}
renderingAddOn.CreateGeometry(textureInfo.textureId, pixelBuffers[0]);
}
- if(!textureInfo.textureSet)
- {
- textureInfo.textureSet = TextureSet::New();
- }
+ // Remove previous textures and insert new textures
+ textureInfo.textures.clear();
- uint32_t index = 0;
for(auto&& pixelBuffer : pixelBuffers)
{
Texture texture = Texture::New(Dali::TextureType::TEXTURE_2D, pixelBuffer.GetPixelFormat(), pixelBuffer.GetWidth(), pixelBuffer.GetHeight());
-
PixelData pixelData = Devel::PixelBuffer::Convert(pixelBuffer);
texture.Upload(pixelData);
- textureInfo.textureSet.SetTexture(index++, texture);
+ textureInfo.textures.push_back(texture);
}
}
{
observer->LoadComplete(success, TextureUploadObserver::TextureInformation(TextureUploadObserver::ReturnType::PIXEL_BUFFER, textureInfo.pixelBuffer, textureInfo.url.GetUrl(), textureInfo.preMultiplied));
}
- else if(textureInfo.isAnimatedImageFormat)
+ else
+ {
+ TextureSet textureSet = GetTextureSet(textureInfo);
+ if(textureInfo.isAnimatedImageFormat)
+ {
+ observer->LoadComplete(success, TextureUploadObserver::TextureInformation(TextureUploadObserver::ReturnType::ANIMATED_IMAGE_TEXTURE, textureInfo.textureId, textureSet, textureInfo.frameCount, textureInfo.frameInterval));
+ }
+ else
+ {
+ observer->LoadComplete(success, TextureUploadObserver::TextureInformation(TextureUploadObserver::ReturnType::TEXTURE, textureInfo.textureId, textureSet, (textureInfo.useAtlas == UseAtlas::USE_ATLAS) ? true : false, textureInfo.atlasRect, textureInfo.preMultiplied));
+ }
+ }
+}
+
+TextureSet TextureManager::GetTextureSet(const TextureManager::TextureId& textureId)
+{
+ TextureSet textureSet;
+ TextureManager::LoadState loadState = mTextureCacheManager.GetTextureStateInternal(textureId);
+ if(loadState == TextureManager::LoadState::UPLOADED)
{
- observer->LoadComplete(success, TextureUploadObserver::TextureInformation(TextureUploadObserver::ReturnType::ANIMATED_IMAGE_TEXTURE, textureInfo.textureId, textureInfo.frameCount, textureInfo.frameInterval));
+ // LoadComplete has already been called - keep the same texture set
+ TextureCacheIndex textureCacheIndex = mTextureCacheManager.GetCacheIndexFromId(textureId);
+ if(textureCacheIndex != INVALID_CACHE_INDEX)
+ {
+ TextureInfo& textureInfo(mTextureCacheManager[textureCacheIndex]);
+ textureSet = GetTextureSet(textureInfo);
+ }
}
else
{
- observer->LoadComplete(success, TextureUploadObserver::TextureInformation(TextureUploadObserver::ReturnType::TEXTURE, textureInfo.textureId, textureInfo.textureSet, (textureInfo.useAtlas == UseAtlas::USE_ATLAS) ? true : false, textureInfo.atlasRect, textureInfo.preMultiplied));
+ DALI_LOG_ERROR("GetTextureSet is failed. texture is not uploaded \n");
+ }
+ return textureSet;
+}
+
+TextureSet TextureManager::GetTextureSet(const TextureManager::TextureInfo& textureInfo)
+{
+ TextureSet textureSet;
+
+ // LoadComplete has already been called - keep the same texture set
+ textureSet = TextureSet::New();
+ if(!textureInfo.textures.empty())
+ {
+ if(textureInfo.textures.size() > 1) // For YUV case
+ {
+ uint32_t index = 0u;
+ for(auto&& texture : textureInfo.textures)
+ {
+ textureSet.SetTexture(index++, texture);
+ }
+ }
+ else
+ {
+ textureSet.SetTexture(TEXTURE_INDEX, textureInfo.textures[0]);
+ TextureCacheIndex maskCacheIndex = mTextureCacheManager.GetCacheIndexFromId(textureInfo.maskTextureId);
+ if(maskCacheIndex != INVALID_CACHE_INDEX)
+ {
+ TextureInfo& maskTextureInfo(mTextureCacheManager[maskCacheIndex]);
+ if(maskTextureInfo.storageType == StorageType::UPLOAD_TO_TEXTURE || maskTextureInfo.storageType == StorageType::KEEP_TEXTURE)
+ {
+ if(!maskTextureInfo.textures.empty())
+ {
+ textureSet.SetTexture(MASK_TEXTURE_INDEX, maskTextureInfo.textures[0]);
+ }
+ }
+ }
+ }
}
+ return textureSet;
}
void TextureManager::RemoveTextureObserver(TextureManager::TextureInfo& textureInfo, TextureUploadObserver* observer)
* @param[out] textureId The textureId of the frame
* @param[in, out] maskInfo Mask info structure
* @param[in] samplingMode The SamplingMode to use
- * @param[in] wrapModeU Horizontal Wrap mode
- * @param[in] wrapModeV Vertical Wrap mode
* @param[in] synchronousLoading true if the frame should be loaded synchronously
* @param[in] textureObserver The client object should inherit from this and provide the "LoadCompleted" virtual.
* This is called when an image load completes (or fails).
TextureManager::TextureId& textureId,
MaskingDataPointer& maskInfo,
const Dali::SamplingMode::Type& samplingMode,
- const Dali::WrapMode::Type& wrapModeU,
- const Dali::WrapMode::Type& wrapModeV,
const bool& synchronousLoading,
TextureUploadObserver* textureObserver,
TextureManager::MultiplyOnLoad& preMultiplyOnLoad);
* be loaded, and marked successful, but this will be set to false.
* If atlasing succeeds, this will be set to true.
* @param[out] loadingStatus The loading status of the texture
- * @param[in] wrapModeU Horizontal Wrap mode
- * @param[in] wrapModeV Vertical Wrap mode
* @param[in] textureObserver The client object should inherit from this and provide the "LoadCompleted" virtual.
* This is called when an image load completes (or fails).
* @param[in] atlasObserver This is used if the texture is atlased, and will be called instead of
Dali::ImageDimensions& textureRectSize,
bool& atlasingStatus,
bool& loadingStatus,
- const Dali::WrapMode::Type& wrapModeU,
- const Dali::WrapMode::Type& wrapModeV,
TextureUploadObserver* textureObserver,
AtlasUploadObserver* atlasObserver,
ImageAtlasManagerPtr imageAtlasManager,
*/
Geometry GetRenderGeometry(const TextureManager::TextureId& textureId, std::uint32_t& frontElements, std::uint32_t& backElements);
+ /**
+ * @brief Returns the textureSet in texture manager.
+ * @param[in] textureId Id of the texture
+ * @return The textureSet in texture manager. These textures include YUV textures or images and masks.
+ */
+ TextureSet GetTextureSet(const TextureManager::TextureId& textureId);
+
+ /**
+ * @brief Returns the textureSet in texture manager.
+ * @param[in] textureInfo the information of the texture
+ * @return The textureSet in texture manager. These textures include YUV textures or images and masks.
+ */
+ TextureSet GetTextureSet(const TextureManager::TextureInfo& textureInfo);
+
public:
// API list that need to access TextureCacheManager.
}
/**
- * @copydoc TextureCacheManager::GetTextureSet
+ * @copydoc TextureCacheManager::GetTexture
*/
- inline TextureSet GetTextureSet(const TextureManager::TextureId& textureId)
+ inline Texture GetTexture(const TextureManager::TextureId& textureId)
{
- return mTextureCacheManager.GetTextureSet(textureId);
+ return mTextureCacheManager.GetTexture(textureId);
}
/**
ObserverListType observerList; ///< Container used to store all observer clients of this Texture
Dali::Toolkit::ImageAtlas atlas; ///< The atlas this Texture lays within (if any)
Dali::Devel::PixelBuffer pixelBuffer; ///< The PixelBuffer holding the image data (May be empty after upload)
- Dali::TextureSet textureSet; ///< The TextureSet holding the Texture
+ std::vector<Dali::Texture> textures; ///< The Textures
VisualUrl url; ///< The URL of the image
Dali::ImageDimensions desiredSize; ///< The size requested
Dali::ImageDimensions useSize; ///< The size used
{
}
-TextureUploadObserver::TextureInformation::TextureInformation(ReturnType returnType, int32_t textureId, uint32_t frameCount, uint32_t interval)
+TextureUploadObserver::TextureInformation::TextureInformation(ReturnType returnType, int32_t textureId, TextureSet textureSet, uint32_t frameCount, uint32_t interval)
: returnType(returnType),
textureId(textureId),
- textureSet(),
+ textureSet(textureSet),
useAtlasing(false),
atlasRect(Vector4::ZERO),
preMultiplied(false),
TextureInformation(ReturnType returnType, int32_t textureId, TextureSet textureSet, bool useAtlasing, const Vector4& atlasRect, bool preMultiplied);
TextureInformation(ReturnType returnType, int32_t textureId, TextureSet textureSet, const std::string& url, bool preMultiplied);
TextureInformation(ReturnType returnType, Devel::PixelBuffer pixelBuffer, const std::string& url, bool preMultiplied);
- TextureInformation(ReturnType returnType, int32_t textureId, uint32_t frameCount, uint32_t interval);
+ TextureInformation(ReturnType returnType, int32_t textureId, TextureSet textureSet, uint32_t frameCount, uint32_t interval);
TextureInformation();
Dali::ImageDimensions textureRectSize;
auto preMultiply = TextureManager::MultiplyOnLoad::LOAD_WITHOUT_MULTIPLY;
- mTextureManager.LoadTexture(
- url, ImageDimensions(), FittingMode::SCALE_TO_FILL, SamplingMode::BOX_THEN_LINEAR, mMaskingData, synchronousLoading, mImageUrls[frameIndex].mTextureId, textureRect, textureRectSize, atlasingStatus, loadingStatus, Dali::WrapMode::Type::DEFAULT, Dali::WrapMode::Type::DEFAULT, this, atlasObserver, imageAtlasManager, ENABLE_ORIENTATION_CORRECTION, TextureManager::ReloadPolicy::CACHED, preMultiply);
-
+ mTextureManager.LoadTexture(url, ImageDimensions(), FittingMode::SCALE_TO_FILL, SamplingMode::BOX_THEN_LINEAR, mMaskingData, synchronousLoading, mImageUrls[frameIndex].mTextureId, textureRect, textureRectSize, atlasingStatus, loadingStatus, this, atlasObserver, imageAtlasManager, ENABLE_ORIENTATION_CORRECTION, TextureManager::ReloadPolicy::CACHED, preMultiply);
mRequestingLoad = false;
}
}
TextureSet FixedImageCache::GetFrontTextureSet() const
{
- return mTextureManager.GetTextureSet(mImageUrls[mFront].mTextureId);
+ TextureSet textureSet = mTextureManager.GetTextureSet(mImageUrls[mFront].mTextureId);
+ if(textureSet)
+ {
+ Sampler sampler = Sampler::New();
+ sampler.SetWrapMode(Dali::WrapMode::Type::DEFAULT, Dali::WrapMode::Type::DEFAULT);
+ textureSet.SetSampler(0u, sampler);
+ }
+ return textureSet;
}
void FixedImageCache::CheckFrontFrame(bool wasReady)
loadTextureId,
mMaskingData,
SamplingMode::BOX_THEN_LINEAR,
- mWrapModeU,
- mWrapModeV,
synchronousLoading,
this,
preMultiplyOnLoading);
+ if(textureSet)
+ {
+ Sampler sampler = Sampler::New();
+ sampler.SetWrapMode(mWrapModeU, mWrapModeV);
+ textureSet.SetSampler(0u, sampler);
+ }
mTextureIds[frameIndex] = loadTextureId;
DALI_LOG_INFO(gAnimImgLogFilter, Debug::Concise, "RollingAnimatedImageCache::GetFrontTextureSet() FrameNumber:%d\n", mQueue[0].mFrameNumber);
TextureManager::TextureId textureId = GetCachedTextureId(0);
- return mTextureManager.GetTextureSet(textureId);
+ TextureSet textureSet = mTextureManager.GetTextureSet(textureId);
+ if(textureSet)
+ {
+ Sampler sampler = Sampler::New();
+ sampler.SetWrapMode(mWrapModeU, mWrapModeV);
+ textureSet.SetSampler(0u, sampler);
+ }
+ return textureSet;
}
TextureManager::TextureId RollingAnimatedImageCache::GetCachedTextureId(int index) const
DALI_LOG_INFO(gAnimImgLogFilter, Debug::Concise, "AnimatedImageVisual::LoadComplete(textureId:%d) start\n", textureInformation.textureId);
LOG_CACHE;
- TextureSet textureSet = mTextureManager.GetTextureSet(textureInformation.textureId);
- if(textureSet)
+ if(textureInformation.textureSet)
{
Sampler sampler = Sampler::New();
sampler.SetWrapMode(mWrapModeU, mWrapModeV);
- textureSet.SetSampler(0u, sampler);
+ textureInformation.textureSet.SetSampler(0u, sampler);
}
- MakeFrameReady(loadSuccess, textureSet, textureInformation.interval);
+ MakeFrameReady(loadSuccess, textureInformation.textureSet, textureInformation.interval);
if(loadSuccess)
{
TextureManager::TextureId loadTextureId = TextureManager::INVALID_TEXTURE_ID;
TextureSet textureSet = mTextureManager.LoadTexture(
- url, ImageDimensions(), FittingMode::SCALE_TO_FILL, SamplingMode::BOX_THEN_LINEAR, mMaskingData, synchronousLoading, loadTextureId, textureRect, textureRectSize, atlasingStatus, loadingStatus, Dali::WrapMode::Type::DEFAULT, Dali::WrapMode::Type::DEFAULT, this, atlasObserver, imageAtlasManager, ENABLE_ORIENTATION_CORRECTION, TextureManager::ReloadPolicy::CACHED, preMultiply);
+ url, ImageDimensions(), FittingMode::SCALE_TO_FILL, SamplingMode::BOX_THEN_LINEAR, mMaskingData, synchronousLoading, loadTextureId, textureRect, textureRectSize, atlasingStatus, loadingStatus, this, atlasObserver, imageAtlasManager, ENABLE_ORIENTATION_CORRECTION, TextureManager::ReloadPolicy::CACHED, preMultiply);
mImageUrls[imageFrame.mUrlIndex].mTextureId = loadTextureId;
mRequestingLoad = false;
TextureSet RollingImageCache::GetFrontTextureSet() const
{
TextureManager::TextureId textureId = GetCachedTextureId(0);
- return mTextureManager.GetTextureSet(textureId);
+ TextureSet textureSet = mTextureManager.GetTextureSet(textureId);
+ if(textureSet)
+ {
+ Sampler sampler = Sampler::New();
+ sampler.SetWrapMode(Dali::WrapMode::Type::DEFAULT, Dali::WrapMode::Type::DEFAULT);
+ textureSet.SetSampler(0u, sampler);
+ }
+ return textureSet;
}
TextureManager::TextureId RollingImageCache::GetCachedTextureId(int index) const
if(!frontFrameReady && IsFrontReady())
{
- mObserver.FrameReady(mTextureManager.GetTextureSet(textureInformation.textureId), mInterval);
+ if(textureInformation.textureSet)
+ {
+ Sampler sampler = Sampler::New();
+ sampler.SetWrapMode(Dali::WrapMode::Type::DEFAULT, Dali::WrapMode::Type::DEFAULT);
+ textureInformation.textureSet.SetSampler(0u, sampler);
+ }
+ mObserver.FrameReady(textureInformation.textureSet, mInterval);
}
}
else
bool synchronousLoading = IsSynchronousLoadingRequired();
bool loadingStatus;
- textures = textureManager.LoadTexture(mImageUrl, mDesiredSize, mFittingMode, mSamplingMode, mMaskingData, synchronousLoading, mTextureId, atlasRect, mAtlasRectSize, atlasing, loadingStatus, mWrapModeU, mWrapModeV, textureObserver, atlasUploadObserver, atlasManager, mOrientationCorrection, forceReload, preMultiplyOnLoad);
+ textures = textureManager.LoadTexture(mImageUrl, mDesiredSize, mFittingMode, mSamplingMode, mMaskingData, synchronousLoading, mTextureId, atlasRect, mAtlasRectSize, atlasing, loadingStatus, textureObserver, atlasUploadObserver, atlasManager, mOrientationCorrection, forceReload, preMultiplyOnLoad);
if(textures)
{
}
EnablePreMultipliedAlpha(preMultiplyOnLoad == TextureManager::MultiplyOnLoad::MULTIPLY_ON_LOAD);
+ if(!atlasing)
+ {
+ Sampler sampler = Sampler::New();
+ sampler.SetWrapMode(mWrapModeU, mWrapModeV);
+ textures.SetSampler(0u, sampler);
+ }
}
else if(synchronousLoading)
{
else
{
mTextures = mFactoryCache.GetTextureManager().GetTextureSet(mTextureId);
+ if(!(mImpl->mFlags & Visual::Base::Impl::IS_ATLASING_APPLIED) && mTextures)
+ {
+ Sampler sampler = Sampler::New();
+ sampler.SetWrapMode(mWrapModeU, mWrapModeV);
+ mTextures.SetSampler(0u, sampler);
+ }
}
}
}
else
{
- Sampler sampler = Sampler::New();
- sampler.SetWrapMode(mWrapModeU, mWrapModeV);
- textureInformation.textureSet.SetSampler(0u, sampler);
+ if(!textureInformation.useAtlasing)
+ {
+ Sampler sampler = Sampler::New();
+ sampler.SetWrapMode(mWrapModeU, mWrapModeV);
+ textureInformation.textureSet.SetSampler(0u, sampler);
+ }
+
mImpl->mRenderer.SetTextures(textureInformation.textureSet);
ComputeTextureSize();
CheckMaskTexture();
bool loadingStatus = false;
// Load the auxiliary image
- mAuxiliaryTextureSet = textureManager.LoadTexture(mAuxiliaryUrl, Dali::ImageDimensions(), FittingMode::DEFAULT, SamplingMode::BOX_THEN_LINEAR, maskingDataPtr, synchronousLoading, mAuxiliaryTextureId, atlasRect, atlasRectSize, atlasing, loadingStatus, WrapMode::DEFAULT, WrapMode::DEFAULT, this, nullptr, imageAtlasManagerPtr, true, TextureManager::ReloadPolicy::CACHED, preMultiplyOnLoad);
+ mAuxiliaryTextureSet = textureManager.LoadTexture(mAuxiliaryUrl, Dali::ImageDimensions(), FittingMode::DEFAULT, SamplingMode::BOX_THEN_LINEAR, maskingDataPtr, synchronousLoading, mAuxiliaryTextureId, atlasRect, atlasRectSize, atlasing, loadingStatus, this, nullptr, imageAtlasManagerPtr, true, TextureManager::ReloadPolicy::CACHED, preMultiplyOnLoad);
+
+ if(mAuxiliaryTextureSet)
+ {
+ Sampler sampler = Sampler::New();
+ sampler.SetWrapMode(WrapMode::DEFAULT, WrapMode::DEFAULT);
+ mAuxiliaryTextureSet.SetSampler(0u, sampler);
+ }
// If synchronousLoading is true, we can check the auxiliaryResource's status now.
if(synchronousLoading)
}
if(loadSuccess)
{
- mAuxiliaryTextureSet = textureInformation.textureSet;
+ mAuxiliaryTextureSet = textureInformation.textureSet;
+ if(mAuxiliaryTextureSet)
+ {
+ Sampler sampler = Sampler::New();
+ sampler.SetWrapMode(WrapMode::DEFAULT, WrapMode::DEFAULT);
+ mAuxiliaryTextureSet.SetSampler(0u, sampler);
+ }
+
mAuxiliaryResourceStatus = Toolkit::Visual::ResourceStatus::READY;
}
else