[PATCH weston 1/4] compositor: update weston_surface:transform.matrix always
Scott Moreau
oreaus at gmail.com
Tue Dec 18 06:24:08 PST 2012
Hi Pekka,
I like the functionality these patches provide. It seems there was more
finagling than I figured there'd need to be. I've made a few nitpick
comments on some of the other patches in this set.
- Scott
On Tue, Dec 18, 2012 at 4:58 AM, Pekka Paalanen <ppaalanen at gmail.com> wrote:
> Update the matrix always, regardless of transform.enabled. Will make it
> easier to inherit a surface transform.
>
> Signed-off-by: Pekka Paalanen <ppaalanen at gmail.com>
> ---
> src/compositor.c | 5 +++++
> src/compositor.h | 6 ++++--
> 2 files changed, 9 insertions(+), 2 deletions(-)
>
> diff --git a/src/compositor.c b/src/compositor.c
> index e556766..0b37e63 100644
> --- a/src/compositor.c
> +++ b/src/compositor.c
> @@ -514,6 +514,11 @@ weston_surface_update_transform_disable(struct
> weston_surface *surface)
> surface->geometry.x = roundf(surface->geometry.x);
> surface->geometry.y = roundf(surface->geometry.y);
>
> + /* Otherwise identity matrix, but with x and y translation. */
> + weston_matrix_init(&surface->transform.matrix);
> + surface->transform.matrix.d[12] = surface->geometry.x;
> + surface->transform.matrix.d[13] = surface->geometry.y;
> +
> pixman_region32_init_rect(&surface->transform.boundingbox,
> surface->geometry.x,
> surface->geometry.y,
> diff --git a/src/compositor.h b/src/compositor.h
> index 15d6939..1d790d3 100644
> --- a/src/compositor.h
> +++ b/src/compositor.h
> @@ -415,8 +415,10 @@ struct weston_surface {
> pixman_region32_t boundingbox;
> pixman_region32_t opaque;
>
> - /* matrix and inverse are used only if enabled = 1.
> - * If enabled = 0, use x, y, width, height directly.
> + /* 'inverse' is used only if enabled = 1.
> + * 'matrix' can be used regardless of 'enabled', to allow
> + * inheriting transformation.
> + * If enabled = 0, you can use x, y, width, height instead.
> */
> int enabled;
> struct weston_matrix matrix;
> --
> 1.7.8.6
>
> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/wayland-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/wayland-devel/attachments/20121218/2df481d2/attachment.html>
More information about the wayland-devel
mailing list