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

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