os/ossrv/genericopenlibs/liboil/src/fb/fbpict.h
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
sl@0
     1
/*
sl@0
     2
 * $XFree86: xc/programs/Xserver/fb/fbpict.h,v 1.7 2001/07/18 10:15:02 keithp Exp $
sl@0
     3
 *
sl@0
     4
 * Copyright © 2000 Keith Packard, member of The XFree86 Project, Inc.
sl@0
     5
 *
sl@0
     6
 * Permission to use, copy, modify, distribute, and sell this software and its
sl@0
     7
 * documentation for any purpose is hereby granted without fee, provided that
sl@0
     8
 * the above copyright notice appear in all copies and that both that
sl@0
     9
 * copyright notice and this permission notice appear in supporting
sl@0
    10
 * documentation, and that the name of Keith Packard not be used in
sl@0
    11
 * advertising or publicity pertaining to distribution of the software without
sl@0
    12
 * specific, written prior permission.  Keith Packard makes no
sl@0
    13
 * representations about the suitability of this software for any purpose.  It
sl@0
    14
 * is provided "as is" without express or implied warranty.
sl@0
    15
 *
sl@0
    16
 * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
sl@0
    17
 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
sl@0
    18
 * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
sl@0
    19
 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
sl@0
    20
 * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
sl@0
    21
 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
sl@0
    22
 * PERFORMANCE OF THIS SOFTWARE.
sl@0
    23
 */
sl@0
    24
sl@0
    25
#ifdef HAVE_DIX_CONFIG_H
sl@0
    26
#include <dix-config.h>
sl@0
    27
#endif
sl@0
    28
sl@0
    29
#ifndef _FBPICT_H_
sl@0
    30
#define _FBPICT_H_
sl@0
    31
sl@0
    32
//#include "renderedge.h"
sl@0
    33
sl@0
    34
#define FbIntMult(a,b,t) ( (t) = (a) * (b) + 0x80, ( ( ( (t)>>8 ) + (t) )>>8 ) )
sl@0
    35
#define FbIntDiv(a,b)	 (((CARD16) (a) * 255) / (b))
sl@0
    36
sl@0
    37
#define FbGet8(v,i)   ((CARD16) (CARD8) ((v) >> i))
sl@0
    38
sl@0
    39
/*
sl@0
    40
 * There are two ways of handling alpha -- either as a single unified value or
sl@0
    41
 * a separate value for each component, hence each macro must have two
sl@0
    42
 * versions.  The unified alpha version has a 'U' at the end of the name,
sl@0
    43
 * the component version has a 'C'.  Similarly, functions which deal with
sl@0
    44
 * this difference will have two versions using the same convention.
sl@0
    45
 */
sl@0
    46
sl@0
    47
#define FbOverU(x,y,i,a,t) ((t) = FbIntMult(FbGet8(y,i),(a),(t)) + FbGet8(x,i),\
sl@0
    48
			   (CARD32) ((CARD8) ((t) | (0 - ((t) >> 8)))) << (i))
sl@0
    49
sl@0
    50
#define FbOverC(x,y,i,a,t) ((t) = FbIntMult(FbGet8(y,i),FbGet8(a,i),(t)) + FbGet8(x,i),\
sl@0
    51
			    (CARD32) ((CARD8) ((t) | (0 - ((t) >> 8)))) << (i))
sl@0
    52
sl@0
    53
#define FbInU(x,i,a,t) ((CARD32) FbIntMult(FbGet8(x,i),(a),(t)) << (i))
sl@0
    54
sl@0
    55
#define FbInC(x,i,a,t) ((CARD32) FbIntMult(FbGet8(x,i),FbGet8(a,i),(t)) << (i))
sl@0
    56
sl@0
    57
#define FbGen(x,y,i,ax,ay,t,u,v) ((t) = (FbIntMult(FbGet8(y,i),ay,(u)) + \
sl@0
    58
					 FbIntMult(FbGet8(x,i),ax,(v))),\
sl@0
    59
				  (CARD32) ((CARD8) ((t) | \
sl@0
    60
						     (0 - ((t) >> 8)))) << (i))
sl@0
    61
sl@0
    62
#define FbAdd(x,y,i,t)	((t) = FbGet8(x,i) + FbGet8(y,i), \
sl@0
    63
			 (CARD32) ((CARD8) ((t) | (0 - ((t) >> 8)))) << (i))
sl@0
    64
