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

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