Blame SOURCES/0001-clutter-avoid-redundant-_clutter_paint_node_init_typ.patch

8156c2
From a9f9f9b36a03535480b31534547bea7c9f7cf4c1 Mon Sep 17 00:00:00 2001
8156c2
From: Christian Hergert <chergert@redhat.com>
8156c2
Date: Sun, 23 Feb 2020 17:27:08 -0800
8156c2
Subject: [PATCH 1/3] clutter: avoid redundant _clutter_paint_node_init_types()
8156c2
8156c2
This only needs to be initialized once but is in the hot path of creating
8156c2
new paint nodes (for which we create many). Instead, do this as part of
8156c2
the clutter_init() workflow to keep it out of the hot path.
8156c2
8156c2
https://gitlab.gnome.org/GNOME/mutter/merge_requests/1087
8156c2
---
8156c2
 clutter/clutter/clutter-main.c       | 4 ++++
8156c2
 clutter/clutter/clutter-paint-node.c | 2 --
8156c2
 2 files changed, 4 insertions(+), 2 deletions(-)
8156c2
8156c2
diff --git a/clutter/clutter/clutter-main.c b/clutter/clutter/clutter-main.c
8156c2
index 46537f322..8a465fdc2 100644
8156c2
--- a/clutter/clutter/clutter-main.c
8156c2
+++ b/clutter/clutter/clutter-main.c
8156c2
@@ -63,6 +63,7 @@
8156c2
 #include "clutter-main.h"
8156c2
 #include "clutter-master-clock.h"
8156c2
 #include "clutter-mutter.h"
8156c2
+#include "clutter-paint-node-private.h"
8156c2
 #include "clutter-private.h"
8156c2
 #include "clutter-settings-private.h"
8156c2
 #include "clutter-stage-manager.h"
8156c2
@@ -1390,6 +1391,9 @@ clutter_init_real (GError **error)
8156c2
   if (clutter_enable_accessibility)
8156c2
     cally_accessibility_init ();
8156c2
 
8156c2
+  /* Initialize types required for paint nodes */
8156c2
+  _clutter_paint_node_init_types ();
8156c2
+
8156c2
   return CLUTTER_INIT_SUCCESS;
8156c2
 }
8156c2
 
8156c2
diff --git a/clutter/clutter/clutter-paint-node.c b/clutter/clutter/clutter-paint-node.c
8156c2
index 391f48398..db68b7766 100644
8156c2
--- a/clutter/clutter/clutter-paint-node.c
8156c2
+++ b/clutter/clutter/clutter-paint-node.c
8156c2
@@ -1113,8 +1113,6 @@ _clutter_paint_node_create (GType gtype)
8156c2
 {
8156c2
   g_return_val_if_fail (g_type_is_a (gtype, CLUTTER_TYPE_PAINT_NODE), NULL);
8156c2
 
8156c2
-  _clutter_paint_node_init_types ();
8156c2
-
8156c2
   return (gpointer) g_type_create_instance (gtype);
8156c2
 }
8156c2
 
8156c2
-- 
8156c2
2.26.0
8156c2