picturestr.h revision 05b261ec
105b261ecSmrg/*
205b261ecSmrg * Copyright © 2000 SuSE, Inc.
305b261ecSmrg *
405b261ecSmrg * Permission to use, copy, modify, distribute, and sell this software and its
505b261ecSmrg * documentation for any purpose is hereby granted without fee, provided that
605b261ecSmrg * the above copyright notice appear in all copies and that both that
705b261ecSmrg * copyright notice and this permission notice appear in supporting
805b261ecSmrg * documentation, and that the name of SuSE not be used in advertising or
905b261ecSmrg * publicity pertaining to distribution of the software without specific,
1005b261ecSmrg * written prior permission.  SuSE makes no representations about the
1105b261ecSmrg * suitability of this software for any purpose.  It is provided "as is"
1205b261ecSmrg * without express or implied warranty.
1305b261ecSmrg *
1405b261ecSmrg * SuSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
1505b261ecSmrg * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE
1605b261ecSmrg * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
1705b261ecSmrg * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
1805b261ecSmrg * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
1905b261ecSmrg * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
2005b261ecSmrg *
2105b261ecSmrg * Author:  Keith Packard, SuSE, Inc.
2205b261ecSmrg */
2305b261ecSmrg
2405b261ecSmrg#ifndef _PICTURESTR_H_
2505b261ecSmrg#define _PICTURESTR_H_
2605b261ecSmrg
2705b261ecSmrg#include "scrnintstr.h"
2805b261ecSmrg#include "glyphstr.h"
2905b261ecSmrg#include "resource.h"
3005b261ecSmrg
3105b261ecSmrgtypedef struct _DirectFormat {
3205b261ecSmrg    CARD16	    red, redMask;
3305b261ecSmrg    CARD16	    green, greenMask;
3405b261ecSmrg    CARD16	    blue, blueMask;
3505b261ecSmrg    CARD16	    alpha, alphaMask;
3605b261ecSmrg} DirectFormatRec;
3705b261ecSmrg
3805b261ecSmrgtypedef struct _IndexFormat {
3905b261ecSmrg    VisualID	    vid;
4005b261ecSmrg    ColormapPtr	    pColormap;
4105b261ecSmrg    int		    nvalues;
4205b261ecSmrg    xIndexValue	    *pValues;
4305b261ecSmrg    void	    *devPrivate;
4405b261ecSmrg} IndexFormatRec;
4505b261ecSmrg
4605b261ecSmrgtypedef struct _PictFormat {
4705b261ecSmrg    CARD32	    id;
4805b261ecSmrg    CARD32	    format;	    /* except bpp */
4905b261ecSmrg    unsigned char   type;
5005b261ecSmrg    unsigned char   depth;
5105b261ecSmrg    DirectFormatRec direct;
5205b261ecSmrg    IndexFormatRec  index;
5305b261ecSmrg} PictFormatRec;
5405b261ecSmrg
5505b261ecSmrgtypedef struct pixman_vector PictVector, *PictVectorPtr;
5605b261ecSmrgtypedef struct pixman_transform PictTransform, *PictTransformPtr;
5705b261ecSmrg
5805b261ecSmrg#define PICT_GRADIENT_STOPTABLE_SIZE 1024
5905b261ecSmrg#define SourcePictTypeSolidFill 0
6005b261ecSmrg#define SourcePictTypeLinear 1
6105b261ecSmrg#define SourcePictTypeRadial 2
6205b261ecSmrg#define SourcePictTypeConical 3
6305b261ecSmrg
6405b261ecSmrg#define SourcePictClassUnknown    0
6505b261ecSmrg#define SourcePictClassHorizontal 1
6605b261ecSmrg#define SourcePictClassVertical   2
6705b261ecSmrg
6805b261ecSmrgtypedef struct _PictSolidFill {
6905b261ecSmrg    unsigned int type;
7005b261ecSmrg    unsigned int class;
7105b261ecSmrg    CARD32 color;
7205b261ecSmrg} PictSolidFill, *PictSolidFillPtr;
7305b261ecSmrg
7405b261ecSmrgtypedef struct _PictGradientStop {
7505b261ecSmrg    xFixed x;
7605b261ecSmrg    xRenderColor color;
7705b261ecSmrg} PictGradientStop, *PictGradientStopPtr;
7805b261ecSmrg
7905b261ecSmrgtypedef struct _PictGradient {
8005b261ecSmrg    unsigned int type;
8105b261ecSmrg    unsigned int class;
8205b261ecSmrg    int nstops;
8305b261ecSmrg    PictGradientStopPtr stops;
8405b261ecSmrg    int stopRange;
8505b261ecSmrg    CARD32 *colorTable;
8605b261ecSmrg    int colorTableSize;
8705b261ecSmrg} PictGradient, *PictGradientPtr;
8805b261ecSmrg
8905b261ecSmrgtypedef struct _PictLinearGradient {
9005b261ecSmrg    unsigned int type;
9105b261ecSmrg    unsigned int class;
9205b261ecSmrg    int nstops;
9305b261ecSmrg    PictGradientStopPtr stops;
9405b261ecSmrg    int stopRange;
9505b261ecSmrg    CARD32 *colorTable;
9605b261ecSmrg    int colorTableSize;
9705b261ecSmrg    xPointFixed p1;
9805b261ecSmrg    xPointFixed p2;
9905b261ecSmrg} PictLinearGradient, *PictLinearGradientPtr;
10005b261ecSmrg
10105b261ecSmrgtypedef struct _PictCircle {
10205b261ecSmrg    xFixed x;
10305b261ecSmrg    xFixed y;
10405b261ecSmrg    xFixed radius;
10505b261ecSmrg} PictCircle, *PictCirclePtr;
10605b261ecSmrg
10705b261ecSmrgtypedef struct _PictRadialGradient {
10805b261ecSmrg    unsigned int type;
10905b261ecSmrg    unsigned int class;
11005b261ecSmrg    int nstops;
11105b261ecSmrg    PictGradientStopPtr stops;
11205b261ecSmrg    int stopRange;
11305b261ecSmrg    CARD32 *colorTable;
11405b261ecSmrg    int colorTableSize;
11505b261ecSmrg    PictCircle c1;
11605b261ecSmrg    PictCircle c2;
11705b261ecSmrg    double cdx;
11805b261ecSmrg    double cdy;
11905b261ecSmrg    double dr;
12005b261ecSmrg    double A;
12105b261ecSmrg} PictRadialGradient, *PictRadialGradientPtr;
12205b261ecSmrg
12305b261ecSmrgtypedef struct _PictConicalGradient {
12405b261ecSmrg    unsigned int type;
12505b261ecSmrg    unsigned int class;
12605b261ecSmrg    int nstops;
12705b261ecSmrg    PictGradientStopPtr stops;
12805b261ecSmrg    int stopRange;
12905b261ecSmrg    CARD32 *colorTable;
13005b261ecSmrg    int colorTableSize;
13105b261ecSmrg    xPointFixed center;
13205b261ecSmrg    xFixed angle;
13305b261ecSmrg} PictConicalGradient, *PictConicalGradientPtr;
13405b261ecSmrg
13505b261ecSmrgtypedef union _SourcePict {
13605b261ecSmrg    unsigned int type;
13705b261ecSmrg    PictSolidFill solidFill;
13805b261ecSmrg    PictGradient gradient;
13905b261ecSmrg    PictLinearGradient linear;
14005b261ecSmrg    PictRadialGradient radial;
14105b261ecSmrg    PictConicalGradient conical;
14205b261ecSmrg} SourcePict, *SourcePictPtr;
14305b261ecSmrg
14405b261ecSmrgtypedef struct _Picture {
14505b261ecSmrg    DrawablePtr	    pDrawable;
14605b261ecSmrg    PictFormatPtr   pFormat;
14705b261ecSmrg    PictFormatShort format;	    /* PICT_FORMAT */
14805b261ecSmrg    int		    refcnt;
14905b261ecSmrg    CARD32	    id;
15005b261ecSmrg    PicturePtr	    pNext;	    /* chain on same drawable */
15105b261ecSmrg
15205b261ecSmrg    unsigned int    repeat : 1;
15305b261ecSmrg    unsigned int    graphicsExposures : 1;
15405b261ecSmrg    unsigned int    subWindowMode : 1;
15505b261ecSmrg    unsigned int    polyEdge : 1;
15605b261ecSmrg    unsigned int    polyMode : 1;
15705b261ecSmrg    unsigned int    freeCompClip : 1;
15805b261ecSmrg    unsigned int    clientClipType : 2;
15905b261ecSmrg    unsigned int    componentAlpha : 1;
16005b261ecSmrg    unsigned int    repeatType : 2;
16105b261ecSmrg    unsigned int    unused : 21;
16205b261ecSmrg
16305b261ecSmrg    PicturePtr	    alphaMap;
16405b261ecSmrg    DDXPointRec	    alphaOrigin;
16505b261ecSmrg
16605b261ecSmrg    DDXPointRec	    clipOrigin;
16705b261ecSmrg    pointer	    clientClip;
16805b261ecSmrg
16905b261ecSmrg    Atom	    dither;
17005b261ecSmrg
17105b261ecSmrg    unsigned long   stateChanges;
17205b261ecSmrg    unsigned long   serialNumber;
17305b261ecSmrg
17405b261ecSmrg    RegionPtr	    pCompositeClip;
17505b261ecSmrg
17605b261ecSmrg    DevUnion	    *devPrivates;
17705b261ecSmrg
17805b261ecSmrg    PictTransform   *transform;
17905b261ecSmrg
18005b261ecSmrg    int		    filter;
18105b261ecSmrg    xFixed	    *filter_params;
18205b261ecSmrg    int		    filter_nparams;
18305b261ecSmrg    SourcePictPtr   pSourcePict;
18405b261ecSmrg} PictureRec;
18505b261ecSmrg
18605b261ecSmrgtypedef Bool (*PictFilterValidateParamsProcPtr) (PicturePtr pPicture, int id,
18705b261ecSmrg						 xFixed *params, int nparams);
18805b261ecSmrgtypedef struct {
18905b261ecSmrg    char			    *name;
19005b261ecSmrg    int				    id;
19105b261ecSmrg    PictFilterValidateParamsProcPtr ValidateParams;
19205b261ecSmrg} PictFilterRec, *PictFilterPtr;
19305b261ecSmrg
19405b261ecSmrg#define PictFilterNearest	0
19505b261ecSmrg#define PictFilterBilinear	1
19605b261ecSmrg
19705b261ecSmrg#define PictFilterFast		2
19805b261ecSmrg#define PictFilterGood		3
19905b261ecSmrg#define PictFilterBest		4
20005b261ecSmrg
20105b261ecSmrg#define PictFilterConvolution	5
20205b261ecSmrg
20305b261ecSmrgtypedef struct {
20405b261ecSmrg    char	    *alias;
20505b261ecSmrg    int		    alias_id;
20605b261ecSmrg    int		    filter_id;
20705b261ecSmrg} PictFilterAliasRec, *PictFilterAliasPtr;
20805b261ecSmrg
20905b261ecSmrgtypedef int	(*CreatePictureProcPtr)	    (PicturePtr pPicture);
21005b261ecSmrgtypedef void	(*DestroyPictureProcPtr)    (PicturePtr pPicture);
21105b261ecSmrgtypedef int	(*ChangePictureClipProcPtr) (PicturePtr	pPicture,
21205b261ecSmrg					     int	clipType,
21305b261ecSmrg					     pointer    value,
21405b261ecSmrg					     int	n);
21505b261ecSmrgtypedef void	(*DestroyPictureClipProcPtr)(PicturePtr	pPicture);
21605b261ecSmrg
21705b261ecSmrgtypedef int	(*ChangePictureTransformProcPtr)    (PicturePtr	    pPicture,
21805b261ecSmrg						     PictTransform  *transform);
21905b261ecSmrg
22005b261ecSmrgtypedef int	(*ChangePictureFilterProcPtr)	(PicturePtr	pPicture,
22105b261ecSmrg						 int		filter,
22205b261ecSmrg						 xFixed		*params,
22305b261ecSmrg						 int		nparams);
22405b261ecSmrg
22505b261ecSmrgtypedef void	(*DestroyPictureFilterProcPtr)	(PicturePtr pPicture);
22605b261ecSmrg
22705b261ecSmrgtypedef void	(*ChangePictureProcPtr)	    (PicturePtr pPicture,
22805b261ecSmrg					     Mask	mask);
22905b261ecSmrgtypedef void	(*ValidatePictureProcPtr)    (PicturePtr pPicture,
23005b261ecSmrg					     Mask       mask);
23105b261ecSmrgtypedef void	(*CompositeProcPtr)	    (CARD8	op,
23205b261ecSmrg					     PicturePtr pSrc,
23305b261ecSmrg					     PicturePtr pMask,
23405b261ecSmrg					     PicturePtr pDst,
23505b261ecSmrg					     INT16	xSrc,
23605b261ecSmrg					     INT16	ySrc,
23705b261ecSmrg					     INT16	xMask,
23805b261ecSmrg					     INT16	yMask,
23905b261ecSmrg					     INT16	xDst,
24005b261ecSmrg					     INT16	yDst,
24105b261ecSmrg					     CARD16	width,
24205b261ecSmrg					     CARD16	height);
24305b261ecSmrg
24405b261ecSmrgtypedef void	(*GlyphsProcPtr)	    (CARD8      op,
24505b261ecSmrg					     PicturePtr pSrc,
24605b261ecSmrg					     PicturePtr pDst,
24705b261ecSmrg					     PictFormatPtr  maskFormat,
24805b261ecSmrg					     INT16      xSrc,
24905b261ecSmrg					     INT16      ySrc,
25005b261ecSmrg					     int	nlists,
25105b261ecSmrg					     GlyphListPtr   lists,
25205b261ecSmrg					     GlyphPtr	*glyphs);
25305b261ecSmrg
25405b261ecSmrgtypedef void	(*CompositeRectsProcPtr)    (CARD8	    op,
25505b261ecSmrg					     PicturePtr	    pDst,
25605b261ecSmrg					     xRenderColor   *color,
25705b261ecSmrg					     int	    nRect,
25805b261ecSmrg					     xRectangle	    *rects);
25905b261ecSmrg
26005b261ecSmrgtypedef void	(*RasterizeTrapezoidProcPtr)(PicturePtr	    pMask,
26105b261ecSmrg					     xTrapezoid	    *trap,
26205b261ecSmrg					     int	    x_off,
26305b261ecSmrg					     int	    y_off);
26405b261ecSmrg
26505b261ecSmrgtypedef void	(*TrapezoidsProcPtr)	    (CARD8	    op,
26605b261ecSmrg					     PicturePtr	    pSrc,
26705b261ecSmrg					     PicturePtr	    pDst,
26805b261ecSmrg					     PictFormatPtr  maskFormat,
26905b261ecSmrg					     INT16	    xSrc,
27005b261ecSmrg					     INT16	    ySrc,
27105b261ecSmrg					     int	    ntrap,
27205b261ecSmrg					     xTrapezoid	    *traps);
27305b261ecSmrg
27405b261ecSmrgtypedef void	(*TrianglesProcPtr)	    (CARD8	    op,
27505b261ecSmrg					     PicturePtr	    pSrc,
27605b261ecSmrg					     PicturePtr	    pDst,
27705b261ecSmrg					     PictFormatPtr  maskFormat,
27805b261ecSmrg					     INT16	    xSrc,
27905b261ecSmrg					     INT16	    ySrc,
28005b261ecSmrg					     int	    ntri,
28105b261ecSmrg					     xTriangle	    *tris);
28205b261ecSmrg
28305b261ecSmrgtypedef void	(*TriStripProcPtr)	    (CARD8	    op,
28405b261ecSmrg					     PicturePtr	    pSrc,
28505b261ecSmrg					     PicturePtr	    pDst,
28605b261ecSmrg					     PictFormatPtr  maskFormat,
28705b261ecSmrg					     INT16	    xSrc,
28805b261ecSmrg					     INT16	    ySrc,
28905b261ecSmrg					     int	    npoint,
29005b261ecSmrg					     xPointFixed    *points);
29105b261ecSmrg
29205b261ecSmrgtypedef void	(*TriFanProcPtr)	    (CARD8	    op,
29305b261ecSmrg					     PicturePtr	    pSrc,
29405b261ecSmrg					     PicturePtr	    pDst,
29505b261ecSmrg					     PictFormatPtr  maskFormat,
29605b261ecSmrg					     INT16	    xSrc,
29705b261ecSmrg					     INT16	    ySrc,
29805b261ecSmrg					     int	    npoint,
29905b261ecSmrg					     xPointFixed    *points);
30005b261ecSmrg
30105b261ecSmrgtypedef Bool	(*InitIndexedProcPtr)	    (ScreenPtr	    pScreen,
30205b261ecSmrg					     PictFormatPtr  pFormat);
30305b261ecSmrg
30405b261ecSmrgtypedef void	(*CloseIndexedProcPtr)	    (ScreenPtr	    pScreen,
30505b261ecSmrg					     PictFormatPtr  pFormat);
30605b261ecSmrg
30705b261ecSmrgtypedef void	(*UpdateIndexedProcPtr)	    (ScreenPtr	    pScreen,
30805b261ecSmrg					     PictFormatPtr  pFormat,
30905b261ecSmrg					     int	    ndef,
31005b261ecSmrg					     xColorItem	    *pdef);
31105b261ecSmrg
31205b261ecSmrgtypedef void	(*AddTrapsProcPtr)	    (PicturePtr	    pPicture,
31305b261ecSmrg					     INT16	    xOff,
31405b261ecSmrg					     INT16	    yOff,
31505b261ecSmrg					     int	    ntrap,
31605b261ecSmrg					     xTrap	    *traps);
31705b261ecSmrg
31805b261ecSmrgtypedef void	(*AddTrianglesProcPtr)	    (PicturePtr	    pPicture,
31905b261ecSmrg					     INT16	    xOff,
32005b261ecSmrg					     INT16	    yOff,
32105b261ecSmrg					     int	    ntri,
32205b261ecSmrg					     xTriangle	    *tris);
32305b261ecSmrg
32405b261ecSmrgtypedef Bool	(*RealizeGlyphProcPtr)	    (ScreenPtr	    pScreen,
32505b261ecSmrg					     GlyphPtr	    glyph);
32605b261ecSmrg
32705b261ecSmrgtypedef void	(*UnrealizeGlyphProcPtr)    (ScreenPtr	    pScreen,
32805b261ecSmrg					     GlyphPtr	    glyph);
32905b261ecSmrg
33005b261ecSmrgtypedef struct _PictureScreen {
33105b261ecSmrg    int				totalPictureSize;
33205b261ecSmrg    unsigned int		*PicturePrivateSizes;
33305b261ecSmrg    int				PicturePrivateLen;
33405b261ecSmrg
33505b261ecSmrg    PictFormatPtr		formats;
33605b261ecSmrg    PictFormatPtr		fallback;
33705b261ecSmrg    int				nformats;
33805b261ecSmrg
33905b261ecSmrg    CreatePictureProcPtr	CreatePicture;
34005b261ecSmrg    DestroyPictureProcPtr	DestroyPicture;
34105b261ecSmrg    ChangePictureClipProcPtr	ChangePictureClip;
34205b261ecSmrg    DestroyPictureClipProcPtr	DestroyPictureClip;
34305b261ecSmrg
34405b261ecSmrg    ChangePictureProcPtr	ChangePicture;
34505b261ecSmrg    ValidatePictureProcPtr	ValidatePicture;
34605b261ecSmrg
34705b261ecSmrg    CompositeProcPtr		Composite;
34805b261ecSmrg    GlyphsProcPtr		Glyphs;
34905b261ecSmrg    CompositeRectsProcPtr	CompositeRects;
35005b261ecSmrg
35105b261ecSmrg    DestroyWindowProcPtr	DestroyWindow;
35205b261ecSmrg    CloseScreenProcPtr		CloseScreen;
35305b261ecSmrg
35405b261ecSmrg    StoreColorsProcPtr		StoreColors;
35505b261ecSmrg
35605b261ecSmrg    InitIndexedProcPtr		InitIndexed;
35705b261ecSmrg    CloseIndexedProcPtr		CloseIndexed;
35805b261ecSmrg    UpdateIndexedProcPtr	UpdateIndexed;
35905b261ecSmrg
36005b261ecSmrg    int				subpixel;
36105b261ecSmrg
36205b261ecSmrg    PictFilterPtr		filters;
36305b261ecSmrg    int				nfilters;
36405b261ecSmrg    PictFilterAliasPtr		filterAliases;
36505b261ecSmrg    int				nfilterAliases;
36605b261ecSmrg
36705b261ecSmrg    /**
36805b261ecSmrg     * Called immediately after a picture's transform is changed through the
36905b261ecSmrg     * SetPictureTransform request.  Not called for source-only pictures.
37005b261ecSmrg     */
37105b261ecSmrg    ChangePictureTransformProcPtr   ChangePictureTransform;
37205b261ecSmrg
37305b261ecSmrg    /**
37405b261ecSmrg     * Called immediately after a picture's transform is changed through the
37505b261ecSmrg     * SetPictureFilter request.  Not called for source-only pictures.
37605b261ecSmrg     */
37705b261ecSmrg    ChangePictureFilterProcPtr	ChangePictureFilter;
37805b261ecSmrg
37905b261ecSmrg    DestroyPictureFilterProcPtr	DestroyPictureFilter;
38005b261ecSmrg
38105b261ecSmrg    TrapezoidsProcPtr		Trapezoids;
38205b261ecSmrg    TrianglesProcPtr		Triangles;
38305b261ecSmrg    TriStripProcPtr		TriStrip;
38405b261ecSmrg    TriFanProcPtr		TriFan;
38505b261ecSmrg
38605b261ecSmrg    RasterizeTrapezoidProcPtr	RasterizeTrapezoid;
38705b261ecSmrg
38805b261ecSmrg    AddTrianglesProcPtr		AddTriangles;
38905b261ecSmrg
39005b261ecSmrg    AddTrapsProcPtr		AddTraps;
39105b261ecSmrg
39205b261ecSmrg    int			  	totalGlyphPrivateSize;
39305b261ecSmrg    unsigned int	  	*glyphPrivateSizes;
39405b261ecSmrg    int			  	glyphPrivateLen;
39505b261ecSmrg    int			  	glyphPrivateOffset;
39605b261ecSmrg
39705b261ecSmrg    RealizeGlyphProcPtr   	RealizeGlyph;
39805b261ecSmrg    UnrealizeGlyphProcPtr 	UnrealizeGlyph;
39905b261ecSmrg
40005b261ecSmrg} PictureScreenRec, *PictureScreenPtr;
40105b261ecSmrg
40205b261ecSmrgextern int		PictureScreenPrivateIndex;
40305b261ecSmrgextern int		PictureWindowPrivateIndex;
40405b261ecSmrgextern RESTYPE		PictureType;
40505b261ecSmrgextern RESTYPE		PictFormatType;
40605b261ecSmrgextern RESTYPE		GlyphSetType;
40705b261ecSmrg
40805b261ecSmrg#define GetPictureScreen(s) ((PictureScreenPtr) ((s)->devPrivates[PictureScreenPrivateIndex].ptr))
40905b261ecSmrg#define GetPictureScreenIfSet(s) ((PictureScreenPrivateIndex != -1) ? GetPictureScreen(s) : NULL)
41005b261ecSmrg#define SetPictureScreen(s,p) ((s)->devPrivates[PictureScreenPrivateIndex].ptr = (pointer) (p))
41105b261ecSmrg#define GetPictureWindow(w) ((PicturePtr) ((w)->devPrivates[PictureWindowPrivateIndex].ptr))
41205b261ecSmrg#define SetPictureWindow(w,p) ((w)->devPrivates[PictureWindowPrivateIndex].ptr = (pointer) (p))
41305b261ecSmrg
41405b261ecSmrg#define GetGlyphPrivatesForScreen(glyph, s)				\
41505b261ecSmrg    ((glyph)->devPrivates + (GetPictureScreen (s))->glyphPrivateOffset)
41605b261ecSmrg
41705b261ecSmrg#define VERIFY_PICTURE(pPicture, pid, client, mode, err) {\
41805b261ecSmrg    pPicture = SecurityLookupIDByType(client, pid, PictureType, mode);\
41905b261ecSmrg    if (!pPicture) { \
42005b261ecSmrg	client->errorValue = pid; \
42105b261ecSmrg	return err; \
42205b261ecSmrg    } \
42305b261ecSmrg}
42405b261ecSmrg
42505b261ecSmrg#define VERIFY_ALPHA(pPicture, pid, client, mode, err) {\
42605b261ecSmrg    if (pid == None) \
42705b261ecSmrg	pPicture = 0; \
42805b261ecSmrg    else { \
42905b261ecSmrg	VERIFY_PICTURE(pPicture, pid, client, mode, err); \
43005b261ecSmrg    } \
43105b261ecSmrg} \
43205b261ecSmrg
43305b261ecSmrgvoid
43405b261ecSmrgResetPicturePrivateIndex (void);
43505b261ecSmrg
43605b261ecSmrgint
43705b261ecSmrgAllocatePicturePrivateIndex (void);
43805b261ecSmrg
43905b261ecSmrgBool
44005b261ecSmrgAllocatePicturePrivate (ScreenPtr pScreen, int index2, unsigned int amount);
44105b261ecSmrg
44205b261ecSmrgBool
44305b261ecSmrgPictureDestroyWindow (WindowPtr pWindow);
44405b261ecSmrg
44505b261ecSmrgBool
44605b261ecSmrgPictureCloseScreen (int Index, ScreenPtr pScreen);
44705b261ecSmrg
44805b261ecSmrgvoid
44905b261ecSmrgPictureStoreColors (ColormapPtr pColormap, int ndef, xColorItem *pdef);
45005b261ecSmrg
45105b261ecSmrgBool
45205b261ecSmrgPictureInitIndexedFormats (ScreenPtr pScreen);
45305b261ecSmrg
45405b261ecSmrgBool
45505b261ecSmrgPictureSetSubpixelOrder (ScreenPtr pScreen, int subpixel);
45605b261ecSmrg
45705b261ecSmrgint
45805b261ecSmrgPictureGetSubpixelOrder (ScreenPtr pScreen);
45905b261ecSmrg
46005b261ecSmrgPictFormatPtr
46105b261ecSmrgPictureCreateDefaultFormats (ScreenPtr pScreen, int *nformatp);
46205b261ecSmrg
46305b261ecSmrgPictFormatPtr
46405b261ecSmrgPictureMatchVisual (ScreenPtr pScreen, int depth, VisualPtr pVisual);
46505b261ecSmrg
46605b261ecSmrgPictFormatPtr
46705b261ecSmrgPictureMatchFormat (ScreenPtr pScreen, int depth, CARD32 format);
46805b261ecSmrg
46905b261ecSmrgBool
47005b261ecSmrgPictureInit (ScreenPtr pScreen, PictFormatPtr formats, int nformats);
47105b261ecSmrg
47205b261ecSmrgint
47305b261ecSmrgPictureGetFilterId (char *filter, int len, Bool makeit);
47405b261ecSmrg
47505b261ecSmrgchar *
47605b261ecSmrgPictureGetFilterName (int id);
47705b261ecSmrg
47805b261ecSmrgint
47905b261ecSmrgPictureAddFilter (ScreenPtr			    pScreen,
48005b261ecSmrg		  char				    *filter,
48105b261ecSmrg		  PictFilterValidateParamsProcPtr   ValidateParams);
48205b261ecSmrg
48305b261ecSmrgBool
48405b261ecSmrgPictureSetFilterAlias (ScreenPtr pScreen, char *filter, char *alias);
48505b261ecSmrg
48605b261ecSmrgBool
48705b261ecSmrgPictureSetDefaultFilters (ScreenPtr pScreen);
48805b261ecSmrg
48905b261ecSmrgvoid
49005b261ecSmrgPictureResetFilters (ScreenPtr pScreen);
49105b261ecSmrg
49205b261ecSmrgPictFilterPtr
49305b261ecSmrgPictureFindFilter (ScreenPtr pScreen, char *name, int len);
49405b261ecSmrg
49505b261ecSmrgint
49605b261ecSmrgSetPictureFilter (PicturePtr pPicture, char *name, int len, xFixed *params, int nparams);
49705b261ecSmrg
49805b261ecSmrgBool
49905b261ecSmrgPictureFinishInit (void);
50005b261ecSmrg
50105b261ecSmrgvoid
50205b261ecSmrgSetPictureToDefaults (PicturePtr pPicture);
50305b261ecSmrg
50405b261ecSmrgPicturePtr
50505b261ecSmrgAllocatePicture (ScreenPtr  pScreen);
50605b261ecSmrg
50705b261ecSmrg#if 0
50805b261ecSmrgBool
50905b261ecSmrgmiPictureInit (ScreenPtr pScreen, PictFormatPtr formats, int nformats);
51005b261ecSmrg#endif
51105b261ecSmrg
51205b261ecSmrg
51305b261ecSmrgPicturePtr
51405b261ecSmrgCreatePicture (Picture		pid,
51505b261ecSmrg	       DrawablePtr	pDrawable,
51605b261ecSmrg	       PictFormatPtr	pFormat,
51705b261ecSmrg	       Mask		mask,
51805b261ecSmrg	       XID		*list,
51905b261ecSmrg	       ClientPtr	client,
52005b261ecSmrg	       int		*error);
52105b261ecSmrg
52205b261ecSmrgint
52305b261ecSmrgChangePicture (PicturePtr	pPicture,
52405b261ecSmrg	       Mask		vmask,
52505b261ecSmrg	       XID		*vlist,
52605b261ecSmrg	       DevUnion		*ulist,
52705b261ecSmrg	       ClientPtr	client);
52805b261ecSmrg
52905b261ecSmrgint
53005b261ecSmrgSetPictureClipRects (PicturePtr	pPicture,
53105b261ecSmrg		     int	xOrigin,
53205b261ecSmrg		     int	yOrigin,
53305b261ecSmrg		     int	nRect,
53405b261ecSmrg		     xRectangle	*rects);
53505b261ecSmrg
53605b261ecSmrgint
53705b261ecSmrgSetPictureClipRegion (PicturePtr    pPicture,
53805b261ecSmrg		      int	    xOrigin,
53905b261ecSmrg		      int	    yOrigin,
54005b261ecSmrg		      RegionPtr	    pRegion);
54105b261ecSmrg
54205b261ecSmrgint
54305b261ecSmrgSetPictureTransform (PicturePtr	    pPicture,
54405b261ecSmrg		     PictTransform  *transform);
54505b261ecSmrg
54605b261ecSmrgvoid
54705b261ecSmrgCopyPicture (PicturePtr	pSrc,
54805b261ecSmrg	     Mask	mask,
54905b261ecSmrg	     PicturePtr	pDst);
55005b261ecSmrg
55105b261ecSmrgvoid
55205b261ecSmrgValidatePicture(PicturePtr pPicture);
55305b261ecSmrg
55405b261ecSmrgint
55505b261ecSmrgFreePicture (pointer	pPicture,
55605b261ecSmrg	     XID	pid);
55705b261ecSmrg
55805b261ecSmrgint
55905b261ecSmrgFreePictFormat (pointer	pPictFormat,
56005b261ecSmrg		XID     pid);
56105b261ecSmrg
56205b261ecSmrgvoid
56305b261ecSmrgCompositePicture (CARD8		op,
56405b261ecSmrg		  PicturePtr	pSrc,
56505b261ecSmrg		  PicturePtr	pMask,
56605b261ecSmrg		  PicturePtr	pDst,
56705b261ecSmrg		  INT16		xSrc,
56805b261ecSmrg		  INT16		ySrc,
56905b261ecSmrg		  INT16		xMask,
57005b261ecSmrg		  INT16		yMask,
57105b261ecSmrg		  INT16		xDst,
57205b261ecSmrg		  INT16		yDst,
57305b261ecSmrg		  CARD16	width,
57405b261ecSmrg		  CARD16	height);
57505b261ecSmrg
57605b261ecSmrgvoid
57705b261ecSmrgCompositeGlyphs (CARD8		op,
57805b261ecSmrg		 PicturePtr	pSrc,
57905b261ecSmrg		 PicturePtr	pDst,
58005b261ecSmrg		 PictFormatPtr	maskFormat,
58105b261ecSmrg		 INT16		xSrc,
58205b261ecSmrg		 INT16		ySrc,
58305b261ecSmrg		 int		nlist,
58405b261ecSmrg		 GlyphListPtr	lists,
58505b261ecSmrg		 GlyphPtr	*glyphs);
58605b261ecSmrg
58705b261ecSmrgvoid
58805b261ecSmrgCompositeRects (CARD8		op,
58905b261ecSmrg		PicturePtr	pDst,
59005b261ecSmrg		xRenderColor	*color,
59105b261ecSmrg		int		nRect,
59205b261ecSmrg		xRectangle      *rects);
59305b261ecSmrg
59405b261ecSmrgvoid
59505b261ecSmrgCompositeTrapezoids (CARD8	    op,
59605b261ecSmrg		     PicturePtr	    pSrc,
59705b261ecSmrg		     PicturePtr	    pDst,
59805b261ecSmrg		     PictFormatPtr  maskFormat,
59905b261ecSmrg		     INT16	    xSrc,
60005b261ecSmrg		     INT16	    ySrc,
60105b261ecSmrg		     int	    ntrap,
60205b261ecSmrg		     xTrapezoid	    *traps);
60305b261ecSmrg
60405b261ecSmrgvoid
60505b261ecSmrgCompositeTriangles (CARD8	    op,
60605b261ecSmrg		    PicturePtr	    pSrc,
60705b261ecSmrg		    PicturePtr	    pDst,
60805b261ecSmrg		    PictFormatPtr   maskFormat,
60905b261ecSmrg		    INT16	    xSrc,
61005b261ecSmrg		    INT16	    ySrc,
61105b261ecSmrg		    int		    ntriangles,
61205b261ecSmrg		    xTriangle	    *triangles);
61305b261ecSmrg
61405b261ecSmrgvoid
61505b261ecSmrgCompositeTriStrip (CARD8	    op,
61605b261ecSmrg		   PicturePtr	    pSrc,
61705b261ecSmrg		   PicturePtr	    pDst,
61805b261ecSmrg		   PictFormatPtr    maskFormat,
61905b261ecSmrg		   INT16	    xSrc,
62005b261ecSmrg		   INT16	    ySrc,
62105b261ecSmrg		   int		    npoints,
62205b261ecSmrg		   xPointFixed	    *points);
62305b261ecSmrg
62405b261ecSmrgvoid
62505b261ecSmrgCompositeTriFan (CARD8		op,
62605b261ecSmrg		 PicturePtr	pSrc,
62705b261ecSmrg		 PicturePtr	pDst,
62805b261ecSmrg		 PictFormatPtr	maskFormat,
62905b261ecSmrg		 INT16		xSrc,
63005b261ecSmrg		 INT16		ySrc,
63105b261ecSmrg		 int		npoints,
63205b261ecSmrg		 xPointFixed	*points);
63305b261ecSmrg
63405b261ecSmrgBool
63505b261ecSmrgPictureTransformPoint (PictTransformPtr transform,
63605b261ecSmrg		       PictVectorPtr	vector);
63705b261ecSmrg
63805b261ecSmrgBool
63905b261ecSmrgPictureTransformPoint3d (PictTransformPtr transform,
64005b261ecSmrg                         PictVectorPtr	vector);
64105b261ecSmrg
64205b261ecSmrgCARD32
64305b261ecSmrgPictureGradientColor (PictGradientStopPtr stop1,
64405b261ecSmrg		      PictGradientStopPtr stop2,
64505b261ecSmrg		      CARD32	          x);
64605b261ecSmrg
64705b261ecSmrgvoid RenderExtensionInit (void);
64805b261ecSmrg
64905b261ecSmrgBool
65005b261ecSmrgAnimCurInit (ScreenPtr pScreen);
65105b261ecSmrg
65205b261ecSmrgint
65305b261ecSmrgAnimCursorCreate (CursorPtr *cursors, CARD32 *deltas, int ncursor, CursorPtr *ppCursor);
65405b261ecSmrg
65505b261ecSmrgvoid
65605b261ecSmrgAddTraps (PicturePtr	pPicture,
65705b261ecSmrg	  INT16		xOff,
65805b261ecSmrg	  INT16		yOff,
65905b261ecSmrg	  int		ntraps,
66005b261ecSmrg	  xTrap		*traps);
66105b261ecSmrg
66205b261ecSmrgpixman_image_t *
66305b261ecSmrgPixmanImageFromPicture (PicturePtr pPict,
66405b261ecSmrg			Bool hasClip);
66505b261ecSmrg
66605b261ecSmrgPicturePtr
66705b261ecSmrgCreateSolidPicture (Picture pid,
66805b261ecSmrg                    xRenderColor *color,
66905b261ecSmrg                    int *error);
67005b261ecSmrg
67105b261ecSmrgPicturePtr
67205b261ecSmrgCreateLinearGradientPicture (Picture pid,
67305b261ecSmrg                             xPointFixed *p1,
67405b261ecSmrg                             xPointFixed *p2,
67505b261ecSmrg                             int nStops,
67605b261ecSmrg                             xFixed *stops,
67705b261ecSmrg                             xRenderColor *colors,
67805b261ecSmrg                             int *error);
67905b261ecSmrg
68005b261ecSmrgPicturePtr
68105b261ecSmrgCreateRadialGradientPicture (Picture pid,
68205b261ecSmrg                             xPointFixed *inner,
68305b261ecSmrg                             xPointFixed *outer,
68405b261ecSmrg                             xFixed innerRadius,
68505b261ecSmrg                             xFixed outerRadius,
68605b261ecSmrg                             int nStops,
68705b261ecSmrg                             xFixed *stops,
68805b261ecSmrg                             xRenderColor *colors,
68905b261ecSmrg                             int *error);
69005b261ecSmrg
69105b261ecSmrgPicturePtr
69205b261ecSmrgCreateConicalGradientPicture (Picture pid,
69305b261ecSmrg                              xPointFixed *center,
69405b261ecSmrg                              xFixed angle,
69505b261ecSmrg                              int nStops,
69605b261ecSmrg                              xFixed *stops,
69705b261ecSmrg                              xRenderColor *colors,
69805b261ecSmrg                              int *error);
69905b261ecSmrg
70005b261ecSmrg#ifdef PANORAMIX
70105b261ecSmrgvoid PanoramiXRenderInit (void);
70205b261ecSmrgvoid PanoramiXRenderReset (void);
70305b261ecSmrg#endif
70405b261ecSmrg
70505b261ecSmrg#endif /* _PICTURESTR_H_ */
706