Imported Upstream version 1.15.1
[deb_xorg-server.git] / hw / xquartz / darwinfb.h
CommitLineData
a09e091a
JB
1/*
2 * Copyright (C) 2009 Apple, Inc.
3 * Copyright (c) 2001-2004 Torrey T. Lyons. All Rights Reserved.
4 *
5 * Permission is hereby granted, free of charge, to any person obtaining a
6 * copy of this software and associated documentation files (the "Software"),
7 * to deal in the Software without restriction, including without limitation
8 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9 * and/or sell copies of the Software, and to permit persons to whom the
10 * Software is furnished to do so, subject to the following conditions:
11 *
12 * The above copyright notice and this permission notice shall be included in
13 * all copies or substantial portions of the Software.
14 *
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18 * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
19 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
20 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21 * DEALINGS IN THE SOFTWARE.
22 *
23 * Except as contained in this notice, the name(s) of the above copyright
24 * holders shall not be used in advertising or otherwise to promote the sale,
25 * use or other dealings in this Software without prior written authorization.
26 */
27
28#ifndef _DARWIN_FB_H
29#define _DARWIN_FB_H
30
31#include "scrnintstr.h"
32
33typedef struct {
34 void *framebuffer;
35 int x;
36 int y;
37 int width;
38 int height;
39 int pitch;
40 int depth;
41 int visuals;
42 int bitsPerRGB;
43 int bitsPerPixel;
44 int preferredCVC;
45 Pixel redMask;
46 Pixel greenMask;
47 Pixel blueMask;
48} DarwinFramebufferRec, *DarwinFramebufferPtr;
49
50#define MASK_LH(l, h) (((1 << (1 + (h) - (l))) - 1) << (l))
51#define BM_ARGB(a, r, g, b) MASK_LH(0, (b) - 1)
52#define GM_ARGB(a, r, g, b) MASK_LH(b, (b) + (g) - 1)
53#define RM_ARGB(a, r, g, b) MASK_LH((b) + (g), (b) + (g) + (r) - 1)
54#define AM_ARGB(a, r, g, b) MASK_LH((b) + (g) + (r), \
55 (b) + (g) + (r) + (a) - 1)
56
57#endif /* _DARWIN_FB_H */