*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
-DALI_ENUM_TO_STRING_WITH_SCOPE( DevelImageVisual::LoadPolicy, IMMEDIATE )
-DALI_ENUM_TO_STRING_WITH_SCOPE( DevelImageVisual::LoadPolicy, ATTACHED )
+DALI_ENUM_TO_STRING_WITH_SCOPE( Dali::Toolkit::ImageVisual::LoadPolicy, IMMEDIATE )
+DALI_ENUM_TO_STRING_WITH_SCOPE( Dali::Toolkit::ImageVisual::LoadPolicy, ATTACHED )
-DALI_ENUM_TO_STRING_WITH_SCOPE( DevelImageVisual::ReleasePolicy, DETACHED )
-DALI_ENUM_TO_STRING_WITH_SCOPE( DevelImageVisual::ReleasePolicy, DESTROYED )
-DALI_ENUM_TO_STRING_WITH_SCOPE( DevelImageVisual::ReleasePolicy, NEVER )
+DALI_ENUM_TO_STRING_WITH_SCOPE( Dali::Toolkit::ImageVisual::ReleasePolicy, DETACHED )
+DALI_ENUM_TO_STRING_WITH_SCOPE( Dali::Toolkit::ImageVisual::ReleasePolicy, DESTROYED )
+DALI_ENUM_TO_STRING_WITH_SCOPE( Dali::Toolkit::ImageVisual::ReleasePolicy, NEVER )
DALI_ENUM_TO_STRING_TABLE_END( RELEASE_POLICY )
const Vector4 FULL_TEXTURE_RECT(0.f, 0.f, 1.f, 1.f);
DALI_ENUM_TO_STRING_TABLE_END( RELEASE_POLICY )
const Vector4 FULL_TEXTURE_RECT(0.f, 0.f, 1.f, 1.f);
ImageDimensions size,
FittingMode::Type fittingMode,
Dali::SamplingMode::Type samplingMode )
ImageDimensions size,
FittingMode::Type fittingMode,
Dali::SamplingMode::Type samplingMode )
mSamplingMode( samplingMode ),
mWrapModeU( WrapMode::DEFAULT ),
mWrapModeV( WrapMode::DEFAULT ),
mSamplingMode( samplingMode ),
mWrapModeU( WrapMode::DEFAULT ),
mWrapModeV( WrapMode::DEFAULT ),
- mLoadPolicy( DevelImageVisual::LoadPolicy::ATTACHED ),
- mReleasePolicy( DevelImageVisual::ReleasePolicy::DETACHED ),
+ mLoadPolicy( Toolkit::ImageVisual::LoadPolicy::ATTACHED ),
+ mReleasePolicy( Toolkit::ImageVisual::ReleasePolicy::DETACHED ),
mAtlasRect( 0.0f, 0.0f, 0.0f, 0.0f ),
mAttemptAtlasing( false ),
mLoading( false ),
mAtlasRect( 0.0f, 0.0f, 0.0f, 0.0f ),
mAttemptAtlasing( false ),
mLoading( false ),
mSamplingMode( SamplingMode::DEFAULT ),
mWrapModeU( WrapMode::DEFAULT ),
mWrapModeV( WrapMode::DEFAULT ),
mSamplingMode( SamplingMode::DEFAULT ),
mWrapModeU( WrapMode::DEFAULT ),
mWrapModeV( WrapMode::DEFAULT ),
- mLoadPolicy( DevelImageVisual::LoadPolicy::ATTACHED ),
- mReleasePolicy( DevelImageVisual::ReleasePolicy::DESTROYED ),
+ mLoadPolicy( Toolkit::ImageVisual::LoadPolicy::ATTACHED ),
+ mReleasePolicy( Toolkit::ImageVisual::ReleasePolicy::DESTROYED ),
mAtlasRect( 0.0f, 0.0f, 0.0f, 0.0f ),
mAttemptAtlasing( false ),
mLoading( false ),
mAtlasRect( 0.0f, 0.0f, 0.0f, 0.0f ),
mAttemptAtlasing( false ),
mLoading( false ),
{
auto attemptAtlasing = AttemptAtlasing();
LoadTexture( attemptAtlasing, mAtlasRect, mTextures, mOrientationCorrection,
{
auto attemptAtlasing = AttemptAtlasing();
LoadTexture( attemptAtlasing, mAtlasRect, mTextures, mOrientationCorrection,
{
int releasePolicy;
Scripting::GetEnumerationProperty( value, RELEASE_POLICY_TABLE, RELEASE_POLICY_TABLE_COUNT, releasePolicy );
{
int releasePolicy;
Scripting::GetEnumerationProperty( value, RELEASE_POLICY_TABLE, RELEASE_POLICY_TABLE_COUNT, releasePolicy );
{
int loadPolicy;
Scripting::GetEnumerationProperty( value, LOAD_POLICY_TABLE, LOAD_POLICY_TABLE_COUNT, loadPolicy );
{
int loadPolicy;
Scripting::GetEnumerationProperty( value, LOAD_POLICY_TABLE, LOAD_POLICY_TABLE_COUNT, loadPolicy );
//Register transform properties
mImpl->mTransform.RegisterUniforms( mImpl->mRenderer, Direction::LEFT_TO_RIGHT );
//Register transform properties
mImpl->mTransform.RegisterUniforms( mImpl->mRenderer, Direction::LEFT_TO_RIGHT );
bool ImageVisual::IsSynchronousResourceLoading() const
{
return mImpl->mFlags & Impl::IS_SYNCHRONOUS_RESOURCE_LOADING;
bool ImageVisual::IsSynchronousResourceLoading() const
{
return mImpl->mFlags & Impl::IS_SYNCHRONOUS_RESOURCE_LOADING;
textures = textureManager.LoadTexture( mImageUrl, mDesiredSize, mFittingMode, mSamplingMode,
mMaskingData, IsSynchronousResourceLoading(), mTextureId,
atlasRect, atlasing, mLoading, mWrapModeU,
mWrapModeV, textureObserver, atlasUploadObserver, atlasManager,
textures = textureManager.LoadTexture( mImageUrl, mDesiredSize, mFittingMode, mSamplingMode,
mMaskingData, IsSynchronousResourceLoading(), mTextureId,
atlasRect, atlasing, mLoading, mWrapModeU,
mWrapModeV, textureObserver, atlasUploadObserver, atlasManager,
- mOrientationCorrection,
- forceReload );
+ mOrientationCorrection, forceReload, preMultiplyOnLoad);
+
+ if( textures && preMultiplyOnLoad == TextureManager::MultiplyOnLoad::MULTIPLY_ON_LOAD)
+ {
+ EnablePreMultipliedAlpha( true );
+ }
// Image release is dependent on the ReleasePolicy, renderer is destroyed.
actor.RemoveRenderer( mImpl->mRenderer);
// Image release is dependent on the ReleasePolicy, renderer is destroyed.
actor.RemoveRenderer( mImpl->mRenderer);
- map.Insert( Toolkit::DevelImageVisual::Property::LOAD_POLICY, mLoadPolicy );
- map.Insert( Toolkit::DevelImageVisual::Property::RELEASE_POLICY, mReleasePolicy );
- map.Insert( Toolkit::DevelImageVisual::Property::ORIENTATION_CORRECTION, mOrientationCorrection );
+ map.Insert( Toolkit::ImageVisual::Property::LOAD_POLICY, mLoadPolicy );
+ map.Insert( Toolkit::ImageVisual::Property::RELEASE_POLICY, mReleasePolicy );
+ map.Insert( Toolkit::ImageVisual::Property::ORIENTATION_CORRECTION, mOrientationCorrection );
// From Texture Manager
void ImageVisual::UploadComplete( bool loadingSuccess, int32_t textureId, TextureSet textureSet, bool usingAtlas,
// From Texture Manager
void ImageVisual::UploadComplete( bool loadingSuccess, int32_t textureId, TextureSet textureSet, bool usingAtlas,
actor.AddRenderer( mImpl->mRenderer );
// reset the weak handle so that the renderer only get added to actor once
actor.AddRenderer( mImpl->mRenderer );
// reset the weak handle so that the renderer only get added to actor once