X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fvisuals%2Fanimated-image%2Ffixed-image-cache.cpp;h=854a7a0082f207934b30280377857bf665273bca;hb=7f975f2a265d9418e81f49031d26d921816f36c1;hp=c40f80257e5115530d0d8fbd5accf3fde85a2874;hpb=8e832b294a6ba371814850502ddaefcbe8951c39;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/internal/visuals/animated-image/fixed-image-cache.cpp b/dali-toolkit/internal/visuals/animated-image/fixed-image-cache.cpp index c40f802..854a7a0 100644 --- a/dali-toolkit/internal/visuals/animated-image/fixed-image-cache.cpp +++ b/dali-toolkit/internal/visuals/animated-image/fixed-image-cache.cpp @@ -43,8 +43,9 @@ FixedImageCache::FixedImageCache(TextureManager& textureMana TextureManager::MaskingDataPointer& maskingData, ImageCache::FrameReadyObserver& observer, uint32_t batchSize, - uint32_t interval) -: ImageCache(textureManager, size, fittingMode, samplingMode, maskingData, observer, batchSize, interval), + uint32_t interval, + bool preMultiplyOnLoad) +: ImageCache(textureManager, size, fittingMode, samplingMode, maskingData, observer, batchSize, interval, preMultiplyOnLoad), mImageUrls(urlList), mFront(FIRST_FRAME_INDEX) { @@ -133,9 +134,11 @@ void FixedImageCache::LoadBatch() ImageAtlasManagerPtr imageAtlasManager = nullptr; Vector4 textureRect; Dali::ImageDimensions textureRectSize; - auto preMultiply = TextureManager::MultiplyOnLoad::LOAD_WITHOUT_MULTIPLY; - mTextureManager.LoadTexture(url, mDesiredSize, mFittingMode, mSamplingMode, mMaskingData, synchronousLoading, mImageUrls[frameIndex].mTextureId, textureRect, textureRectSize, atlasingStatus, loadingStatus, this, atlasObserver, imageAtlasManager, ENABLE_ORIENTATION_CORRECTION, TextureManager::ReloadPolicy::CACHED, preMultiply); + auto preMultiplyOnLoading = mPreMultiplyOnLoad ? TextureManager::MultiplyOnLoad::MULTIPLY_ON_LOAD + : TextureManager::MultiplyOnLoad::LOAD_WITHOUT_MULTIPLY; + + mTextureManager.LoadTexture(url, mDesiredSize, mFittingMode, mSamplingMode, mMaskingData, synchronousLoading, mImageUrls[frameIndex].mTextureId, textureRect, textureRectSize, atlasingStatus, loadingStatus, this, atlasObserver, imageAtlasManager, ENABLE_ORIENTATION_CORRECTION, TextureManager::ReloadPolicy::CACHED, preMultiplyOnLoading); mRequestingLoad = false; } } @@ -152,11 +155,11 @@ TextureSet FixedImageCache::GetFrontTextureSet() const return textureSet; } -void FixedImageCache::CheckFrontFrame(bool wasReady) +void FixedImageCache::CheckFrontFrame(bool wasReady, bool preMultiplied) { if(wasReady == false && IsFrontReady()) { - mObserver.FrameReady(GetFrontTextureSet(), mInterval); + mObserver.FrameReady(GetFrontTextureSet(), mInterval, preMultiplied); } } @@ -199,12 +202,13 @@ void FixedImageCache::LoadComplete(bool loadSuccess, TextureInformation textureI { mReadyFlags.back() = true; } - CheckFrontFrame(frontFrameReady); + CheckFrontFrame(frontFrameReady, textureInformation.preMultiplied); } else { mLoadState = TextureManager::LoadState::LOAD_FAILED; - mObserver.FrameReady(TextureSet(), 0); + // preMultiplied should be false because broken image don't premultiply alpha on load + mObserver.FrameReady(TextureSet(), 0, false); } }