wayland/surface: Use queue_redraw_with_clip()

Just like the X11 texture-pixmap actor.

https://bugzilla.gnome.org/show_bug.cgi?id=660997
This commit is contained in:
Emmanuele Bassi 2011-12-12 16:44:47 +00:00
parent 30c464e68f
commit f0468cf828

View File

@ -100,16 +100,16 @@ clutter_wayland_surface_queue_damage_redraw (ClutterWaylandSurface *texture,
float scale_x; float scale_x;
float scale_y; float scale_y;
ClutterVertex origin; ClutterVertex origin;
ClutterPaintVolume clip; cairo_rectangle_int_t clip;
/* NB: clutter_actor_queue_clipped_redraw expects a box in the actor's /* NB: clutter_actor_queue_redraw_with_clip expects a box in the actor's
* coordinate space so we need to convert from surface coordinates to * coordinate space so we need to convert from surface coordinates to
* actor coordinates... * actor coordinates...
*/ */
/* Calling clutter_actor_get_allocation_box() is enormously expensive /* Calling clutter_actor_get_allocation_box() is enormously expensive
* if the actor has an out-of-date allocation, since it triggers * if the actor has an out-of-date allocation, since it triggers
* a full redraw. clutter_actor_queue_clipped_redraw() would redraw * a full redraw. clutter_actor_queue_redraw_with_clip() would redraw
* the whole stage anyways in that case, so just go ahead and do * the whole stage anyways in that case, so just go ahead and do
* it here. * it here.
*/ */
@ -127,17 +127,11 @@ clutter_wayland_surface_queue_damage_redraw (ClutterWaylandSurface *texture,
scale_x = (allocation.x2 - allocation.x1) / priv->width; scale_x = (allocation.x2 - allocation.x1) / priv->width;
scale_y = (allocation.y2 - allocation.y1) / priv->height; scale_y = (allocation.y2 - allocation.y1) / priv->height;
_clutter_paint_volume_init_static (&clip, self); clip.x = x * scale_x;
clip.y = y * scale_y;
origin.x = x * scale_x; clip.width = width * scale_x;
origin.y = y * scale_y; clip.height = height * scale_y;
origin.z = 0; clutter_actor_queue_redraw_with_clip (self, &clip);
clutter_paint_volume_set_origin (&clip, &origin);
clutter_paint_volume_set_width (&clip, width * scale_x);
clutter_paint_volume_set_height (&clip, height * scale_y);
_clutter_actor_queue_redraw_with_clip (self, 0, &clip);
clutter_paint_volume_free (&clip);
} }
static void static void