Disable premultiplied alpha when the Image is used
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / visuals / image / image-visual.cpp
index 59b68fd..c553ced 100644 (file)
@@ -56,15 +56,6 @@ namespace Internal
 namespace
 {
 
-// property names
-const char * const IMAGE_FITTING_MODE( "fittingMode" );
-const char * const IMAGE_SAMPLING_MODE( "samplingMode" );
-const char * const IMAGE_DESIRED_WIDTH( "desiredWidth" );
-const char * const IMAGE_DESIRED_HEIGHT( "desiredHeight" );
-const char * const SYNCHRONOUS_LOADING( "synchronousLoading" );
-const char * const IMAGE_ATLASING("atlasing");
-const char * const ALPHA_MASK_URL("alphaMaskUrl");
-
 // fitting modes
 DALI_ENUM_TO_STRING_TABLE_BEGIN( FITTING_MODE )
 DALI_ENUM_TO_STRING_WITH_SCOPE( Dali::FittingMode, SHRINK_TO_FIT )
@@ -212,7 +203,8 @@ ImageVisual::ImageVisual( VisualFactoryCache& factoryCache, ImageVisualShaderFac
   mLoading( false ),
   mOrientationCorrection( true )
 {
-  EnablePreMultipliedAlpha( mFactoryCache.GetPreMultiplyOnLoad() );
+  // PreMultiplied alpha should be disabled when the Image is used.
+  EnablePreMultipliedAlpha( false );
 }
 
 ImageVisual::~ImageVisual()
@@ -663,11 +655,6 @@ void ImageVisual::CreateNativeImageRenderer( NativeImage& nativeImage )
   mImpl->mTransform.RegisterUniforms( mImpl->mRenderer, Direction::LEFT_TO_RIGHT );
 }
 
-bool ImageVisual::IsSynchronousResourceLoading() const
-{
-  return mImpl->mFlags & Impl::IS_SYNCHRONOUS_RESOURCE_LOADING;
-}
-
 void ImageVisual::LoadTexture( bool& atlasing, Vector4& atlasRect, TextureSet& textures, bool orientationCorrection,
                                TextureManager::ReloadPolicy forceReload )
 {
@@ -688,7 +675,7 @@ void ImageVisual::LoadTexture( bool& atlasing, Vector4& atlasRect, TextureSet& t
     : TextureManager::MultiplyOnLoad::LOAD_WITHOUT_MULTIPLY;
 
   textures = textureManager.LoadTexture( mImageUrl, mDesiredSize, mFittingMode, mSamplingMode,
-                                         mMaskingData, IsSynchronousResourceLoading(), mTextureId,
+                                         mMaskingData, IsSynchronousLoadingRequired(), mTextureId,
                                          atlasRect, mAtlasRectSize, atlasing, mLoading, mWrapModeU,
                                          mWrapModeV, textureObserver, atlasUploadObserver, atlasManager,
                                          mOrientationCorrection, forceReload, preMultiplyOnLoad);
@@ -829,7 +816,7 @@ void ImageVisual::DoCreatePropertyMap( Property::Map& map ) const
   map.Clear();
   map.Insert( Toolkit::Visual::Property::TYPE, Toolkit::Visual::IMAGE );
 
-  bool sync = IsSynchronousResourceLoading();
+  bool sync = IsSynchronousLoadingRequired();
   map.Insert( SYNCHRONOUS_LOADING, sync );
   if( mImageUrl.IsValid() )
   {