[PATCH] Use the correct width/height when transforming surfaces with viewports.

Kristian Høgsberg hoegsberg at gmail.com
Fri Apr 25 13:28:00 PDT 2014


On Tue, Apr 22, 2014 at 09:51:53AM +0300, Pekka Paalanen wrote:
> On Mon, 21 Apr 2014 20:56:46 -0500
> Jason Ekstrand <jason at jlekstrand.net> wrote:
> 
> > Previously, because of the wrong width/height,
> > weston_surface_to_buffer_* would return the wrong values when
> > wl_viewport was used in combination with wl_surface.set_buffer_transform.
> > 
> > Signed-off-by: Jason Ekstrand <jason at jlekstrand.net>

Committed this one and the pixman-renderer, with Pekkas Reviewed-by added.

Kristian

> > ---
> >  src/compositor.c | 6 ++++--
> >  1 file changed, 4 insertions(+), 2 deletions(-)
> > 
> > diff --git a/src/compositor.c b/src/compositor.c
> > index a298fb8..342e5e4 100644
> > --- a/src/compositor.c
> > +++ b/src/compositor.c
> > @@ -675,7 +675,8 @@ weston_surface_to_buffer_float(struct weston_surface *surface,
> >  	/* first transform coordinates if the scaler is set */
> >  	scaler_surface_to_buffer(surface, sx, sy, bx, by);
> >  
> > -	weston_transformed_coord(surface->width, surface->height,
> > +	weston_transformed_coord(surface->width_from_buffer,
> > +				 surface->height_from_buffer,
> >  				 vp->buffer.transform, vp->buffer.scale,
> >  				 *bx, *by, bx, by);
> >  }
> > @@ -709,7 +710,8 @@ weston_surface_to_buffer_rect(struct weston_surface *surface,
> >  	rect.x2 = floorf(xf);
> >  	rect.y2 = floorf(yf);
> >  
> > -	return weston_transformed_rect(surface->width, surface->height,
> > +	return weston_transformed_rect(surface->width_from_buffer,
> > +				       surface->height_from_buffer,
> >  				       vp->buffer.transform, vp->buffer.scale,
> >  				       rect);
> >  }
> 
> Hi Jason,
> 
> good catch, this looks correct.
> 
> 
> Thanks,
> pq
> _______________________________________________
> 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