glamor_transform.h revision a5e7ae69e440f6816420fc99599f044e79e716b6
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * Copyright © 2014 Keith Packard
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * Permission to use, copy, modify, distribute, and sell this software and its
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * documentation for any purpose is hereby granted without fee, provided that
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * the above copyright notice appear in all copies and that both that copyright
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * notice and this permission notice appear in supporting documentation, and
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * that the name of the copyright holders not be used in advertising or
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * publicity pertaining to distribution of the software without specific,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * written prior permission. The copyright holders make no representations
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * about the suitability of this software for any purpose. It is provided "as
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * is" without express or implied warranty.
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * OF THIS SOFTWARE.
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncglamor_set_destination_drawable(DrawablePtr drawable,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * Vertex shader bits that transform X coordinates to pixmap
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * coordinates using the matrix computed above
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync#define GLAMOR_DECLARE_MATRIX "uniform vec4 v_matrix;\n"
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync#define GLAMOR_X_POS(x) #x " *v_matrix.x + v_matrix.y"
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync#define GLAMOR_Y_POS(y) #y " *v_matrix.z + v_matrix.w"
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync " " #dst ".x = " #src ".x * v_matrix.x + v_matrix.y;\n" \
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync " " #dst ".y = " #src ".y * v_matrix.z + v_matrix.w;\n" \
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync " " #dst ".xy = " #src ".xy * v_matrix.xz + v_matrix.yw;\n" \
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync#endif /* _GLAMOR_TRANSFORM_H_ */