clutter: Add va_marshallers for stage signals

Adds va_marshallers to the ClutterStage signals. This allows for better
stack traces to be retrieved when profiling. Additionally, since the
generic marshaller was using GBoxedCopy/GBoxedFree functions for the
GValue usage, the previous code was acquiring a global reader/writer
lock in GObject via g_boxed_free() usage.

With G_SIGNAL_TYPE_STATIC_SCOPE, the generated marshallers can avoid
the additional copy/free on the instance.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3204>
This commit is contained in:
Christian Hergert 2023-08-22 22:43:37 -07:00 committed by Marge Bot
parent 234358ec38
commit 150a9e35ad
2 changed files with 47 additions and 15 deletions

View File

@ -18,6 +18,8 @@ VOID:INT,INT
VOID:INT,POINTER
VOID:FLOAT,FLOAT
VOID:INT,INT,INT,INT
VOID:OBJECT,BOXED
VOID:OBJECT,BOXED,BOXED
VOID:OBJECT,FLAGS
VOID:OBJECT,FLAGS,BOOLEAN
VOID:OBJECT,FLAGS,UINT

View File

@ -23,7 +23,7 @@
/**
* ClutterStage:
*
*
* Top level visual element to which actors are placed.
*
* #ClutterStage is a top level 'window' on which child actors are placed
@ -1471,10 +1471,15 @@ clutter_stage_class_init (ClutterStageClass *klass)
G_TYPE_FROM_CLASS (gobject_class),
G_SIGNAL_RUN_LAST,
0,
NULL, NULL, NULL,
NULL, NULL,
_clutter_marshal_VOID__OBJECT_BOXED,
G_TYPE_NONE, 2,
CLUTTER_TYPE_STAGE_VIEW,
CLUTTER_TYPE_FRAME);
CLUTTER_TYPE_FRAME | G_SIGNAL_TYPE_STATIC_SCOPE);
g_signal_set_va_marshaller (stage_signals[BEFORE_UPDATE],
G_TYPE_FROM_CLASS (gobject_class),
_clutter_marshal_VOID__OBJECT_BOXEDv);
/**
* ClutterStage::prepare-frame:
* @stage: the stage that received the event
@ -1489,10 +1494,14 @@ clutter_stage_class_init (ClutterStageClass *klass)
G_TYPE_FROM_CLASS (gobject_class),
G_SIGNAL_RUN_LAST,
0,
NULL, NULL, NULL,
NULL, NULL,
_clutter_marshal_VOID__OBJECT_BOXED,
G_TYPE_NONE, 2,
CLUTTER_TYPE_STAGE_VIEW,
CLUTTER_TYPE_FRAME);
CLUTTER_TYPE_FRAME | G_SIGNAL_TYPE_STATIC_SCOPE);
g_signal_set_va_marshaller (stage_signals[PREPARE_FRAME],
G_TYPE_FROM_CLASS (gobject_class),
_clutter_marshal_VOID__OBJECT_BOXEDv);
/**
* ClutterStage::before-paint:
@ -1507,10 +1516,15 @@ clutter_stage_class_init (ClutterStageClass *klass)
G_TYPE_FROM_CLASS (gobject_class),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (ClutterStageClass, before_paint),
NULL, NULL, NULL,
NULL, NULL,
_clutter_marshal_VOID__OBJECT_BOXED,
G_TYPE_NONE, 2,
CLUTTER_TYPE_STAGE_VIEW,
CLUTTER_TYPE_FRAME);
CLUTTER_TYPE_FRAME | G_SIGNAL_TYPE_STATIC_SCOPE);
g_signal_set_va_marshaller (stage_signals[BEFORE_PAINT],
G_TYPE_FROM_CLASS (gobject_class),
_clutter_marshal_VOID__OBJECT_BOXEDv);
/**
* ClutterStage::after-paint:
* @stage: the stage that received the event
@ -1525,10 +1539,14 @@ clutter_stage_class_init (ClutterStageClass *klass)
G_TYPE_FROM_CLASS (gobject_class),
G_SIGNAL_RUN_LAST,
0, /* no corresponding vfunc */
NULL, NULL, NULL,
NULL, NULL,
_clutter_marshal_VOID__OBJECT_BOXED,
G_TYPE_NONE, 2,
CLUTTER_TYPE_STAGE_VIEW,
CLUTTER_TYPE_FRAME);
CLUTTER_TYPE_FRAME | G_SIGNAL_TYPE_STATIC_SCOPE);
g_signal_set_va_marshaller (stage_signals[AFTER_PAINT],
G_TYPE_FROM_CLASS (gobject_class),
_clutter_marshal_VOID__OBJECT_BOXEDv);
/**
* ClutterStage::after-update:
@ -1541,10 +1559,14 @@ clutter_stage_class_init (ClutterStageClass *klass)
G_TYPE_FROM_CLASS (gobject_class),
G_SIGNAL_RUN_LAST,
0,
NULL, NULL, NULL,
NULL, NULL,
_clutter_marshal_VOID__OBJECT_BOXED,
G_TYPE_NONE, 2,
CLUTTER_TYPE_STAGE_VIEW,
CLUTTER_TYPE_FRAME);
CLUTTER_TYPE_FRAME | G_SIGNAL_TYPE_STATIC_SCOPE);
g_signal_set_va_marshaller (stage_signals[AFTER_UPDATE],
G_TYPE_FROM_CLASS (gobject_class),
_clutter_marshal_VOID__OBJECT_BOXEDv);
/**
* ClutterStage::paint-view:
@ -1565,11 +1587,15 @@ clutter_stage_class_init (ClutterStageClass *klass)
G_TYPE_FROM_CLASS (gobject_class),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (ClutterStageClass, paint_view),
NULL, NULL, NULL,
NULL, NULL,
_clutter_marshal_VOID__OBJECT_BOXED_BOXED,
G_TYPE_NONE, 3,
CLUTTER_TYPE_STAGE_VIEW,
CAIRO_GOBJECT_TYPE_REGION,
CLUTTER_TYPE_FRAME);
CAIRO_GOBJECT_TYPE_REGION | G_SIGNAL_TYPE_STATIC_SCOPE,
CLUTTER_TYPE_FRAME | G_SIGNAL_TYPE_STATIC_SCOPE);
g_signal_set_va_marshaller (stage_signals[PAINT_VIEW],
G_TYPE_FROM_CLASS (gobject_class),
_clutter_marshal_VOID__OBJECT_BOXED_BOXEDv);
/**
* ClutterStage::presented: (skip)
@ -1584,10 +1610,14 @@ clutter_stage_class_init (ClutterStageClass *klass)
G_TYPE_FROM_CLASS (gobject_class),
G_SIGNAL_RUN_LAST,
0,
NULL, NULL, NULL,
NULL, NULL,
_clutter_marshal_VOID__OBJECT_POINTER,
G_TYPE_NONE, 2,
CLUTTER_TYPE_STAGE_VIEW,
G_TYPE_POINTER);
g_signal_set_va_marshaller (stage_signals[PRESENTED],
G_TYPE_FROM_CLASS (gobject_class),
_clutter_marshal_VOID__OBJECT_POINTERv);
/**
* ClutterStage::gl-video-memory-purged: (skip)