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.

146 lines
3.7 KiB

  1. /******************************Module*Header*******************************\
  2. * Module Name: rotate.hxx
  3. *
  4. * This defines the structures and flags used by EngPlgBlt
  5. *
  6. * Created: 06-Aug-1992 11:30:45
  7. * Author: Donald Sidoroff [donalds]
  8. *
  9. * Copyright (c) 1992-1999 Microsoft Corporation
  10. \**************************************************************************/
  11. #define PLGBLT_ENABLE 1
  12. #define PLGBLT_SHOW_INIT 2
  13. #define PLGBLT_SHOW_PUMP 4
  14. #define PLGBLT_ALLOC 8
  15. #define PLGBLT_RECTS 16
  16. #define PLGBLT_STACK_ALLOC 2000L
  17. #define FETCHBITS(buff,src,off,cnt) \
  18. (buff)[1] = (src)[0]; \
  19. if (((cnt) + (off)) > 7) \
  20. (buff)[0] = (src)[1]; \
  21. *((WORD *) &(buff)[0]) >>= (8 - (USHORT)(off)) \
  22. typedef struct _CNTPOS
  23. {
  24. LONG iPos;
  25. LONG cCnt;
  26. } CNTPOS;
  27. typedef struct _PLGRUN
  28. {
  29. ULONG iColor;
  30. CNTPOS cpY;
  31. CNTPOS cpX[1];
  32. } PLGRUN;
  33. typedef struct _DIV_T {
  34. LONG lQuo;
  35. LONG lRem;
  36. } DIV_T;
  37. typedef struct _DDA_STEP {
  38. DIV_T dt;
  39. LONG lDen;
  40. } DDA_STEP;
  41. #define DDA(d,i) \
  42. (d)->lQuo += (i)->dt.lQuo; \
  43. (d)->lRem += (i)->dt.lRem; \
  44. if ((d)->lRem >= (i)->lDen) \
  45. { \
  46. (d)->lQuo += 1; \
  47. (d)->lRem -= (i)->lDen; \
  48. }
  49. typedef struct _DDA_STATE {
  50. DIV_T dt0;
  51. DIV_T dt1;
  52. DIV_T dt2;
  53. DIV_T dt3;
  54. DIV_T dt01;
  55. DIV_T dt02;
  56. DIV_T dt13;
  57. DIV_T dt23;
  58. } DDA_STATE;
  59. typedef struct _PLGDDA
  60. {
  61. BOOL bOverwrite;
  62. DDA_STATE ds;
  63. DDA_STATE dsX;
  64. DDA_STEP dp0_i;
  65. DDA_STEP dp1_i;
  66. DDA_STEP dp2_i;
  67. DDA_STEP dp3_i;
  68. DDA_STEP dp0_j;
  69. DDA_STEP dp1_j;
  70. DDA_STEP dp2_j;
  71. DDA_STEP dp3_j;
  72. DDA_STEP dp01_i;
  73. DDA_STEP dp02_i;
  74. DDA_STEP dp13_i;
  75. DDA_STEP dp23_i;
  76. DDA_STEP dp01_j;
  77. DDA_STEP dp02_j;
  78. DDA_STEP dp13_j;
  79. DDA_STEP dp23_j;
  80. DDA_STEP dp01;
  81. DDA_STEP dp02;
  82. DDA_STEP dp13;
  83. DDA_STEP dp23;
  84. DDA_STEP dpP01;
  85. DDA_STEP dpP02;
  86. } PLGDDA;
  87. BOOL bInitPlgDDA(PLGDDA *, RECTL *, RECTL *, POINTFIX *);
  88. LONG lSizeDDA(PLGDDA *);
  89. VOID vAdvXDDA(PLGDDA *);
  90. VOID vAdvYDDA(PLGDDA *);
  91. PLGRUN *prunPumpDDA(PLGDDA *, PLGRUN *);
  92. typedef PLGRUN *(*PFN_PLGREAD)(PLGDDA *,PLGRUN *,BYTE *,BYTE *,XLATEOBJ *,LONG,LONG,LONG);
  93. typedef VOID (*PFN_PLGWRITE)(PLGRUN *,PLGRUN *,SURFACE *,CLIPOBJ *);
  94. PLGRUN *prunPlgRead1(PLGDDA *,PLGRUN *,BYTE *,BYTE *,XLATEOBJ *,LONG,LONG,LONG);
  95. PLGRUN *prunPlgRead4(PLGDDA *,PLGRUN *,BYTE *,BYTE *,XLATEOBJ *,LONG,LONG,LONG);
  96. PLGRUN *prunPlgRead8(PLGDDA *,PLGRUN *,BYTE *,BYTE *,XLATEOBJ *,LONG,LONG,LONG);
  97. PLGRUN *prunPlgRead16(PLGDDA *,PLGRUN *,BYTE *,BYTE *,XLATEOBJ *,LONG,LONG,LONG);
  98. PLGRUN *prunPlgRead24(PLGDDA *,PLGRUN *,BYTE *,BYTE *,XLATEOBJ *,LONG,LONG,LONG);
  99. PLGRUN *prunPlgRead32(PLGDDA *,PLGRUN *,BYTE *,BYTE *,XLATEOBJ *,LONG,LONG,LONG);
  100. VOID vPlgWrite1(PLGRUN *,PLGRUN *,SURFACE *,CLIPOBJ *);
  101. VOID vPlgWrite4(PLGRUN *,PLGRUN *,SURFACE *,CLIPOBJ *);
  102. VOID vPlgWrite8(PLGRUN *,PLGRUN *,SURFACE *,CLIPOBJ *);
  103. VOID vPlgWrite16(PLGRUN *,PLGRUN *,SURFACE *,CLIPOBJ *);
  104. VOID vPlgWrite24(PLGRUN *,PLGRUN *,SURFACE *,CLIPOBJ *);
  105. VOID vPlgWrite32(PLGRUN *,PLGRUN *,SURFACE *,CLIPOBJ *);
  106. VOID vPlgWriteAND(PLGRUN *,PLGRUN *,SURFACE *,CLIPOBJ *);
  107. VOID vPlgWriteOR(PLGRUN *,PLGRUN *,SURFACE *,CLIPOBJ *);
  108. static PFN_PLGREAD apfnRead[] = {
  109. NULL,
  110. prunPlgRead1,
  111. prunPlgRead4,
  112. prunPlgRead8,
  113. prunPlgRead16,
  114. prunPlgRead24,
  115. prunPlgRead32 };
  116. static PFN_PLGWRITE apfnWrite[] = {
  117. NULL,
  118. vPlgWrite1,
  119. vPlgWrite4,
  120. vPlgWrite8,
  121. vPlgWrite16,
  122. vPlgWrite24,
  123. vPlgWrite32 };
  124. static PFN_PLGWRITE apfnBogus[] = {
  125. NULL,
  126. vPlgWriteAND,
  127. vPlgWriteOR };