From 012e4ab153337cb973a623d6b03c274231ef68b5 Mon Sep 17 00:00:00 2001 From: Robert Bragg Date: Wed, 8 Sep 2010 01:03:15 +0100 Subject: [PATCH] x11: Queue clipped redraws for Expose events Instead of triggering a full stage redraw for Expose events we use the geometry of the exposed region given in the event to queue a clipped redraw of the stage. --- clutter/x11/clutter-event-x11.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/clutter/x11/clutter-event-x11.c b/clutter/x11/clutter-event-x11.c index f02be504b..63d5913e5 100644 --- a/clutter/x11/clutter-event-x11.c +++ b/clutter/x11/clutter-event-x11.c @@ -692,6 +692,33 @@ event_translate (ClutterBackend *backend, { CLUTTER_NOTE (MULTISTAGE, "expose for stage: %p, redrawing", stage); clutter_actor_queue_redraw (CLUTTER_ACTOR (stage)); + XExposeEvent *expose = (XExposeEvent *)xevent; + ClutterPaintVolume clip; + ClutterVertex origin; + + CLUTTER_NOTE (MULTISTAGE, + "expose for stage: %p, " + "redrawing (x=%d, y=%d, width=%d, height=%d)", + stage, + expose->x, + expose->y, + expose->width, + expose->height); + + origin.x = expose->x; + origin.y = expose->y; + origin.z = 0; + + _clutter_paint_volume_init_static (CLUTTER_ACTOR (stage), &clip); + + clutter_paint_volume_set_origin (&clip, &origin); + clutter_paint_volume_set_width (&clip, expose->width); + clutter_paint_volume_set_height (&clip, expose->height); + + _clutter_actor_queue_redraw_with_clip (CLUTTER_ACTOR (stage), 0, &clip); + + clutter_paint_volume_free (&clip); + res = FALSE; } break;