fbpict.h 23 KB

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