X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fvisuals%2Fimage%2Fimage-visual.cpp;h=970e309cca52981b897111dd077f9ca22aaf07e4;hb=f9b3bd2fc9a97770affb1c5de7cd6a15995d90e6;hp=650c5086e0e75de3bb66d8b67dfff05bcaaf7ac7;hpb=e0c063be9e7ecde0e5665079289489d456828abf;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/internal/visuals/image/image-visual.cpp b/dali-toolkit/internal/visuals/image/image-visual.cpp index 650c508..970e309 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) 2021 Samsung Electronics Co., Ltd. + * Copyright (c) 2022 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. @@ -477,7 +477,7 @@ void ImageVisual::GetNaturalSize(Vector2& naturalSize) } auto textureSet = mImpl->mRenderer.GetTextures(); - if(textureSet) + if(textureSet && textureSet.GetTextureCount()) { auto texture = textureSet.GetTexture(0); if(texture) @@ -755,7 +755,7 @@ void ImageVisual::DoCreatePropertyMap(Property::Map& map) const map.Insert(Toolkit::Visual::Property::TYPE, Toolkit::Visual::IMAGE); bool sync = IsSynchronousLoadingRequired(); - map.Insert(SYNCHRONOUS_LOADING, sync); + map.Insert(Toolkit::ImageVisual::Property::SYNCHRONOUS_LOADING, sync); if(mImageUrl.IsValid()) { map.Insert(Toolkit::ImageVisual::Property::URL, mImageUrl.GetUrl()); @@ -795,11 +795,11 @@ void ImageVisual::DoCreateInstancePropertyMap(Property::Map& map) const } } -void ImageVisual::OnDoAction(const Dali::Property::Index actionName, const Dali::Property::Value& attributes) +void ImageVisual::OnDoAction(const Dali::Property::Index actionId, const Dali::Property::Value& attributes) { // Check if action is valid for this visual type and perform action if possible - switch(actionName) + switch(actionId) { case DevelImageVisual::Action::RELOAD: { @@ -853,17 +853,17 @@ void ImageVisual::UploadCompleted() } // From Texture Manager -void ImageVisual::UploadComplete(bool loadingSuccess, int32_t textureId, TextureSet textureSet, bool usingAtlas, const Vector4& atlasRectangle, bool preMultiplied) +void ImageVisual::LoadComplete(bool loadingSuccess, TextureInformation textureInformation) { Toolkit::Visual::ResourceStatus resourceStatus; if(mImpl->mRenderer) { - if(usingAtlas) + if(textureInformation.useAtlasing) { mImpl->mRenderer.RegisterProperty(ATLAS_RECT_UNIFORM_NAME, mAtlasRect); } - EnablePreMultipliedAlpha(preMultiplied); + EnablePreMultipliedAlpha(textureInformation.preMultiplied); Actor actor = mPlacementActor.GetHandle(); if(!loadingSuccess) @@ -874,14 +874,14 @@ void ImageVisual::UploadComplete(bool loadingSuccess, int32_t textureId, Texture imageSize = actor.GetProperty(Actor::Property::SIZE).Get(); } mFactoryCache.UpdateBrokenImageRenderer(mImpl->mRenderer, imageSize); - textureSet = mImpl->mRenderer.GetTextures(); + textureInformation.textureSet = mImpl->mRenderer.GetTextures(); } else { Sampler sampler = Sampler::New(); sampler.SetWrapMode(mWrapModeU, mWrapModeV); - textureSet.SetSampler(0u, sampler); - mImpl->mRenderer.SetTextures(textureSet); + textureInformation.textureSet.SetSampler(0u, sampler); + mImpl->mRenderer.SetTextures(textureInformation.textureSet); } if(actor) @@ -895,7 +895,7 @@ void ImageVisual::UploadComplete(bool loadingSuccess, int32_t textureId, Texture // Storing TextureSet needed when renderer staged. if(!mImpl->mRenderer) { - mTextures = textureSet; + mTextures = textureInformation.textureSet; } // Image loaded, set status regardless of staged status.