X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fvisuals%2Fimage%2Fimage-visual.cpp;h=da12c4ff7b319cf90e43811fa91f2a1fa6115635;hp=87d6ea62a1550f4ea1b7de25cbded93f7ff61dd6;hb=2bba756a645043d8c1c4023a75966401d531827c;hpb=11e1ee5bb1a33525dd3016a0fd145a6a3ee2c133 diff --git a/dali-toolkit/internal/visuals/image/image-visual.cpp b/dali-toolkit/internal/visuals/image/image-visual.cpp index 87d6ea6..da12c4f 100644 --- a/dali-toolkit/internal/visuals/image/image-visual.cpp +++ b/dali-toolkit/internal/visuals/image/image-visual.cpp @@ -180,18 +180,6 @@ ImageVisual::~ImageVisual() { if(Stage::IsInstalled()) { - if(mMaskingData) - { - // TextureManager could have been deleted before the actor that contains this - // ImageVisual is destroyed (e.g. due to stage shutdown). Ensure the stage - // is still valid before accessing texture manager. - if(mMaskingData->mAlphaMaskId != TextureManager::INVALID_TEXTURE_ID) - { - TextureManager& textureManager = mFactoryCache.GetTextureManager(); - textureManager.Remove(mMaskingData->mAlphaMaskId, this); - } - } - if(mImageUrl.IsValid()) { // Decrease reference count of External Resources : @@ -618,7 +606,7 @@ void ImageVisual::LoadTexture(bool& atlasing, Vector4& atlasRect, TextureSet& te 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) { @@ -632,6 +620,12 @@ void ImageVisual::LoadTexture(bool& atlasing, Vector4& atlasRect, TextureSet& te } EnablePreMultipliedAlpha(preMultiplyOnLoad == TextureManager::MultiplyOnLoad::MULTIPLY_ON_LOAD); + if(!atlasing) + { + Sampler sampler = Sampler::New(); + sampler.SetWrapMode(mWrapModeU, mWrapModeV); + textures.SetSampler(0u, sampler); + } } else if(synchronousLoading) { @@ -676,6 +670,12 @@ void ImageVisual::InitializeRenderer() 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); + } } } @@ -912,9 +912,13 @@ void ImageVisual::LoadComplete(bool loadingSuccess, TextureInformation textureIn } 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();