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.

113 lines
3.0 KiB

  1. //-----------------------------------------------------------------------------
  2. //
  3. // This file contains the general span parsing code.
  4. //
  5. // Copyright (C) Microsoft Corporation, 1997.
  6. //
  7. //-----------------------------------------------------------------------------
  8. #include "pch.cpp"
  9. #pragma hdrstop
  10. #include "rloop_mh.h"
  11. #include "rmono.h"
  12. #include "rtrd_mh.h"
  13. include(`m4hdr.mh')
  14. include(`rampbead.mh')
  15. UINT16 g_uRampDitherTable[16] =
  16. {
  17. 0x00, 0x80, 0x20, 0xa0,
  18. 0xc0, 0x40, 0xe0, 0x60,
  19. 0x30, 0xb0, 0x10, 0x90,
  20. 0xf0, 0x70, 0xd0, 0x50
  21. };
  22. //-----------------------------------------------------------------------------
  23. //
  24. // Ramp_*Tbl
  25. //
  26. // The individual bead tables
  27. //
  28. //-----------------------------------------------------------------------------
  29. #define Ramp_NULL NULL
  30. define(`d_MakeTable', `
  31. static d_UpCase(`$1')`'BEADS Ramp_`'$1`'Beads =
  32. {
  33. d_Null(d_`'$1`'Beads(`` Ramp_XX,
  34. '', `XX'))dnl
  35. };')dnl
  36. dnl
  37. d_MakeTable(RampBegin)
  38. d_MakeTable(RampMono)
  39. d_MakeTable(RampTexRead)
  40. // RenderSpans table is initially empty because it's very sparsely populated.
  41. static RAMPRENDERSPANSBEADS Ramp_RampRenderSpansBeads;
  42. // Actual RenderSpans table entries.
  43. struct RAMP_RENDERSPANSBEAD_ENTRY
  44. {
  45. INT iIndex;
  46. PFNRENDERSPANS pfn;
  47. };
  48. static RAMP_RENDERSPANSBEAD_ENTRY Ramp_SpecializedRampRenderSpansBeads[] =
  49. {
  50. d_Null(d_SpecializedRampRenderSpansBeads(`` d_RampRenderSpansBeadIndex(XX), Ramp_XX, '', `XX'))dnl
  51. };
  52. //-----------------------------------------------------------------------------
  53. //
  54. // Ramp_BeadTbl
  55. //
  56. // The root of all the bead table pointers.
  57. //
  58. //-----------------------------------------------------------------------------
  59. RAMPBEADTABLE g_Ramp_BeadTbl =
  60. {
  61. Ramp_RenderSpans_Any,
  62. &Ramp_RampRenderSpansBeads,
  63. &Ramp_RampBeginBeads,
  64. &Ramp_RampMonoBeads,
  65. &Ramp_RampTexReadBeads,
  66. };
  67. //----------------------------------------------------------------------------
  68. //
  69. // Ramp_InitBeadTbl
  70. //
  71. // Initializes the ramp bead table.
  72. //
  73. //----------------------------------------------------------------------------
  74. void
  75. Ramp_InitBeadTbl(void)
  76. {
  77. INT i;
  78. PFNRENDERSPANS *ppfn;
  79. RAMP_RENDERSPANSBEAD_ENTRY *pEnt;
  80. // Initialize all RenderSpans bead entries to the generic routine.
  81. ppfn = (PFNRENDERSPANS *)g_Ramp_BeadTbl.pRenderSpansBeads;
  82. for (i = 0;
  83. i < sizeof(*g_Ramp_BeadTbl.pRenderSpansBeads)/sizeof(PFNRENDERSPANS);
  84. i++)
  85. {
  86. *ppfn++ = g_Ramp_BeadTbl.pfnRenderSpansAny;
  87. }
  88. // #define NO_SPECIALIZED_LOOPS
  89. #ifndef NO_SPECIALIZED_LOOPS
  90. // Insert specific implementations.
  91. pEnt = &Ramp_SpecializedRampRenderSpansBeads[0];
  92. ppfn = (PFNRENDERSPANS *)g_Ramp_BeadTbl.pRenderSpansBeads;
  93. for (i = 0;
  94. i < sizeof(Ramp_SpecializedRampRenderSpansBeads) / sizeof(*pEnt);
  95. i++)
  96. {
  97. *(ppfn + pEnt->iIndex) = pEnt->pfn;
  98. pEnt++;
  99. }
  100. #endif
  101. }