Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

265 lines
7.4 KiB

  1. /******************************Module*Header*******************************\
  2. * Module Name: bltlnk.hxx
  3. *
  4. * This contains the structures used in StinkBlt
  5. *
  6. * Created: 16-Aug-1993
  7. * Author: Mark Enstrom Marke
  8. *
  9. * Copyright (c) 1993-1999 Microsoft Corporation
  10. \**************************************************************************/
  11. // We pass a pointer to this data struct for every rectangle we blt to.
  12. typedef struct _BLTLNKINFO
  13. {
  14. //
  15. // These first fields are all constant. They are set in StinkerBlt
  16. // and don't change for each clip rect.
  17. //
  18. RECTL rclDst; // Target offset and extent
  19. SURFACE *pdioDst; // Target surface
  20. SURFACE *pdioSrc; // Source surface
  21. SURFACE *pdioMsk; // Mask
  22. ECLIPOBJ *pco; // Clip through this
  23. XLATE *pxlo; // Color translation
  24. EBRUSHOBJ *pdbrush; // Brush data (from cbRealizeBrush)
  25. BYTE rop3; // Raster operation
  26. LONG iDir; // Tells which way to enumerate the rects
  27. LONG xDir; // This tells which direction we go
  28. LONG yDir; // This tells which direction we go
  29. PBYTE pjSrc; // This is pdioSrc->pvBitsInt(), top scanline
  30. PBYTE pjDst; // This is pdioDst->pvBitsInt(), top scanline
  31. PBYTE pjMsk; // This is pdioMsk->pvBitsInt(), top scanline
  32. // or the msk from a brush.
  33. PBYTE pjPat; // This is pdioPat->pvBitsInt(), top scanline
  34. LONG lDeltaSrc; // How many bytes to jump down 1 scanline
  35. LONG lDeltaDst; // How many bytes to jump down 1 scanline
  36. LONG lDeltaPat; // How many bytes to jump down 1 scanline
  37. LONG lDeltaMsk; // How many bytes to jump down 1 scanline
  38. //
  39. // The next four all have yDir taken into account.
  40. //
  41. LONG lDeltaSrcDir; // How many bytes to jump yDir scanline
  42. LONG lDeltaDstDir; // How many bytes to jump yDir scanline
  43. LONG lDeltaPatDir; // How many bytes to jump yDir scanline
  44. LONG lDeltaMskDir; // How many bytes to jump yDir scanline
  45. //
  46. // This is the Src information
  47. //
  48. ULONG xSrcOrg;
  49. ULONG ySrcOrg;
  50. //
  51. // This is the Pat information.
  52. //
  53. ULONG iSolidColor; // if not 0xFFFFFFFF then the color of the brush
  54. ULONG cxPat; // width of brush
  55. ULONG cyPat; // height of brush
  56. LONG xPatOrg; // Where the brush origin is
  57. LONG yPatOrg; // Where the brush origin is
  58. //
  59. // This is the Msk information.
  60. //
  61. ULONG cxMsk; // width of mask
  62. LONG cyMsk; // height of mask
  63. LONG xMskOrg; // Where the mask origin is
  64. LONG yMskOrg; // Where the mask origin is
  65. BYTE NegateMsk; // If 0xFF then negate mask when deciding whether to store
  66. LONG xDstStart; // This is the number of pels in to start
  67. LONG xSrcStart; // number of pels in to start, inclusive
  68. LONG xSrcEnd; // the pel to stop at, exclusive
  69. LONG xSrc; // left edge in src
  70. LONG ySrc; // top edge in src
  71. //
  72. // This is the Rop info
  73. //
  74. ULONG RopSrc;
  75. ULONG RopDst;
  76. BOOL bNeedSrc;
  77. BOOL bNeedDst;
  78. BOOL bNeedPat;
  79. BOOL bNeedMsk;
  80. } BLTLNKINFO,*PBLTLNKINFO;
  81. typedef struct _BLTLNK_MASKINFO {
  82. PBYTE pjMsk;
  83. PBYTE pjMskBase;
  84. LONG cyMsk;
  85. LONG iyMsk;
  86. LONG cxMsk;
  87. LONG ixMsk;
  88. LONG lDeltaMskDir;
  89. BYTE NegateMsk;
  90. } BLTLNK_MASKINFO,*PBLTLNK_MASKINFO;
  91. #define BB_RECT_LIMIT 20
  92. BOOL
  93. BltLnk(
  94. SURFACE *pdioDst, // Target surface
  95. SURFACE *pdioSrc, // Source surface
  96. SURFACE *pdioMsk, // Mask
  97. ECLIPOBJ *pco, // Clip through this
  98. XLATE *pxlo, // Color translation
  99. PRECTL prclDst, // Target offset and extent
  100. PPOINTL pptlSrc, // Source offset
  101. PPOINTL pptlMask, // Mask offset
  102. BRUSHOBJ *pdbrush, // Brush data (from cbRealizeBrush)
  103. PPOINTL pptlBrush, // Brush offset (origin)
  104. ROP4 rop4 // Raster operation
  105. );
  106. typedef VOID (*PFN_BLTLNKROP)(PULONG,PULONG,PULONG,ULONG);
  107. VOID
  108. vRop2Function0(PULONG,PULONG,PULONG,ULONG);
  109. VOID
  110. vRop2Function1(PULONG,PULONG,PULONG,ULONG);
  111. VOID
  112. vRop2Function2(PULONG,PULONG,PULONG,ULONG);
  113. VOID
  114. vRop2Function3(PULONG,PULONG,PULONG,ULONG);
  115. VOID
  116. vRop2Function4(PULONG,PULONG,PULONG,ULONG);
  117. VOID
  118. vRop2Function5(PULONG,PULONG,PULONG,ULONG);
  119. VOID
  120. vRop2Function6(PULONG,PULONG,PULONG,ULONG);
  121. VOID
  122. vRop2Function7(PULONG,PULONG,PULONG,ULONG);
  123. VOID
  124. vRop2Function8(PULONG,PULONG,PULONG,ULONG);
  125. VOID
  126. vRop2Function9(PULONG,PULONG,PULONG,ULONG);
  127. VOID
  128. vRop2FunctionA(PULONG,PULONG,PULONG,ULONG);
  129. VOID
  130. vRop2FunctionB(PULONG,PULONG,PULONG,ULONG);
  131. VOID
  132. vRop2FunctionC(PULONG,PULONG,PULONG,ULONG);
  133. VOID
  134. vRop2FunctionD(PULONG,PULONG,PULONG,ULONG);
  135. VOID
  136. vRop2FunctionE(PULONG,PULONG,PULONG,ULONG);
  137. VOID
  138. vRop2FunctionF(PULONG,PULONG,PULONG,ULONG);
  139. VOID
  140. BltLnkSrcCopyMsk1(PBLTINFO,PBLTLNK_MASKINFO,PULONG,PULONG);
  141. VOID
  142. BltLnkSrcCopyMsk4(PBLTINFO,PBLTLNK_MASKINFO,PULONG,PULONG);
  143. VOID
  144. BltLnkSrcCopyMsk8(PBLTINFO,PBLTLNK_MASKINFO,PULONG,PULONG);
  145. VOID
  146. BltLnkSrcCopyMsk16(PBLTINFO,PBLTLNK_MASKINFO,PULONG,PULONG);
  147. VOID
  148. BltLnkSrcCopyMsk24(PBLTINFO,PBLTLNK_MASKINFO,PULONG,PULONG);
  149. VOID
  150. BltLnkSrcCopyMsk32(PBLTINFO,PBLTLNK_MASKINFO,PULONG,PULONG);
  151. VOID
  152. BltLnkPatMaskCopy1(PBLTINFO,ULONG,PULONG,BYTE);
  153. VOID
  154. BltLnkPatMaskCopy4(PBLTINFO,ULONG,PULONG,BYTE);
  155. VOID
  156. BltLnkPatMaskCopy8(PBLTINFO,ULONG,PULONG,BYTE);
  157. VOID
  158. BltLnkPatMaskCopy16(PBLTINFO,ULONG,PULONG,BYTE);
  159. VOID
  160. BltLnkPatMaskCopy24(PBLTINFO,ULONG,PULONG,BYTE);
  161. VOID
  162. BltLnkPatMaskCopy32(PBLTINFO,ULONG,PULONG,BYTE);
  163. VOID
  164. BltLnkRect(
  165. PBLTLNKINFO pBlt,
  166. PRECTL prcl
  167. );
  168. VOID BltLnkRead(
  169. PULONG pulDst,
  170. PULONG pulSrc,
  171. ULONG cx
  172. );
  173. VOID BltLnkReadPat(
  174. PBYTE pjDst,
  175. ULONG ixDst,
  176. PBYTE pjPat,
  177. ULONG cxPat,
  178. ULONG ixPat,
  179. ULONG PixelCount,
  180. ULONG BytesPerPixel
  181. );
  182. VOID
  183. BltLnkReadPat1 (
  184. PBYTE pjDst,
  185. ULONG ixDst,
  186. PBYTE pjPat,
  187. ULONG cxPat,
  188. ULONG ixPat,
  189. ULONG PixelCount,
  190. ULONG BytesPerPixel
  191. );
  192. VOID
  193. BltLnkReadPat4 (
  194. PBYTE pjDst,
  195. ULONG ixDst,
  196. PBYTE pjPat,
  197. ULONG cxPat,
  198. ULONG ixPat,
  199. ULONG PixelCount,
  200. ULONG BytesPerPixel
  201. );
  202. VOID
  203. BltLnkAccel6666 (
  204. PBYTE pjSrcStart,
  205. PBYTE pjDstStart,
  206. LONG lDeltaSrcDir,
  207. LONG lDeltaDstDir,
  208. LONG cx,
  209. LONG cy
  210. );
  211. VOID
  212. BltLnkAccel8888 (
  213. PBYTE pjSrcStart,
  214. PBYTE pjDstStart,
  215. LONG lDeltaSrcDir,
  216. LONG lDeltaDstDir,
  217. LONG cx,
  218. LONG cy
  219. );
  220. VOID
  221. BltLnkAccelEEEE (
  222. PBYTE pjSrcStart,
  223. PBYTE pjDstStart,
  224. LONG lDeltaSrcDir,
  225. LONG lDeltaDstDir,
  226. LONG cx,
  227. LONG cy
  228. );
  229. typedef VOID (*PFN_SRCCOPYMASK)(PBLTINFO,PBLTLNK_MASKINFO,PULONG,PULONG);
  230. typedef VOID (*PFN_READPAT)(PBYTE,ULONG,PBYTE,ULONG,ULONG,ULONG,ULONG);
  231. typedef VOID (*PFN_PATMASKCOPY)(PBLTINFO,ULONG,PULONG,BYTE);
  232.