Blame SOURCES/0003-clutter-fix-hole-in-ClutterPaintNode.patch

e82d74
From df565fcb681a50aac5046981c5aba04073d14856 Mon Sep 17 00:00:00 2001
e82d74
From: Christian Hergert <christian@hergert.me>
e82d74
Date: Fri, 21 Feb 2020 22:36:31 +0000
e82d74
Subject: [PATCH 3/3] clutter: fix hole in ClutterPaintNode
e82d74
e82d74
Fixing the missalignment takes the structure from 80 bytes down to 72.
e82d74
e82d74
https://gitlab.gnome.org/GNOME/mutter/merge_requests/1081
e82d74
---
e82d74
 clutter/clutter/clutter-actor.c              |  8 +++----
e82d74
 clutter/clutter/clutter-canvas.c             |  2 +-
e82d74
 clutter/clutter/clutter-image.c              |  2 +-
e82d74
 clutter/clutter/clutter-paint-node-private.h |  6 ++---
e82d74
 clutter/clutter/clutter-paint-node.c         | 23 +++++++++++++++-----
e82d74
 clutter/clutter/clutter-paint-node.h         |  3 +++
e82d74
 6 files changed, 30 insertions(+), 14 deletions(-)
e82d74
e82d74
diff --git a/clutter/clutter/clutter-actor.c b/clutter/clutter/clutter-actor.c
e82d74
index 93d0a93ef..ff5c4a69d 100644
e82d74
--- a/clutter/clutter/clutter-actor.c
e82d74
+++ b/clutter/clutter/clutter-actor.c
e82d74
@@ -3758,7 +3758,7 @@ clutter_actor_paint_node (ClutterActor     *actor,
e82d74
         clear_flags |= COGL_BUFFER_BIT_COLOR;
e82d74
 
e82d74
       node = clutter_root_node_new (fb, &bg_color, clear_flags);
e82d74
-      clutter_paint_node_set_name (node, "stageClear");
e82d74
+      clutter_paint_node_set_static_name (node, "stageClear");
e82d74
       clutter_paint_node_add_rectangle (node, &box);
e82d74
       clutter_paint_node_add_child (root, node);
e82d74
       clutter_paint_node_unref (node);
e82d74
@@ -3773,7 +3773,7 @@ clutter_actor_paint_node (ClutterActor     *actor,
e82d74
                      / 255;
e82d74
 
e82d74
       node = clutter_color_node_new (&bg_color);
e82d74
-      clutter_paint_node_set_name (node, "backgroundColor");
e82d74
+      clutter_paint_node_set_static_name (node, "backgroundColor");
e82d74
       clutter_paint_node_add_rectangle (node, &box);
e82d74
       clutter_paint_node_add_child (root, node);
e82d74
       clutter_paint_node_unref (node);
e82d74
@@ -4069,7 +4069,7 @@ clutter_actor_continue_paint (ClutterActor *self)
e82d74
            * virtual function can then be called directly.
e82d74
            */
e82d74
           dummy = _clutter_dummy_node_new (self);
e82d74
-          clutter_paint_node_set_name (dummy, "Root");
e82d74
+          clutter_paint_node_set_static_name (dummy, "Root");
e82d74
 
e82d74
           /* XXX - for 1.12, we use the return value of paint_node() to
e82d74
            * decide whether we should emit the ::paint signal.
e82d74
@@ -21427,7 +21427,7 @@ clutter_actor_create_texture_paint_node (ClutterActor *self,
e82d74
   color.alpha = clutter_actor_get_paint_opacity_internal (self);
e82d74
 
e82d74
   node = clutter_texture_node_new (texture, &color, priv->min_filter, priv->mag_filter);
e82d74
-  clutter_paint_node_set_name (node, "Texture");
e82d74
+  clutter_paint_node_set_static_name (node, "Texture");
e82d74
 
e82d74
   if (priv->content_repeat == CLUTTER_REPEAT_NONE)
e82d74
     clutter_paint_node_add_rectangle (node, &box);
e82d74
diff --git a/clutter/clutter/clutter-canvas.c b/clutter/clutter/clutter-canvas.c
e82d74
index b0f1f080c..89c031be2 100644
e82d74
--- a/clutter/clutter/clutter-canvas.c
e82d74
+++ b/clutter/clutter/clutter-canvas.c
e82d74
@@ -351,7 +351,7 @@ clutter_canvas_paint_content (ClutterContent   *content,
e82d74
     return;
e82d74
 
e82d74
   node = clutter_actor_create_texture_paint_node (actor, priv->texture);
e82d74
-  clutter_paint_node_set_name (node, "Canvas Content");
e82d74
+  clutter_paint_node_set_static_name (node, "Canvas Content");
e82d74
   clutter_paint_node_add_child (root, node);
e82d74
   clutter_paint_node_unref (node);
e82d74
 
e82d74
diff --git a/clutter/clutter/clutter-image.c b/clutter/clutter/clutter-image.c
e82d74
index 266c68799..790e09521 100644
e82d74
--- a/clutter/clutter/clutter-image.c
e82d74
+++ b/clutter/clutter/clutter-image.c
e82d74
@@ -129,7 +129,7 @@ clutter_image_paint_content (ClutterContent   *content,
e82d74
     return;
e82d74
 
e82d74
   node = clutter_actor_create_texture_paint_node (actor, priv->texture);
e82d74
-  clutter_paint_node_set_name (node, "Image Content");
e82d74
+  clutter_paint_node_set_static_name (node, "Image Content");
e82d74
   clutter_paint_node_add_child (root, node);
e82d74
   clutter_paint_node_unref (node);
e82d74
 }
e82d74
diff --git a/clutter/clutter/clutter-paint-node-private.h b/clutter/clutter/clutter-paint-node-private.h
e82d74
index d61b89951..720df1458 100644
e82d74
--- a/clutter/clutter/clutter-paint-node-private.h
e82d74
+++ b/clutter/clutter/clutter-paint-node-private.h
e82d74
@@ -48,11 +48,11 @@ struct _ClutterPaintNode
e82d74
   ClutterPaintNode *next_sibling;
e82d74
   ClutterPaintNode *last_child;
e82d74
 
e82d74
-  guint n_children;
e82d74
-
e82d74
   GArray *operations;
e82d74
 
e82d74
-  gchar *name;
e82d74
+  const gchar *name;
e82d74
+
e82d74
+  guint n_children;
e82d74
 
e82d74
   volatile int ref_count;
e82d74
 };
e82d74
diff --git a/clutter/clutter/clutter-paint-node.c b/clutter/clutter/clutter-paint-node.c
e82d74
index 73765a4e9..1f9451a43 100644
e82d74
--- a/clutter/clutter/clutter-paint-node.c
e82d74
+++ b/clutter/clutter/clutter-paint-node.c
e82d74
@@ -171,8 +171,6 @@ clutter_paint_node_real_finalize (ClutterPaintNode *node)
e82d74
 {
e82d74
   ClutterPaintNode *iter;
e82d74
 
e82d74
-  g_free (node->name);
e82d74
-
e82d74
   if (node->operations != NULL)
e82d74
     {
e82d74
       guint i;
e82d74
@@ -294,7 +292,8 @@ clutter_paint_node_get_type (void)
e82d74
  *
e82d74
  * The @name will be used for debugging purposes.
e82d74
  *
e82d74
- * The @node will copy the passed string.
e82d74
+ * The @node will intern @name using g_intern_string(). If you have access to a
e82d74
+ * static string, use clutter_paint_node_set_static_name() instead.
e82d74
  *
e82d74
  * Since: 1.10
e82d74
  */
e82d74
@@ -304,8 +303,22 @@ clutter_paint_node_set_name (ClutterPaintNode *node,
e82d74
 {
e82d74
   g_return_if_fail (CLUTTER_IS_PAINT_NODE (node));
e82d74
 
e82d74
-  g_free (node->name);
e82d74
-  node->name = g_strdup (name);
e82d74
+  node->name = g_intern_string (name);
e82d74
+}
e82d74
+
e82d74
+/**
e82d74
+ * clutter_paint_node_set_static_name: (skip)
e82d74
+ *
e82d74
+ * Like clutter_paint_node_set_name() but uses a static or interned string
e82d74
+ * containing the name.
e82d74
+ */
e82d74
+void
e82d74
+clutter_paint_node_set_static_name (ClutterPaintNode *node,
e82d74
+                                    const char       *name)
e82d74
+{
e82d74
+  g_return_if_fail (CLUTTER_IS_PAINT_NODE (node));
e82d74
+
e82d74
+  node->name = name;
e82d74
 }
e82d74
 
e82d74
 /**
e82d74
diff --git a/clutter/clutter/clutter-paint-node.h b/clutter/clutter/clutter-paint-node.h
e82d74
index c42abbc3d..7d25f1681 100644
e82d74
--- a/clutter/clutter/clutter-paint-node.h
e82d74
+++ b/clutter/clutter/clutter-paint-node.h
e82d74
@@ -55,6 +55,9 @@ void                    clutter_paint_node_paint                        (Clutter
e82d74
 CLUTTER_EXPORT
e82d74
 void                    clutter_paint_node_set_name                     (ClutterPaintNode      *node,
e82d74
                                                                          const char            *name);
e82d74
+CLUTTER_EXPORT
e82d74
+void                    clutter_paint_node_set_static_name              (ClutterPaintNode      *node,
e82d74
+                                                                         const char            *name);
e82d74
 
e82d74
 CLUTTER_EXPORT
e82d74
 void                    clutter_paint_node_add_child                    (ClutterPaintNode      *node,
e82d74
-- 
e82d74
2.26.0
e82d74