From e64d277b378c0d8db41272958df78f528f85a8da Mon Sep 17 00:00:00 2001 From: Eunki Hong Date: Thu, 4 Jan 2024 01:44:02 +0900 Subject: [PATCH] [NUI] Do not recreate visual when we change ImageColor only Since we don't need to re-create the visual if we only chage the ImageColor property, let we use UpdateProperty Action. Signed-off-by: Eunki Hong --- src/Tizen.NUI/src/public/BaseComponents/ImageView.cs | 2 +- src/Tizen.NUI/src/public/BaseComponents/ImageViewBindableProperty.cs | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Tizen.NUI/src/public/BaseComponents/ImageView.cs b/src/Tizen.NUI/src/public/BaseComponents/ImageView.cs index 0611ba1..6d469a8 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/ImageView.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/ImageView.cs @@ -1634,7 +1634,7 @@ namespace Tizen.NUI.BaseComponents } } } - imagePropertyUpdatedFlag = true; + imagePropertyUpdatedFlag |= requiredVisualCreation; cachedImagePropertyMap[key] = value; // Lazy update only if visual creation required, and _resourceUrl is not empty, and ProcessAttachedFlag is false. diff --git a/src/Tizen.NUI/src/public/BaseComponents/ImageViewBindableProperty.cs b/src/Tizen.NUI/src/public/BaseComponents/ImageViewBindableProperty.cs index ab6e689..05b6a59 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/ImageViewBindableProperty.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/ImageViewBindableProperty.cs @@ -581,7 +581,10 @@ namespace Tizen.NUI.BaseComponents if (newValue != null) { imageView.UpdateImage(Visual.Property.Opacity, new PropertyValue(((Color)newValue).A), false); - imageView.UpdateImage(Visual.Property.MixColor, new PropertyValue((Color)newValue)); + imageView.UpdateImage(Visual.Property.MixColor, new PropertyValue((Color)newValue), false); + + // Update property + Interop.View.InternalUpdateVisualPropertyVector4(imageView.SwigCPtr, ImageView.Property.IMAGE, Visual.Property.MixColor, Vector4.getCPtr((Color)newValue)); } }, defaultValueCreator: (bindable) => -- 2.7.4