Call widget_instance_resize() only when the size is changed 01/306701/1 accepted/tizen/7.0/unified/20240227.085059 accepted/tizen/7.0/unified/20240227.131516
authorsunghyun kim <scholb.kim@samsung.com>
Mon, 26 Feb 2024 09:47:15 +0000 (18:47 +0900)
committersunghyun kim <scholb.kim@samsung.com>
Mon, 26 Feb 2024 10:05:32 +0000 (19:05 +0900)
After applying corner radius, WidgetView create widget visual per frame.
this point makes call relayout() every frame.
To avoid this problem, WidgetView check its size and call
widget_instance_resize only when the size is changed.

Change-Id: Icff97b88cbf6b70a508fe0cf2b10493dce60b081

widget_viewer_dali/internal/widget_view/widget_view_impl.cpp

index 1947f340c1b0950464b98586b161f07ba000186b..15c9f3bb861a929c02cd373fd9b2499e52f6030a 100644 (file)
@@ -1986,7 +1986,12 @@ void WidgetView::OnRelayout( const Vector2& size, RelayoutContainer& container )
   // in this case, we just save the size and do resize when instance is created.
   if( mCreated )
   {
-    widget_instance_resize(mInstanceId.c_str(), size.x, size.y);
+    if( (mWidth !=  size.x) || (mHeight != size.y))
+    {
+      widget_instance_resize(mInstanceId.c_str(), size.x, size.y);
+      mWidth = size.x;
+      mHeight = size.y;
+    }
   }
   else
   {