<div dir="ltr">I fully support any patch that removes the phrase "modelview".<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Apr 25, 2014 at 5:07 PM, Kristian Høgsberg <span dir="ltr"><<a href="mailto:hoegsberg@gmail.com" target="_blank">hoegsberg@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="">On Fri, Apr 25, 2014 at 01:19:37PM +0100, Neil Roberts wrote:<br>
> In order to apply the zoom transformation to the output matrix, Weston was<br>
> doing the following:<br>
><br>
> • Create a temporary matrix to hold the translation<br>
> • Invert the translation matrix using weston_matrix_invert into<br>
>   another temporary matrix<br>
> • Scale that matrix by the scale factor<br>
> • Multiply the current matrix with the temporary matrix<br>
><br>
> Using weston_matrix_invert to invert a translation matrix is over the top.<br>
> Instead we can just negate the values we pass to weston_matrix_translate.<br>
> Matrix multiplication is associative so creating a temporary matrix to hold the<br>
> scale and translation transform should be equivalent to just applying them<br>
> directly to the output matrix.<br>
<br>
</div>Heh, nice clean up, that always looked like it was too complicated for its<br>
own good.  Patch applied.<br>
<span class="HOEnZb"><font color="#888888"><br>
Kristian<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
> ---<br>
>  src/compositor.c | 13 ++++---------<br>
>  1 file changed, 4 insertions(+), 9 deletions(-)<br>
><br>
> diff --git a/src/compositor.c b/src/compositor.c<br>
> index fd2decb..f836cf7 100644<br>
> --- a/src/compositor.c<br>
> +++ b/src/compositor.c<br>
> @@ -3186,8 +3186,6 @@ WL_EXPORT void<br>
>  weston_output_update_matrix(struct weston_output *output)<br>
>  {<br>
>       float magnification;<br>
> -     struct weston_matrix camera;<br>
> -     struct weston_matrix modelview;<br>
><br>
>       weston_matrix_init(&output->matrix);<br>
>       weston_matrix_translate(&output->matrix,<br>
> @@ -3202,14 +3200,11 @@ weston_output_update_matrix(struct weston_output *output)<br>
><br>
>       if (output->zoom.active) {<br>
>               magnification = 1 / (1 - output->zoom.spring_z.current);<br>
> -             weston_matrix_init(&camera);<br>
> -             weston_matrix_init(&modelview);<br>
>               weston_output_update_zoom(output);<br>
> -             weston_matrix_translate(&camera, output->zoom.trans_x,<br>
> -                                     -output->zoom.trans_y, 0);<br>
> -             weston_matrix_invert(&modelview, &camera);<br>
> -             weston_matrix_scale(&modelview, magnification, magnification, 1.0);<br>
> -             weston_matrix_multiply(&output->matrix, &modelview);<br>
> +             weston_matrix_translate(&output->matrix, -output->zoom.trans_x,<br>
> +                                     output->zoom.trans_y, 0);<br>
> +             weston_matrix_scale(&output->matrix, magnification,<br>
> +                                 magnification, 1.0);<br>
>       }<br>
><br>
>       output->dirty = 0;<br>
> --<br>
> 1.9.0<br>
><br>
> _______________________________________________<br>
> wayland-devel mailing list<br>
> <a href="mailto:wayland-devel@lists.freedesktop.org">wayland-devel@lists.freedesktop.org</a><br>
> <a href="http://lists.freedesktop.org/mailman/listinfo/wayland-devel" target="_blank">http://lists.freedesktop.org/mailman/listinfo/wayland-devel</a><br>
_______________________________________________<br>
wayland-devel mailing list<br>
<a href="mailto:wayland-devel@lists.freedesktop.org">wayland-devel@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/wayland-devel" target="_blank">http://lists.freedesktop.org/mailman/listinfo/wayland-devel</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>  Jasper<br>
</div>