sl@0
    65
sl@0
    66
#define Alpha(x) ((x) >> 24)
sl@0
    67
#define Red(x) (((x) >> 16) & 0xff)
sl@0
    68
#define Green(x) (((x) >> 8) & 0xff)
sl@0
    69
#define Blue(x) ((x) & 0xff)
sl@0
    70
sl@0
    71
#define fbComposeGetSolid(pict, bits, fmt) { \
sl@0
    72
    FbBits	*__bits__; \
sl@0
    73
    FbStride	__stride__; \
sl@0
    74
    int		__bpp__; \
sl@0
    75
    int		__xoff__,__yoff__; \
sl@0
    76
\
sl@0
    77
    fbGetDrawable((pict)->pDrawable,__bits__,__stride__,__bpp__,__xoff__,__yoff__); \
sl@0
    78
    switch (__bpp__) { \
sl@0
    79
    case 32: \
sl@0
    80
	(bits) = *(CARD32 *) __bits__; \
sl@0
    81
	break; \
sl@0
    82
    case 24: \
sl@0
    83
	(bits) = Fetch24 ((CARD8 *) __bits__); \
sl@0
    84
	break; \
sl@0
    85
    case 16: \
sl@0
    86
	(bits) = *(CARD16 *) __bits__; \
sl@0
    87
	(bits) = cvt0565to8888(bits); \
sl@0
    88
	break; \
sl@0
    89
    default: \
sl@0
    90
	return; \
sl@0
    91
    } \
sl@0
    92
    /* If necessary, convert RGB <--> BGR. */ \
sl@0
    93
    if (PICT_FORMAT_TYPE((pict)->format) != PICT_FORMAT_TYPE(fmt)) \
sl@0
    94
    { \
sl@0
    95
	(bits) = (((bits) & 0xff000000) | \
sl@0
    96
		  (((bits) & 0x00ff0000) >> 16) | \
sl@0
    97
		  (((bits) & 0x0000ff00) >>  0) | \
sl@0
    98
		  (((bits) & 0x000000ff) << 16)); \
sl@0
    99
    } \
sl@0
   100
    /* manage missing src alpha */ \
sl@0
   101
    if ((pict)->pFormat->direct.alphaMask == 0) \
sl@0
   102
	(bits) |= 0xff000000; \
sl@0
   103
}
sl@0
   104
sl@0
   105
#define fbComposeGetStart(pict,x,y,type,stride,line,mul) {\
sl@0
   106
    FbBits	*__bits__; \
sl@0
   107
    FbStride	__stride__; \
sl@0
   108
    int		__bpp__; \
sl@0
   109
    int		__xoff__,__yoff__; \
sl@0
   110
\
sl@0
   111
    fbGetDrawable((pict)->pDrawable,__bits__,__stride__,__bpp__,__xoff__,__yoff__); \
sl@0
   112
    (stride) = __stride__ * sizeof (FbBits) / sizeof (type); \
sl@0
   113
    (line) = ((type *) __bits__) + (stride) * ((y) - __yoff__) + (mul) * ((x) - __xoff__); \
sl@0
   114
}
sl@0
   115
#define cvt8888to0565(s)    ((((s) >> 3) & 0x001f) | \
sl@0
   116
			     (((s) >> 5) & 0x07e0) | \
sl@0
   117
			     (((s) >> 8) & 0xf800))
sl@0
   118
#define cvt0565to8888(s)    (((((s) << 3) & 0xf8) | (((s) >> 2) & 0x7)) | \
sl@0
   119
			     ((((s) << 5) & 0xfc00) | (((s) >> 1) & 0x300)) | \
sl@0
   120
			     ((((s) << 8) & 0xf80000) | (((s) << 3) & 0x70000)))
sl@0
   121
sl@0
   122
#if IMAGE_BYTE_ORDER == MSBFirst
sl@0
   123
#define Fetch24(a)  ((unsigned long) (a) & 1 ? \
sl@0
   124
		     ((*(a) << 16) | *((CARD16 *) ((a)+1))) : \
sl@0
   125
		     ((*((CARD16 *) (a)) << 8) | *((a)+2)))
sl@0
   126
#define Store24(a,v) ((unsigned long) (a) & 1 ? \
sl@0
   127
		      ((*(a) = (CARD8) ((v) >> 16)), \
sl@0
   128
		       (*((CARD16 *) ((a)+1)) = (CARD16) (v))) : \
