2 * Copyright © 2007 Keith Packard
4 * Permission to use, copy, modify, distribute, and sell this software and its
5 * documentation for any purpose is hereby granted without fee, provided that
6 * the above copyright notice appear in all copies and that both that copyright
7 * notice and this permission notice appear in supporting documentation, and
8 * that the name of the copyright holders not be used in advertising or
9 * publicity pertaining to distribution of the software without specific,
10 * written prior permission. The copyright holders make no representations
11 * about the suitability of this software for any purpose. It is provided "as
12 * is" without express or implied warranty.
14 * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
15 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
16 * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
17 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
18 * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
19 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
23 #ifdef HAVE_DIX_CONFIG_H
24 #include <dix-config.h>
28 #include "scrnintstr.h"
30 #include "regionstr.h"
32 #include "windowstr.h"
35 #include "colormapst.h"
36 #include "cursorstr.h"
37 #include "dixstruct.h"
40 #include "picturestr.h"
43 PictTransform_from_xRenderTransform(PictTransformPtr pict
,
44 xRenderTransform
* render
)
46 pict
->matrix
[0][0] = render
->matrix11
;
47 pict
->matrix
[0][1] = render
->matrix12
;
48 pict
->matrix
[0][2] = render
->matrix13
;
50 pict
->matrix
[1][0] = render
->matrix21
;
51 pict
->matrix
[1][1] = render
->matrix22
;
52 pict
->matrix
[1][2] = render
->matrix23
;
54 pict
->matrix
[2][0] = render
->matrix31
;
55 pict
->matrix
[2][1] = render
->matrix32
;
56 pict
->matrix
[2][2] = render
->matrix33
;
60 xRenderTransform_from_PictTransform(xRenderTransform
* render
,
61 PictTransformPtr pict
)
63 render
->matrix11
= pict
->matrix
[0][0];
64 render
->matrix12
= pict
->matrix
[0][1];
65 render
->matrix13
= pict
->matrix
[0][2];
67 render
->matrix21
= pict
->matrix
[1][0];
68 render
->matrix22
= pict
->matrix
[1][1];
69 render
->matrix23
= pict
->matrix
[1][2];
71 render
->matrix31
= pict
->matrix
[2][0];
72 render
->matrix32
= pict
->matrix
[2][1];
73 render
->matrix33
= pict
->matrix
[2][2];
77 PictureTransformPoint(PictTransformPtr transform
, PictVectorPtr vector
)
79 return pixman_transform_point(transform
, vector
);
83 PictureTransformPoint3d(PictTransformPtr transform
, PictVectorPtr vector
)
85 return pixman_transform_point_3d(transform
, vector
);