[gtk+/wip/alexl/broadway4: 38/39] broadway: Don't send node updates to browser if nothing changed



commit af890e66777497c732bc2117d3f013fa1557d1e9
Author: Alexander Larsson <alexl redhat com>
Date:   Thu Nov 30 17:32:01 2017 +0100

    broadway: Don't send node updates to browser if nothing changed

 gdk/broadway/broadway-output.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/gdk/broadway/broadway-output.c b/gdk/broadway/broadway-output.c
index 2265262..81332fa 100644
--- a/gdk/broadway/broadway-output.c
+++ b/gdk/broadway/broadway-output.c
@@ -373,6 +373,12 @@ broadway_output_window_set_nodes (BroadwayOutput *output,
                                   BroadwayNode   *old_root)
 {
   gsize size_pos, start, end;
+
+  /* Early return if nothing changed */
+  if (old_root != NULL &&
+      broadway_node_deep_equal (root, old_root))
+    return;
+
   write_header (output, BROADWAY_OP_SET_NODES);
 
   append_uint16 (output, id);


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