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=07ead876afb845c10f0f1dc48f6939f13f5f067e;hp=e79edd71cd60bdc854ee6d679a6141da630222b2;hb=5aaba5adcf1a717e1ece3ef9c55c8912420993b5;hpb=2ffc3a77b8aa6f8ccdbaaef41c0fa14034853582 diff --git a/dali-toolkit/internal/visuals/image/image-visual.cpp b/dali-toolkit/internal/visuals/image/image-visual.cpp index e79edd7..07ead87 100644 --- a/dali-toolkit/internal/visuals/image/image-visual.cpp +++ b/dali-toolkit/internal/visuals/image/image-visual.cpp @@ -122,6 +122,7 @@ Geometry CreateGeometry( VisualFactoryCache& factoryCache, ImageDimensions gridS } // unnamed namespace + ImageVisualPtr ImageVisual::New( VisualFactoryCache& factoryCache, ImageVisualShaderFactory& shaderFactory, const VisualUrl& imageUrl, @@ -182,7 +183,7 @@ ImageVisual::ImageVisual( VisualFactoryCache& factoryCache, } ImageVisual::ImageVisual( VisualFactoryCache& factoryCache, ImageVisualShaderFactory& shaderFactory, const Image& image ) -: Visual::Base( factoryCache, Visual::FittingMode::FIT_KEEP_ASPECT_RATIO ), +: Visual::Base( factoryCache, Visual::FittingMode::FILL ), mImage( image ), mPixelArea( FULL_TEXTURE_RECT ), mPlacementActor(), @@ -203,7 +204,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() @@ -505,9 +507,12 @@ void ImageVisual::GetNaturalSize( Vector2& naturalSize ) if( textureSet ) { auto texture = textureSet.GetTexture(0); - naturalSize.x = texture.GetWidth(); - naturalSize.y = texture.GetHeight(); - return; + if( texture ) + { + naturalSize.x = texture.GetWidth(); + naturalSize.y = texture.GetHeight(); + return; + } } } @@ -543,7 +548,6 @@ void ImageVisual::GetNaturalSize( Vector2& naturalSize ) return; } } - naturalSize = Vector2::ZERO; } @@ -767,7 +771,7 @@ void ImageVisual::DoSetOnStage( Actor& actor ) mPlacementActor = actor; // Search the Actor tree to find if Layer UI behaviour set. Layer layer = actor.GetLayer(); - if( layer && layer.GetBehavior() == Layer::LAYER_3D ) + if( layer && layer.GetProperty( Layer::Property::BEHAVIOR ) == Layer::LAYER_3D ) { // Layer 3D set, do not align pixels mImpl->mRenderer.RegisterProperty( PIXEL_ALIGNED_UNIFORM_NAME, PIXEL_ALIGN_OFF );