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=194b9ba52556cb79d4f40ba9ff3fe53cb246f5de;hp=9823a9271342eb22af23c98793ee4f88dda86698;hb=5af3c7c9147d2697cf2324738d357c52ce9598b9;hpb=b0a0aa8215fc520e9d05e5bbd855ef41a0c189bc diff --git a/dali-toolkit/internal/visuals/image/image-visual.cpp b/dali-toolkit/internal/visuals/image/image-visual.cpp index 9823a92..194b9ba 100644 --- a/dali-toolkit/internal/visuals/image/image-visual.cpp +++ b/dali-toolkit/internal/visuals/image/image-visual.cpp @@ -609,13 +609,27 @@ bool ImageVisual::AttemptAtlasing() void ImageVisual::InitializeRenderer() { auto attemptAtlasing = AttemptAtlasing(); - // texture set has to be created first as we need to know if atlasing succeeded or not - // when selecting the shader - if( mTextureId == TextureManager::INVALID_TEXTURE_ID && ! mTextures ) // Only load the texture once + // Load Texture if mTextures is empty. + // mTextures is already set, the mTexture can be used to create Renderer. + // There are two cases mTextures is empty. + // 1. mTextureId == TextureManager::INVALID_TEXTURE_ID + // - Visual is on stage with LoadPolicy::ATTACHED + // 2. mTextureId != TextureManager::INVALID_TEXTURE_ID + // - If ReleasePolicy is DESTROYED, InitializeRenderer called every on stage called. + // - Then every resources those contained in Visual are Reset but mTextureId is remained when the Off stage time, + // - So, mTextures needed to be get from texture manager to created resources like mImpl->mRenderer. + if( ! mTextures ) { - LoadTexture( attemptAtlasing, mAtlasRect, mTextures, mOrientationCorrection, - TextureManager::ReloadPolicy::CACHED ); + if( mTextureId == TextureManager::INVALID_TEXTURE_ID ) + { + LoadTexture( attemptAtlasing, mAtlasRect, mTextures, mOrientationCorrection, + TextureManager::ReloadPolicy::CACHED ); + } + else + { + mTextures = mFactoryCache.GetTextureManager().GetTextureSet( mTextureId ); + } } CreateRenderer( mTextures );