[PATCH weston] Fix the pixman renderer with respect to output transforms

Bryce W. Harrington b.harrington at samsung.com
Mon Mar 10 19:12:03 PDT 2014


On Tue, Feb 25, 2014 at 09:54:59PM -0600, Jason Ekstrand wrote:
> Commit fa1b3055 introducted a regression in the pixman renderer.  In
> particular, it would not draw properly with any output transform other
> than normal, 180, 180-flipped, or 270-flipped.  This patch fixes this
> regression.  The weston-scalar program appears to work normally at all
> rotations with this patch.  Therefore, this patch should fix the regression
> while maintaining the added functionality from fa1b3055.
> 
> Signed-off-by: Jason Ekstrand <jason at jlekstrand.net>
> ---
>  src/pixman-renderer.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/src/pixman-renderer.c b/src/pixman-renderer.c
> index 26f6f27..e9e907e 100644
> --- a/src/pixman-renderer.c
> +++ b/src/pixman-renderer.c
> @@ -276,12 +276,8 @@ repaint_region(struct weston_view *ev, struct weston_output *output,
>  							     pixman_double_to_fixed(viewport_y));
>  	}
>  
> -	pixman_transform_scale(&transform, NULL,
> -			       pixman_double_to_fixed(ev->surface->buffer_viewport.scale),
> -			       pixman_double_to_fixed(ev->surface->buffer_viewport.scale));
> -
> -	fw = pixman_int_to_fixed(pixman_image_get_width(ps->image));
> -	fh = pixman_int_to_fixed(pixman_image_get_height(ps->image));
> +	fw = pixman_int_to_fixed(ev->surface->width);
> +	fh = pixman_int_to_fixed(ev->surface->height);
>  
>  	switch (ev->surface->buffer_viewport.transform) {
>  	case WL_OUTPUT_TRANSFORM_FLIPPED:
> @@ -317,6 +313,10 @@ repaint_region(struct weston_view *ev, struct weston_output *output,
>  		break;
>  	}
>  
> +	pixman_transform_scale(&transform, NULL,
> +			       pixman_double_to_fixed(ev->surface->buffer_viewport.scale),
> +			       pixman_double_to_fixed(ev->surface->buffer_viewport.scale));

The original code cast the two int32_t scale parameters to (double).
Guessing this is still needed?

> +
>  	pixman_image_set_transform(ps->image, &transform);
>  
>  	if (ev->transform.enabled || output->current_scale != ev->surface->buffer_viewport.scale)

Reviewed-by: Bryce Harrington <b.harrington at samsung.com>


More information about the wayland-devel mailing list