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