[mutter/wip/nielsdg/cursor-moved-marshal: 1/3] cursor-tracker: Use our own marshal for cursor-moved
- From: Niels De Graef <nielsdg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter/wip/nielsdg/cursor-moved-marshal: 1/3] cursor-tracker: Use our own marshal for cursor-moved
- Date: Wed, 24 Jul 2019 09:26:19 +0000 (UTC)
commit 8600e62d3c200fdb018cc996299de8532532e090
Author: Niels De Graef <nielsdegraef gmail com>
Date: Wed Jul 24 07:42:07 2019 +0200
cursor-tracker: Use our own marshal for cursor-moved
By putting `NULL` as the C marshaller in `g_signal_new`, you
automatically get `g_cclosure_marshaller_generic`, which will try to
process its arguments and return value with the help of libffi and
GValue.
Using `glib-genmarshal` and valist_marshallers, we can prevent this so
that we need less instructions for each signal emission.
https://gitlab.gnome.org/GNOME/mutter/merge_requests/697
src/backends/meta-cursor-tracker.c | 4 +++-
src/meson.build | 8 ++++++++
src/meta-marshal.list | 1 +
3 files changed, 12 insertions(+), 1 deletion(-)
---
diff --git a/src/backends/meta-cursor-tracker.c b/src/backends/meta-cursor-tracker.c
index 74481dd1c..dba1cf04c 100644
--- a/src/backends/meta-cursor-tracker.c
+++ b/src/backends/meta-cursor-tracker.c
@@ -39,6 +39,7 @@
#include "backends/x11/cm/meta-cursor-sprite-xfixes.h"
#include "cogl/cogl.h"
#include "clutter/clutter.h"
+#include "meta-marshal.h"
#include "meta/main.h"
#include "meta/meta-x11-errors.h"
#include "meta/util.h"
@@ -170,7 +171,8 @@ meta_cursor_tracker_class_init (MetaCursorTrackerClass *klass)
G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST,
0,
- NULL, NULL, NULL,
+ NULL, NULL,
+ meta_marshal_VOID__FLOAT_FLOATv,
G_TYPE_NONE, 2,
G_TYPE_FLOAT,
G_TYPE_FLOAT);
diff --git a/src/meson.build b/src/meson.build
index 515638fe5..e682aa4fd 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -657,6 +657,14 @@ dbus_idle_monitor_built_sources = gnome.gdbus_codegen('meta-dbus-idle-monitor',
)
mutter_built_sources += dbus_idle_monitor_built_sources
+mutter_marshal = gnome.genmarshal('meta-marshal',
+ sources: ['meta-marshal.list'],
+ prefix: 'meta_marshal',
+ internal: true,
+ valist_marshallers: true,
+ )
+mutter_built_sources += mutter_marshal
+
if have_profiler
mutter_sources += [
'backends/meta-profiler.c',
diff --git a/src/meta-marshal.list b/src/meta-marshal.list
new file mode 100644
index 000000000..e26b60a8e
--- /dev/null
+++ b/src/meta-marshal.list
@@ -0,0 +1 @@
+VOID:FLOAT,FLOAT
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]