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>
This commit is contained in:
Derek Foreman 2015-11-17 14:11:35 -06:00
parent 35da52debe
commit 57e92ed768

View file

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