2
* Copyright © 2010 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
27
RRCrtcSpriteTransformSet(RRCrtcPtr crtc,
28
PictTransform *position_transform,
29
PictTransform *image_transform,
30
struct pict_f_transform *f_position_transform,
31
struct pict_f_transform *f_image_transform)
34
rrScrPrivPtr pScrPriv;
36
pScreen = crtc->pScreen;
37
pScrPriv = rrGetScrPriv(pScreen);
38
crtc->client_sprite_position_transform = *position_transform;
39
crtc->client_sprite_image_transform = *image_transform;
40
crtc->client_sprite_f_position_transform = *f_position_transform;
41
crtc->client_sprite_f_image_transform = *f_image_transform;
42
if (pScrPriv->rrSetCrtcSpriteTransform)
43
(*pScrPriv->rrSetCrtcSpriteTransform) (pScreen, crtc,
44
&crtc->client_sprite_f_position_transform,
45
&crtc->client_sprite_f_image_transform);
49
ProcRRSetCrtcSpriteTransform (ClientPtr client)
51
REQUEST(xRRSetCrtcSpriteTransformReq);
53
PictTransform position_transform, image_transform;
54
struct pixman_f_transform f_position_transform, f_image_transform;
56
REQUEST_AT_LEAST_SIZE(xRRSetCrtcSpriteTransformReq);
57
VERIFY_RR_CRTC(stuff->crtc, crtc, DixReadAccess);
59
PictTransform_from_xRenderTransform (&position_transform, &stuff->positionTransform);
60
PictTransform_from_xRenderTransform (&image_transform, &stuff->imageTransform);
61
pixman_f_transform_from_pixman_transform (&f_position_transform, &position_transform);
62
pixman_f_transform_from_pixman_transform (&f_image_transform, &image_transform);
64
RRCrtcSpriteTransformSet (crtc, &position_transform, &image_transform,
65
&f_position_transform, &f_image_transform);
69
#define CrtcSpriteTransformExtra (SIZEOF(xRRGetCrtcSpriteTransformReply) - 32)
72
ProcRRGetCrtcSpriteTransform (ClientPtr client)
74
REQUEST(xRRGetCrtcSpriteTransformReq);
75
xRRGetCrtcSpriteTransformReply *reply;
80
REQUEST_SIZE_MATCH (xRRGetCrtcSpriteTransformReq);
81
VERIFY_RR_CRTC(stuff->crtc, crtc, DixReadAccess);
83
reply = malloc(sizeof (xRRGetCrtcSpriteTransformReply));
87
extra = (char *) (reply + 1);
88
reply->type = X_Reply;
89
reply->sequenceNumber = client->sequence;
90
reply->length = bytes_to_int32(CrtcSpriteTransformExtra);
92
xRenderTransform_from_PictTransform(&reply->positionTransform, &crtc->client_sprite_position_transform);
93
xRenderTransform_from_PictTransform(&reply->imageTransform, &crtc->client_sprite_image_transform);
95
if (client->swapped) {
96
swaps (&reply->sequenceNumber, n);
97
swapl (&reply->length, n);
98
SwapLongs((CARD32 *) &reply->positionTransform, bytes_to_int32(sizeof(xRenderTransform)));
99
SwapLongs((CARD32 *) &reply->imageTransform, bytes_to_int32(sizeof(xRenderTransform)));
101
WriteToClient (client, sizeof (xRRGetCrtcSpriteTransformReply), (char *) reply);