/*
- * 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.
mLoading( false ),
mOrientationCorrection( true )
{
+ EnablePreMultipliedAlpha( mFactoryCache.GetPreMultiplyOnLoad() );
}
ImageVisual::ImageVisual( VisualFactoryCache& factoryCache, ImageVisualShaderFactory& shaderFactory, const Image& image )
mLoading( false ),
mOrientationCorrection( true )
{
+ EnablePreMultipliedAlpha( mFactoryCache.GetPreMultiplyOnLoad() );
}
ImageVisual::~ImageVisual()
if( mMaskingData->mAlphaMaskId != TextureManager::INVALID_TEXTURE_ID )
{
TextureManager& textureManager = mFactoryCache.GetTextureManager();
- textureManager.Remove( mMaskingData->mAlphaMaskId );
+ textureManager.Remove( mMaskingData->mAlphaMaskId, this );
}
}
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;
}
atlasUploadObserver = this;
}
- auto preMultiplyOnLoad = mFactoryCache.GetPreMultiplyOnLoad() && !mImpl->mCustomShader
+ auto preMultiplyOnLoad = IsPreMultipliedAlphaEnabled() && !mImpl->mCustomShader
? TextureManager::MultiplyOnLoad::MULTIPLY_ON_LOAD
: TextureManager::MultiplyOnLoad::LOAD_WITHOUT_MULTIPLY;
{
if( mTextureId != TextureManager::INVALID_TEXTURE_ID )
{
- mFactoryCache.GetTextureManager().Remove( mTextureId );
+ mFactoryCache.GetTextureManager().Remove( mTextureId, this );
mTextureId = TextureManager::INVALID_TEXTURE_ID;
}
else