sl@0
   129
		      ((*((CARD16 *) (a)) = (CARD16) ((v) >> 8)), \
sl@0
   130
		       (*((a)+2) = (CARD8) (v))))
sl@0
   131
#else
sl@0
   132
#define Fetch24(a)  ((unsigned long) (a) & 1 ? \
sl@0
   133
		     ((*(a)) | (*((CARD16 *) ((a)+1)) << 8)) : \
sl@0
   134
		     ((*((CARD16 *) (a))) | (*((a)+2) << 16)))
sl@0
   135
#define Store24(a,v) ((unsigned long) (a) & 1 ? \
sl@0
   136
		      ((*(a) = (CARD8) (v)), \
sl@0
   137
		       (*((CARD16 *) ((a)+1)) = (CARD16) ((v) >> 8))) : \
sl@0
   138
		      ((*((CARD16 *) (a)) = (CARD16) (v)),\
sl@0
   139
		       (*((a)+2) = (CARD8) ((v) >> 16))))
sl@0
   140
#endif
sl@0
   141
		      
sl@0
   142
/*
sl@0
   143
   The methods below use some tricks to be able to do two color
sl@0
   144
   components at the same time.
sl@0
   145
*/
sl@0
   146
sl@0
   147
/*
sl@0
   148
  x_c = (x_c * a) / 255
sl@0
   149
*/
sl@0
   150
#define FbByteMul(x, a) do {                                      \
sl@0
   151
        CARD32 t = (x & 0xff00ff) *a;                           \
sl@0
   152
        t = (t + ((t >> 8) & 0xff00ff) + 0x800080) >> 8;          \
sl@0
   153
        t &= 0xff00ff;                                            \
sl@0
   154
                                                                  \
sl@0
   155
        x = ((x >> 8) & 0xff00ff) * a;                            \
sl@0
   156
        x = (x + ((x >> 8) & 0xff00ff) + 0x800080);               \
sl@0
   157
        x &= 0xff00ff00;                                          \
sl@0
   158
        x += t;                                                   \
sl@0
   159
    } while (0)
sl@0
   160
sl@0
   161
/*
sl@0
   162
  x_c = (x_c * a) / 255 + y
sl@0
   163
*/
sl@0
   164
#define FbByteMulAdd(x, a, y) do {                                \
sl@0
   165
        CARD32 t = (x & 0xff00ff) * a;                            \
sl@0
   166
        t = (t + ((t >> 8) & 0xff00ff) + 0x800080) >> 8;          \
sl@0
   167
        t &= 0xff00ff;                                            \
sl@0
   168
        t += y & 0xff00ff;                                        \
sl@0
   169
        t |= 0x1000100 - ((t >> 8) & 0xff00ff);                   \
sl@0
   170
        t &= 0xff00ff;                                            \
sl@0
   171
                                                                  \
sl@0
   172
        x = ((x >> 8) & 0xff00ff) * a;                              \
sl@0
   173
        x = (x + ((x >> 8) & 0xff00ff) + 0x800080) >> 8;            \
sl@0
   174
        x &= 0xff00ff;                                              \
sl@0
   175
        x += (y >> 8) & 0xff00ff;                                   \
sl@0
   176
        x |= 0x1000100 - ((t >> 8) & 0xff00ff);                     \
sl@0
   177
        x &= 0xff00ff;                                              \
sl@0
   178
        x <<= 8;                                                    \
sl@0
   179
        x += t;                                                     \
sl@0
   180
    } while (0)
sl@0
   181
sl@0
   182
/*
sl@0
   183
  x_c = (x_c * a + y_c * b) / 255
sl@0
   184
*/
sl@0
   185
#define FbByteAddMul(x, a, y, b) do {                                   \
sl@0
   186
        CARD32 t;                                                       \
sl@0
   187
        CARD32 r = (x >> 24) * a + (y >> 24) * b;                       \
sl@0
   188
        r += (r >> 8) + 0x80;                                           \
sl@0
   189
        r >>= 8;                                                        \
sl@0
   190
                                                                        \
sl@0
   191
        t = (x & 0xff00) * a + (y & 0xff00) * b;                        \
sl@0
   192
        t += (t >> 8) + 0x8000;                                         \
sl@0
   193
        t >>= 16;                                                       \
sl@0
   194
                                                                        \
sl@0
   195
        t |= r << 16;                                                   \
