X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fcontrols%2Fsuper-blur-view%2Fsuper-blur-view-impl.cpp;h=4aedfc001b737b8397ffc16651af9dc4e718cb53;hb=HEAD;hp=7ea1492e2f705f5538ac9e1d09282930e2e0b4a2;hpb=e1f62b191823249c41ecbdf79ac33b082e5b8dc9;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/internal/controls/super-blur-view/super-blur-view-impl.cpp b/dali-toolkit/internal/controls/super-blur-view/super-blur-view-impl.cpp index 7ea1492..4aedfc0 100644 --- a/dali-toolkit/internal/controls/super-blur-view/super-blur-view-impl.cpp +++ b/dali-toolkit/internal/controls/super-blur-view/super-blur-view-impl.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Samsung Electronics Co., Ltd. + * Copyright (c) 2024 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. @@ -192,7 +192,7 @@ void SuperBlurView::SetBlurStrength(float blurStrength) float SuperBlurView::GetCurrentBlurStrength() const { - float blurStrength; + float blurStrength = 0.0f; (Self().GetProperty(mBlurStrengthPropertyIndex)).Get(blurStrength); return blurStrength; @@ -353,20 +353,21 @@ void SuperBlurView::SetProperty(BaseObject* object, Property::Index propertyInde if(propertyIndex == Toolkit::SuperBlurView::Property::IMAGE_URL) { - value.Get(superBlurViewImpl.mUrl); - - PixelData pixels = SyncImageLoader::Load(superBlurViewImpl.mUrl); - - if(pixels) - { - Texture texture = Texture::New(TextureType::TEXTURE_2D, pixels.GetPixelFormat(), pixels.GetWidth(), pixels.GetHeight()); - texture.Upload(pixels, 0, 0, 0, 0, pixels.GetWidth(), pixels.GetHeight()); - - superBlurViewImpl.SetTexture(texture); - } - else + if(DALI_LIKELY(value.Get(superBlurViewImpl.mUrl))) { - DALI_LOG_ERROR("Cannot create image from property value\n"); + PixelData pixels = SyncImageLoader::Load(superBlurViewImpl.mUrl); + + if(pixels) + { + Texture texture = Texture::New(TextureType::TEXTURE_2D, pixels.GetPixelFormat(), pixels.GetWidth(), pixels.GetHeight()); + texture.Upload(pixels, 0, 0, 0, 0, pixels.GetWidth(), pixels.GetHeight()); + + superBlurViewImpl.SetTexture(texture); + } + else + { + DALI_LOG_ERROR("Cannot create image from property value\n"); + } } } }