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=ceb366928377f5a2e282752f50b0937cb39df158;hp=fad510bcd24f15432cd503e79781d3835f125686;hb=4b11a25bb26aeb1eaef96ac024de6009a790387f;hpb=621e8a4a716e30a7ad727e12627c36d24d626c1c diff --git a/dali-toolkit/internal/visuals/image/image-visual.cpp b/dali-toolkit/internal/visuals/image/image-visual.cpp index fad510b..ceb3669 100644 --- a/dali-toolkit/internal/visuals/image/image-visual.cpp +++ b/dali-toolkit/internal/visuals/image/image-visual.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. + * Copyright (c) 2020 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -187,6 +187,7 @@ ImageVisual::ImageVisual( VisualFactoryCache& factoryCache, mLoading( false ), mOrientationCorrection( true ) { + EnablePreMultipliedAlpha( mFactoryCache.GetPreMultiplyOnLoad() ); } ImageVisual::ImageVisual( VisualFactoryCache& factoryCache, ImageVisualShaderFactory& shaderFactory, const Image& image ) @@ -211,6 +212,7 @@ ImageVisual::ImageVisual( VisualFactoryCache& factoryCache, ImageVisualShaderFac mLoading( false ), mOrientationCorrection( true ) { + EnablePreMultipliedAlpha( mFactoryCache.GetPreMultiplyOnLoad() ); } ImageVisual::~ImageVisual() @@ -225,7 +227,7 @@ ImageVisual::~ImageVisual() if( mMaskingData->mAlphaMaskId != TextureManager::INVALID_TEXTURE_ID ) { TextureManager& textureManager = mFactoryCache.GetTextureManager(); - textureManager.Remove( mMaskingData->mAlphaMaskId ); + textureManager.Remove( mMaskingData->mAlphaMaskId, this ); } } @@ -423,10 +425,7 @@ void ImageVisual::DoSetProperty( Property::Index index, const Property::Value& v if( value.Get( alphaUrl ) ) { AllocateMaskData(); - // Immediately trigger the alpha mask loading (it may just get a cached value) mMaskingData->mAlphaMaskUrl = alphaUrl; - TextureManager& textureManager = mFactoryCache.GetTextureManager(); - mMaskingData->mAlphaMaskId = textureManager.RequestMaskLoad( alphaUrl ); } break; } @@ -683,7 +682,7 @@ void ImageVisual::LoadTexture( bool& atlasing, Vector4& atlasRect, TextureSet& t atlasUploadObserver = this; } - auto preMultiplyOnLoad = mFactoryCache.GetPreMultiplyOnLoad() && !mImpl->mCustomShader + auto preMultiplyOnLoad = IsPreMultipliedAlphaEnabled() && !mImpl->mCustomShader ? TextureManager::MultiplyOnLoad::MULTIPLY_ON_LOAD : TextureManager::MultiplyOnLoad::LOAD_WITHOUT_MULTIPLY; @@ -1012,7 +1011,7 @@ void ImageVisual::RemoveTexture() { if( mTextureId != TextureManager::INVALID_TEXTURE_ID ) { - mFactoryCache.GetTextureManager().Remove( mTextureId ); + mFactoryCache.GetTextureManager().Remove( mTextureId, this ); mTextureId = TextureManager::INVALID_TEXTURE_ID; } else