[gtk/wip/baedert/for-master] widget: Re-shuffle preconditions in snapshot_child()



commit 5406851a3711a2d0a2ab40eb020738c39724174c
Author: Timm Bäder <mail baedert org>
Date:   Sat Jun 6 12:22:46 2020 +0200

    widget: Re-shuffle preconditions in snapshot_child()
    
    The GtkNative type check is more expensive than the mapped one, so avoid
    the former for unmapped widgets

 gtk/gtkwidget.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index b840726959..be2b26f9d8 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -12045,10 +12045,10 @@ gtk_widget_snapshot_child (GtkWidget   *widget,
   g_return_if_fail (_gtk_widget_get_parent (child) == widget);
   g_return_if_fail (snapshot != NULL);
 
-  if (GTK_IS_NATIVE (child))
+  if (!_gtk_widget_get_mapped (child))
     return;
 
-  if (!_gtk_widget_get_mapped (child))
+  if (GTK_IS_NATIVE (child))
     return;
 
   gtk_widget_do_snapshot (child, snapshot);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]