sl@0
   196
        t |= 0x1000100 - ((t >> 8) & 0xff00ff);                         \
sl@0
   197
        t &= 0xff00ff;                                                  \
sl@0
   198
        t <<= 8;                                                        \
sl@0
   199
                                                                        \
sl@0
   200
        r = ((x >> 16) & 0xff) * a + ((y >> 16) & 0xff) * b;            \
sl@0
   201
        r += (r >> 8) + 0x80;                                           \
sl@0
   202
        r >>= 8;                                                        \
sl@0
   203
                                                                        \
sl@0
   204
        x = (x & 0xff) * a + (y & 0xff) * b;                            \
sl@0
   205
        x += (x >> 8) + 0x80;                                           \
sl@0
   206
        x >>= 8;                                                        \
sl@0
   207
        x |= r << 16;                                                   \
sl@0
   208
        x |= 0x1000100 - ((x >> 8) & 0xff00ff);                         \
sl@0
   209
        x &= 0xff00ff;                                                  \
sl@0
   210
        x |= t;                                                         \
sl@0
   211
} while (0)
sl@0
   212
sl@0
   213
/*
sl@0
   214
  x_c = (x_c * a + y_c *b) / 256
sl@0
   215
*/
sl@0
   216
#define FbByteAddMul_256(x, a, y, b) do {                               \
sl@0
   217
        CARD32 t = (x & 0xff00ff) * a + (y & 0xff00ff) * b;             \
sl@0
   218
        t >>= 8;                                                        \
sl@0
   219
        t &= 0xff00ff;                                                  \
sl@0
   220
                                                                        \
sl@0
   221
        x = ((x >> 8) & 0xff00ff) * a + ((y >> 8) & 0xff00ff) * b;      \
sl@0
   222
        x &= 0xff00ff00;                                                \
sl@0
   223
        x += t;                                                         \
sl@0
   224
} while (0)
sl@0
   225
/*
sl@0
   226
  x_c = (x_c * a_c) / 255
sl@0
   227
*/
sl@0
   228
#define FbByteMulC(x, a) do {                           \
sl@0
   229
        CARD32 t;                                       \
sl@0
   230
        CARD32 r = (x & 0xff) * (a & 0xff);             \
sl@0
   231
        r |= (x & 0xff0000) * ((a >> 16) & 0xff);       \
sl@0
   232
        r = (r + ((r >> 8) & 0xff00ff) + 0x800080) >> 8;        \
sl@0
   233
        r &= 0xff00ff;                                  \
sl@0
   234
                                                        \
sl@0
   235
        x >>= 8;                                        \
sl@0
   236
        t = (x & 0xff) * ((a >> 8) & 0xff);             \
sl@0
   237
        t |= (x & 0xff0000) * (a >> 24);                \
sl@0
   238
        t = (t + ((t >> 8) & 0xff00ff) + 0x800080);     \
sl@0
   239
        x = r | (t & 0xff00ff00);                       \
sl@0
   240
                                                        \
sl@0
   241
    } while (0)
sl@0
   242
sl@0
   243
/*
sl@0
   244
  x_c = (x_c * a) / 255 + y
sl@0
   245
*/
sl@0
   246
#define FbByteMulAddC(x, a, y) do {                                 \
sl@0
   247
        CARD32 t;                                                   \
sl@0
   248
        CARD32 r = (x & 0xff) * (a & 0xff);                         \
sl@0
   249
        r |= (x & 0xff0000) * ((a >> 16) & 0xff);                   \
sl@0
   250
        r = (r + ((r >> 8) & 0xff00ff) + 0x800080) >> 8;            \
sl@0
   251
        r &= 0xff00ff;                                              \
sl@0
   252
        r += y & 0xff00ff;                                          \
sl@0
   253
        r |= 0x1000100 - ((r >> 8) & 0xff00ff);                     \
sl@0
   254
        r &= 0xff00ff;                                              \
sl@0
   255
                                                                    \
sl@0
   256
        x >>= 8;                                                       \
sl@0
   257
        t = (x & 0xff) * ((a >> 8) & 0xff);                            \
sl@0
   258
        t |= (x & 0xff0000) * (a >> 24);                               \
sl@0
   259
        t = (t + ((t >> 8) & 0xff00ff) + 0x800080) >> 8;               \
sl@0
   260
        t &= 0xff00ff;                                                 \
sl@0
   261
        t += (y >> 8) & 0xff00ff;                                      \
