[PATCH weston 08/11] compositor: ignore surface_damage with negative height or width

Derek Foreman derekf at osg.samsung.com
Thu Nov 19 09:15:38 PST 2015


On 18/11/15 07:33 PM, Bill Spitzak wrote:
> 
> 
> On Wed, Nov 18, 2015 at 2:32 PM, Derek Foreman <derekf at osg.samsung.com
> <mailto:derekf at osg.samsung.com>> wrote:
> 
>     If we pass negative height or width on to pixman we get error messages
>     in the log.
> 
>     Signed-off-by: Derek Foreman <derekf at osg.samsung.com
>     <mailto:derekf at osg.samsung.com>>
>     ---
>      src/compositor.c | 3 +++
>      1 file changed, 3 insertions(+)
> 
>     diff --git a/src/compositor.c b/src/compositor.c
>     index 666bc15..0efb325 100644
>     --- a/src/compositor.c
>     +++ b/src/compositor.c
>     @@ -2574,6 +2574,9 @@ surface_damage(struct wl_client *client,
>      {
>             struct weston_surface *surface =
>     wl_resource_get_user_data(resource);
> 
>     +       if (width < 0 || height < 0)
>     +               return;
> 
> 
> Might as well quit on <= 0 here, since a zero-sized rectangle won't do
> anything.

Fair point, I've made the change locally.  When I've accumulated enough
feedback to make a v2 worthwhile it'll be there.

Thanks,
Derek

>             pixman_region32_union_rect(&surface->pending.damage,
>                                        &surface->pending.damage,
>                                        x, y, width, height);
> 
>  
> 
> 
> 
> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/wayland-devel
> 



More information about the wayland-devel mailing list