First import
[xorg_rtime.git] / xorg-server-1.4 / hw / dmx / dmxpict.h
blobc178ef39c265362ab6c886ef14f0c074ec39d15e
1 /*
2 * Copyright 2001-2004 Red Hat Inc., Durham, North Carolina.
4 * All Rights Reserved.
6 * Permission is hereby granted, free of charge, to any person obtaining
7 * a copy of this software and associated documentation files (the
8 * "Software"), to deal in the Software without restriction, including
9 * without limitation on the rights to use, copy, modify, merge,
10 * publish, distribute, sublicense, and/or sell copies of the Software,
11 * and to permit persons to whom the Software is furnished to do so,
12 * subject to the following conditions:
14 * The above copyright notice and this permission notice (including the
15 * next paragraph) shall be included in all copies or substantial
16 * portions of the Software.
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
19 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
21 * NON-INFRINGEMENT. IN NO EVENT SHALL RED HAT AND/OR THEIR SUPPLIERS
22 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
23 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
24 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25 * SOFTWARE.
29 * Authors:
30 * Kevin E. Martin <kem@redhat.com>
34 /** \file
35 * This file provides access to the externally visible RENDER support
36 * functions, global variables and macros for DMX.
38 * FIXME: Move function definitions for non-externally visible function
39 * to .c file. */
41 #ifndef DMXPICT_H
42 #define DMXPICT_H
44 /** Picture private structure */
45 typedef struct _dmxPictPriv {
46 Picture pict; /**< Picture ID from back-end server */
47 Mask savedMask; /**< Mask of picture attributes saved for
48 * lazy window creation. */
49 } dmxPictPrivRec, *dmxPictPrivPtr;
52 /** Glyph Set private structure */
53 typedef struct _dmxGlyphPriv {
54 GlyphSet *glyphSets; /**< Glyph Set IDs from back-end server */
55 } dmxGlyphPrivRec, *dmxGlyphPrivPtr;
58 extern void dmxInitRender(void);
59 extern void dmxResetRender(void);
61 extern Bool dmxPictureInit(ScreenPtr pScreen,
62 PictFormatPtr formats, int nformats);
64 extern void dmxCreatePictureList(WindowPtr pWindow);
65 extern Bool dmxDestroyPictureList(WindowPtr pWindow);
67 extern int dmxCreatePicture(PicturePtr pPicture);
68 extern void dmxDestroyPicture(PicturePtr pPicture);
69 extern int dmxChangePictureClip(PicturePtr pPicture, int clipType,
70 pointer value, int n);
71 extern void dmxDestroyPictureClip(PicturePtr pPicture);
72 extern void dmxChangePicture(PicturePtr pPicture, Mask mask);
73 extern void dmxValidatePicture(PicturePtr pPicture, Mask mask);
74 extern void dmxComposite(CARD8 op,
75 PicturePtr pSrc, PicturePtr pMask, PicturePtr pDst,
76 INT16 xSrc, INT16 ySrc,
77 INT16 xMask, INT16 yMask,
78 INT16 xDst, INT16 yDst,
79 CARD16 width, CARD16 height);
80 extern void dmxGlyphs(CARD8 op,
81 PicturePtr pSrc, PicturePtr pDst,
82 PictFormatPtr maskFormat,
83 INT16 xSrc, INT16 ySrc,
84 int nlists, GlyphListPtr lists, GlyphPtr *glyphs);
85 extern void dmxCompositeRects(CARD8 op,
86 PicturePtr pDst,
87 xRenderColor *color,
88 int nRect, xRectangle *rects);
89 extern Bool dmxInitIndexed(ScreenPtr pScreen, PictFormatPtr pFormat);
90 extern void dmxCloseIndexed(ScreenPtr pScreen, PictFormatPtr pFormat);
91 extern void dmxUpdateIndexed(ScreenPtr pScreen, PictFormatPtr pFormat,
92 int ndef, xColorItem *pdef);
93 extern void dmxTrapezoids(CARD8 op,
94 PicturePtr pSrc, PicturePtr pDst,
95 PictFormatPtr maskFormat,
96 INT16 xSrc, INT16 ySrc,
97 int ntrap, xTrapezoid *traps);
98 extern void dmxTriangles(CARD8 op,
99 PicturePtr pSrc, PicturePtr pDst,
100 PictFormatPtr maskFormat,
101 INT16 xSrc, INT16 ySrc,
102 int ntri, xTriangle *tris);
103 extern void dmxTriStrip(CARD8 op,
104 PicturePtr pSrc, PicturePtr pDst,
105 PictFormatPtr maskFormat,
106 INT16 xSrc, INT16 ySrc,
107 int npoint, xPointFixed *points);
108 extern void dmxTriFan(CARD8 op,
109 PicturePtr pSrc, PicturePtr pDst,
110 PictFormatPtr maskFormat,
111 INT16 xSrc, INT16 ySrc,
112 int npoint, xPointFixed *points);
114 extern int dmxBECreateGlyphSet(int idx, GlyphSetPtr glyphSet);
115 extern Bool dmxBEFreeGlyphSet(ScreenPtr pScreen, GlyphSetPtr glyphSet);
116 extern int dmxBECreatePicture(PicturePtr pPicture);
117 extern Bool dmxBEFreePicture(PicturePtr pPicture);
119 extern int dmxPictPrivateIndex; /**< Index for picture private data */
120 extern int dmxGlyphSetPrivateIndex; /**< Index for glyphset private data */
123 /** Get the picture private data given a picture pointer */
124 #define DMX_GET_PICT_PRIV(_pPict) \
125 (dmxPictPrivPtr)(_pPict)->devPrivates[dmxPictPrivateIndex].ptr
127 /** Set the glyphset private data given a glyphset pointer */
128 #define DMX_SET_GLYPH_PRIV(_pGlyph, _pPriv) \
129 GlyphSetSetPrivate((_pGlyph), dmxGlyphSetPrivateIndex, (_pPriv))
130 /** Get the glyphset private data given a glyphset pointer */
131 #define DMX_GET_GLYPH_PRIV(_pGlyph) \
132 (dmxGlyphPrivPtr)GlyphSetGetPrivate((_pGlyph), dmxGlyphSetPrivateIndex)
134 #endif /* DMXPICT_H */