sl@0
   262
        t |= 0x1000100 - ((t >> 8) & 0xff00ff);                        \
sl@0
   263
        t &= 0xff00ff;                                                 \
sl@0
   264
        x = r | (t << 8);                                              \
sl@0
   265
    } while (0)
sl@0
   266
sl@0
   267
/*
sl@0
   268
  x_c = (x_c * a_c + y_c * b) / 255
sl@0
   269
*/
sl@0
   270
#define FbByteAddMulC(x, a, y, b) do {                                  \
sl@0
   271
        CARD32 t;                                                       \
sl@0
   272
        CARD32 r = (x >> 24) * (a >> 24) + (y >> 24) * b;               \
sl@0
   273
        r += (r >> 8) + 0x80;                                           \
sl@0
   274
        r >>= 8;                                                        \
sl@0
   275
                                                                        \
sl@0
   276
        t = (x & 0xff00) * ((a >> 8) & 0xff) + (y & 0xff00) * b;        \
sl@0
   277
        t += (t >> 8) + 0x8000;                                         \
sl@0
   278
        t >>= 16;                                                       \
sl@0
   279
                                                                        \
sl@0
   280
        t |= r << 16;                                                   \
sl@0
   281
        t |= 0x1000100 - ((t >> 8) & 0xff00ff);                         \
sl@0
   282
        t &= 0xff00ff;                                                  \
sl@0
   283
        t <<= 8;                                                        \
sl@0
   284
                                                                        \
sl@0
   285
        r = ((x >> 16) & 0xff) * ((a >> 16) & 0xff) + ((y >> 16) & 0xff) * b; \
sl@0
   286
        r += (r >> 8) + 0x80;                                           \
sl@0
   287
        r >>= 8;                                                        \
sl@0
   288
                                                                        \
sl@0
   289
        x = (x & 0xff) * (a & 0xff) + (y & 0xff) * b;                   \
sl@0
   290
        x += (x >> 8) + 0x80;                                           \
sl@0
   291
        x >>= 8;                                                        \
sl@0
   292
        x |= r << 16;                                                   \
sl@0
   293
        x |= 0x1000100 - ((x >> 8) & 0xff00ff);                         \
sl@0
   294
        x &= 0xff00ff;                                                  \
sl@0
   295
        x |= t;                                                         \
sl@0
   296
    } while (0)
sl@0
   297
 
sl@0
   298
/*
sl@0
   299
  x_c = min(x_c + y_c, 255)
sl@0
   300
*/
sl@0
   301
#define FbByteAdd(x, y) do {                                            \
sl@0
   302
        CARD32 t;                                                       \
sl@0
   303
        CARD32 r = (x & 0xff00ff) + (y & 0xff00ff);                     \
sl@0
   304
        r |= 0x1000100 - ((r >> 8) & 0xff00ff);                         \
sl@0
   305
        r &= 0xff00ff;                                                  \
sl@0
   306
                                                                        \
sl@0
   307
        t = ((x >> 8) & 0xff00ff) + ((y >> 8) & 0xff00ff);              \
sl@0
   308
        t |= 0x1000100 - ((t >> 8) & 0xff00ff);                         \
sl@0
   309
        r |= (t & 0xff00ff) << 8;                                       \
sl@0
   310
        x = r;                                                          \
sl@0
   311
    } while (0)
sl@0
   312
sl@0
   313
#define div_255(x) (((x) + ((x) >> 8) + 0x80) >> 8)
sl@0
   314
sl@0
   315
#if defined(__i386__) && defined(__GNUC__)
sl@0
   316
#define FASTCALL __attribute__((regparm(3)))
sl@0
   317
#else
sl@0
   318
#define FASTCALL
sl@0
   319
#endif
sl@0
   320
sl@0
   321
#if defined(__GNUC__)
sl@0
   322
#define INLINE __inline__
sl@0
   323
#else
sl@0
   324
#define INLINE
sl@0
   325
#endif
sl@0
   326
sl@0
   327
typedef struct _FbComposeData {
sl@0
   328
    CARD8	op;
sl@0
   329
    PicturePtr	src;
sl@0
   330
    PicturePtr	mask;
sl@0
   331
    PicturePtr	dest;
sl@0
   332
    INT16	xSrc;
sl@0
   333
    INT16	ySrc;
sl@0
   334
    INT16	xMask;
sl@0
   335
    INT16	yMask;
sl@0
   336
    INT16	xDest;
sl@0
   337
    INT16	yDest;
sl@0
   338
    CARD16	width;
sl@0
   339
    CARD16	height;
sl@0
   340
} FbComposeData;
sl@0
   341
