Avoid needless event copies when queueing from a backend to a stage

All backends follow the same pattern of queueing events first in
ClutterMainContext, then copying them to a ClutterStage queue and
immediately free them. Instead, we can just pass ownership of events
directly to ClutterStage thus avoiding the allocation and copy in
between.

https://bugzilla.gnome.org/show_bug.cgi?id=711857
This commit is contained in:
Rui Matos
2013-11-11 18:16:32 +01:00
committed by Emmanuele Bassi
parent 572504db4d
commit e70a0109f2
10 changed files with 20 additions and 20 deletions

View File

@ -51,6 +51,7 @@
#include "clutter-xkb-utils.h"
#include "clutter-backend-private.h"
#include "clutter-evdev.h"
#include "clutter-stage-private.h"
#include "clutter-device-manager-evdev.h"
@ -573,8 +574,7 @@ clutter_event_dispatch (GSource *g_source,
goto out;
/* forward the event into clutter for emission etc. */
clutter_do_event (event);
clutter_event_free (event);
_clutter_stage_queue_event (event->any.stage, event, FALSE);
/* update the device states *after* the event */
event_state = xkb_state_serialize_mods (seat->xkb, XKB_STATE_MODS_EFFECTIVE);