compositor: ignore useless surface_damage

If we pass negative height or width on to pixman we get error messages
in the log.

Also, if width or height is 0, there's no damage, so we can early return
for that too.

Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
dev
Derek Foreman 9 years ago
parent 35da52debe
commit 57e92ed768
  1. 3
      src/compositor.c

@ -2579,6 +2579,9 @@ surface_damage(struct wl_client *client,
{ {
struct weston_surface *surface = wl_resource_get_user_data(resource); struct weston_surface *surface = wl_resource_get_user_data(resource);
if (width <= 0 || height <= 0)
return;
pixman_region32_union_rect(&surface->pending.damage, pixman_region32_union_rect(&surface->pending.damage,
&surface->pending.damage, &surface->pending.damage,
x, y, width, height); x, y, width, height);

Loading…
Cancel
Save