sl@0
   342
#if 0
sl@0
   343
typedef FASTCALL void (*CombineMaskU) (CARD32 *src, const CARD32 *mask, int width);
sl@0
   344
typedef FASTCALL void (*CombineFuncU) (CARD32 *dest, const CARD32 *src, int width);
sl@0
   345
typedef FASTCALL void (*CombineFuncC) (CARD32 *dest, CARD32 *src, CARD32 *mask, int width);
sl@0
   346
sl@0
   347
typedef struct _FbComposeFunctions {
sl@0
   348
    CombineFuncU *combineU;
sl@0
   349
    CombineFuncC *combineC;
sl@0
   350
    CombineMaskU combineMaskU;
sl@0
   351
} FbComposeFunctions;
sl@0
   352
sl@0
   353
/* fbcompose.c */
sl@0
   354
sl@0
   355
void
sl@0
   356
fbCompositeGeneral (CARD8	op,
sl@0
   357
		    PicturePtr	pSrc,
sl@0
   358
		    PicturePtr	pMask,
sl@0
   359
		    PicturePtr	pDst,
sl@0
   360
		    INT16	xSrc,
sl@0
   361
		    INT16	ySrc,
sl@0
   362
		    INT16	xMask,
sl@0
   363
		    INT16	yMask,
sl@0
   364
		    INT16	xDst,
sl@0
   365
		    INT16	yDst,
sl@0
   366
		    CARD16	width,
sl@0
   367
		    CARD16	height);
sl@0
   368
sl@0
   369
sl@0
   370
/* fbedge.c */
sl@0
   371
void
sl@0
   372
fbRasterizeEdges (FbBits	*buf,
sl@0
   373
		  int		bpp,
sl@0
   374
		  int		width,
sl@0
   375
		  int		stride,
sl@0
   376
		  RenderEdge	*l,
sl@0
   377
		  RenderEdge	*r,
sl@0
   378
		  xFixed	t,
sl@0
   379
		  xFixed	b);
sl@0
   380
sl@0
   381
/* fbpict.c */
sl@0
   382
CARD32
sl@0
   383
fbOver (CARD32 x, CARD32 y);
sl@0
   384
sl@0
   385
CARD32
sl@0
   386
fbOver24 (CARD32 x, CARD32 y);
sl@0
   387
sl@0
   388
CARD32
sl@0
   389
fbIn (CARD32 x, CARD8 y);
sl@0
   390
sl@0
   391
void
sl@0
   392
fbCompositeSolidMask_nx8x8888 (CARD8      op,
sl@0
   393
			       PicturePtr pSrc,
sl@0
   394
			       PicturePtr pMask,
sl@0
   395
			       PicturePtr pDst,
sl@0
   396
			       INT16      xSrc,
sl@0
   397
			       INT16      ySrc,
sl@0
   398
			       INT16      xMask,
sl@0
   399
			       INT16      yMask,
sl@0
   400
			       INT16      xDst,
sl@0
   401
			       INT16      yDst,
sl@0
   402
			       CARD16     width,
sl@0
   403
			       CARD16     height);
sl@0
   404
sl@0
   405
void
sl@0
   406
fbCompositeSolidMask_nx8x0888 (CARD8      op,
sl@0
   407
			       PicturePtr pSrc,
sl@0
   408
			       PicturePtr pMask,
sl@0
   409
			       PicturePtr pDst,
sl@0
   410
			       INT16      xSrc,
sl@0
   411
			       INT16      ySrc,
sl@0
   412
			       INT16      xMask,
sl@0
   413
			       INT16      yMask,
sl@0
   414
			       INT16      xDst,
sl@0
   415
			       INT16      yDst,
sl@0
   416
			       CARD16     width,
sl@0
   417
			       CARD16     height);
sl@0
   418
sl@0
   419
void
sl@0
   420
fbCompositeSolidMask_nx8888x8888C (CARD8      op,
sl@0
   421
				   PicturePtr pSrc,
sl@0
   422
				   PicturePtr pMask,
sl@0
   423
				   PicturePtr pDst,
sl@0
   424
				   INT16      xSrc,
sl@0
   425
				   INT16      ySrc,
sl@0
   426
				   INT16      xMask,
sl@0
   427
				   INT16      yMask,
sl@0
   428
				   INT16      xDst,
sl@0
   429
				   INT16      yDst,
sl@0
   430
				   CARD16     width,
sl@0
   431
				   CARD16     height);
