[NUI] Ignore ImageView's equal value update
authorEunki, Hong <eunkiki.hong@samsung.com>
Thu, 14 Jul 2022 06:17:41 +0000 (15:17 +0900)
committerdongsug-song <35130733+dongsug-song@users.noreply.github.com>
Tue, 19 Jul 2022 05:51:42 +0000 (14:51 +0900)
Let we check if inputed value is equal with cached value.
If it is same, then we don't need to re-generate resource.

Signed-off-by: Eunki, Hong <eunkiki.hong@samsung.com>
src/Tizen.NUI/src/public/BaseComponents/ImageView.cs

index 38b50b0..a5703df 100755 (executable)
@@ -1330,6 +1330,19 @@ namespace Tizen.NUI.BaseComponents
                 {
                     cachedImagePropertyMap = new PropertyMap();
                 }
+
+                // To optimization, we don't check URL duplicate case. We already checked before.
+                if (key != ImageVisualProperty.URL)
+                {
+                    using (PropertyValue oldValue = GetCachedImageVisualProperty(key))
+                    {
+                        if (oldValue != null && oldValue.EqualTo(value))
+                        {
+                            // Ignore UpdateImage query when we try to update equality value.
+                            return;
+                        }
+                    }
+                }
                 imagePropertyUpdatedFlag = true;
                 cachedImagePropertyMap[key] = value;