sl@0
   432
sl@0
   433
void
sl@0
   434
fbCompositeSolidMask_nx8x0565 (CARD8      op,
sl@0
   435
			       PicturePtr pSrc,
sl@0
   436
			       PicturePtr pMask,
sl@0
   437
			       PicturePtr pDst,
sl@0
   438
			       INT16      xSrc,
sl@0
   439
			       INT16      ySrc,
sl@0
   440
			       INT16      xMask,
sl@0
   441
			       INT16      yMask,
sl@0
   442
			       INT16      xDst,
sl@0
   443
			       INT16      yDst,
sl@0
   444
			       CARD16     width,
sl@0
   445
			       CARD16     height);
sl@0
   446
sl@0
   447
void
sl@0
   448
fbCompositeSolidMask_nx8888x0565C (CARD8      op,
sl@0
   449
				   PicturePtr pSrc,
sl@0
   450
				   PicturePtr pMask,
sl@0
   451
				   PicturePtr pDst,
sl@0
   452
				   INT16      xSrc,
sl@0
   453
				   INT16      ySrc,
sl@0
   454
				   INT16      xMask,
sl@0
   455
				   INT16      yMask,
sl@0
   456
				   INT16      xDst,
sl@0
   457
				   INT16      yDst,
sl@0
   458
				   CARD16     width,
sl@0
   459
				   CARD16     height);
sl@0
   460
sl@0
   461
void
sl@0
   462
fbCompositeSrc_8888x8888 (CARD8      op,
sl@0
   463
			  PicturePtr pSrc,
sl@0
   464
			  PicturePtr pMask,
sl@0
   465
			  PicturePtr pDst,
sl@0
   466
			  INT16      xSrc,
sl@0
   467
			  INT16      ySrc,
sl@0
   468
			  INT16      xMask,
sl@0
   469
			  INT16      yMask,
sl@0
   470
			  INT16      xDst,
sl@0
   471
			  INT16      yDst,
sl@0
   472
			  CARD16     width,
sl@0
   473
			  CARD16     height);
sl@0
   474
sl@0
   475
void
sl@0
   476
fbCompositeSrc_8888x0888 (CARD8      op,
sl@0
   477
			 PicturePtr pSrc,
sl@0
   478
			 PicturePtr pMask,
sl@0
   479
			 PicturePtr pDst,
sl@0
   480
			 INT16      xSrc,
sl@0
   481
			 INT16      ySrc,
sl@0
   482
			 INT16      xMask,
sl@0
   483
			 INT16      yMask,
sl@0
   484
			 INT16      xDst,
sl@0
   485
			 INT16      yDst,
sl@0
   486
			 CARD16     width,
sl@0
   487
			 CARD16     height);
sl@0
   488
sl@0
   489
void
sl@0
   490
fbCompositeSrc_8888x0565 (CARD8      op,
sl@0
   491
			  PicturePtr pSrc,
sl@0
   492
			  PicturePtr pMask,
sl@0
   493
			  PicturePtr pDst,
sl@0
   494
			  INT16      xSrc,
sl@0
   495
			  INT16      ySrc,
sl@0
   496
			  INT16      xMask,
sl@0
   497
			  INT16      yMask,
sl@0
   498
			  INT16      xDst,
sl@0
   499
			  INT16      yDst,
sl@0
   500
			  CARD16     width,
sl@0
   501
			  CARD16     height);
sl@0
   502
sl@0
   503
void
sl@0
   504
fbCompositeSrc_0565x0565 (CARD8      op,
sl@0
   505
			  PicturePtr pSrc,
sl@0
   506
			  PicturePtr pMask,
sl@0
   507
			  PicturePtr pDst,
sl@0
   508
			  INT16      xSrc,
sl@0
   509
			  INT16      ySrc,
sl@0
   510
			  INT16      xMask,
sl@0
   511
			  INT16      yMask,
sl@0
   512
			  INT16      xDst,
sl@0
   513
			  INT16      yDst,
sl@0
   514
			  CARD16     width,
sl@0
   515
			  CARD16     height);
sl@0
   516
sl@0
   517
void
sl@0
   518
fbCompositeSrcAdd_8000x8000 (CARD8	op,
sl@0
   519
			     PicturePtr pSrc,
sl@0
   520
			     PicturePtr pMask,
sl@0
   521
			     PicturePtr pDst,
sl@0
   522
			     INT16      xSrc,
sl@0
   523
			     INT16      ySrc,
sl@0
   524
			     INT16      xMask,
sl@0
   525
			     INT16      yMask,
sl@0
   526
			     INT16      xDst,
sl@0
   527
			     INT16      yDst,
sl@0
   528
			     CARD16     width,
sl@0
   529
			     CARD16     height);
sl@0
   530
sl@0
   531
void
sl@0
   532
fbCompositeSrcAdd_8888x8888 (CARD8	op,
sl@0
   533
			     PicturePtr pSrc,
sl@0
   534
			     PicturePtr pMask,
sl@0
   535
			     PicturePtr pDst,
sl@0
   536
			     INT16      xSrc,
sl@0
   537
			     INT16      ySrc,
sl@0
   538
			     INT16      xMask,
sl@0
   539
			     INT16      yMask,
sl@0
   540
			     INT16      xDst,
sl@0
   541
			     INT16      yDst,
sl@0
   542
			     CARD16     width,
sl@0
   543
			     CARD16     height);
sl@0
   544
sl@0
   545
void
sl@0
   546
fbCompositeSrcAdd_1000x1000 (CARD8	op,
sl@0
   547
			     PicturePtr pSrc,
sl@0
   548
			     PicturePtr pMask,
sl@0
   549
			     PicturePtr pDst,
sl@0
   550
			     INT16      xSrc,
sl@0
   551
			     INT16      ySrc,
sl@0
   552
			     INT16      xMask,
sl@0
   553
			     INT16      yMask,
sl@0
   554
			     INT16      xDst,
sl@0
   555
			     INT16      yDst,
sl@0
   556
			     CARD16     width,
sl@0
   557
			     CARD16     height);
sl@0
   558
sl@0
   559
void
sl@0
   560
fbCompositeSolidMask_nx1xn (CARD8      op,
sl@0
   561
			    PicturePtr pSrc,
sl@0
   562
			    PicturePtr pMask,
sl@0
   563
			    PicturePtr pDst,
sl@0
   564
			    INT16      xSrc,
sl@0
   565
			    INT16      ySrc,
sl@0
   566
			    INT16      xMask,
sl@0
   567
			    INT16      yMask,
sl@0
   568
			    INT16      xDst,
sl@0
   569
			    INT16      yDst,
sl@0
   570
			    CARD16     width,
sl@0
   571
			    CARD16     height);
sl@0
   572
sl@0
   573
void
sl@0
   574
fbComposite (CARD8      op,
sl@0
   575
	     PicturePtr pSrc,
sl@0
   576
	     PicturePtr pMask,
sl@0
   577
	     PicturePtr pDst,
sl@0
   578
	     INT16      xSrc,
sl@0
   579
	     INT16      ySrc,
sl@0
   580
	     INT16      xMask,
sl@0
   581
	     INT16      yMask,
sl@0
   582
	     INT16      xDst,
sl@0
   583
	     INT16      yDst,
sl@0
   584
	     CARD16     width,
sl@0
   585
	     CARD16     height);
sl@0
   586
sl@0
   587
/* fbtrap.c */
sl@0
   588
sl@0
   589
void
sl@0
   590
fbAddTraps (PicturePtr	pPicture,
sl@0
   591
	    INT16	xOff,
sl@0
   592
	    INT16	yOff,
sl@0
   593
	    int		ntrap,
sl@0
   594
	    xTrap	*traps);
sl@0
   595
sl@0
   596
void
sl@0
   597
fbRasterizeTrapezoid (PicturePtr    alpha,
sl@0
   598
		      xTrapezoid    *trap,
sl@0
   599
		      int	    x_off,
sl@0
   600
		      int	    y_off);
sl@0
   601
sl@0
   602
void
sl@0
   603
fbAddTriangles (PicturePtr  pPicture,
sl@0
   604
		INT16	    xOff,
sl@0
   605
		INT16	    yOff,
sl@0
   606
		int	    ntri,
sl@0
   607
		xTriangle   *tris);
sl@0
   608
#endif
sl@0
   609
sl@0
   610
#endif /* _FBPICT_H_ */