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.

141 lines
3.6 KiB

  1. /******************************Module*Header*******************************\
  2. *
  3. * Module Name: brush.h
  4. *
  5. * contains prototypes for the brush cache.
  6. *
  7. * Copyright (c) 1997 Cirrus Logic, Inc.
  8. *
  9. * $Log: X:/log/laguna/nt35/displays/cl546x/brush.h $
  10. *
  11. * Rev 1.2 26 Feb 1997 10:44:10 noelv
  12. *
  13. * Fixed structure packing.
  14. *
  15. * Rev 1.1 19 Feb 1997 13:06:40 noelv
  16. * Added vInvalidateBrushCache()
  17. *
  18. * Rev 1.0 06 Feb 1997 10:34:00 noelv
  19. * Initial revision.
  20. *
  21. \**************************************************************************/
  22. #include "memmgr.h"
  23. #ifndef _BRUSH_H_
  24. #define _BRUSH_H_
  25. //
  26. // Brush Structures
  27. // See BRUSH.C for comments about how brushes are realized and cached.
  28. // Prototypes for brush handling functions are later on in this file.
  29. //
  30. /*
  31. * Be sure to synchronize these structures with those in i386\Laguna.inc!
  32. */
  33. #pragma pack(1)
  34. // A realized brush. The brush must be cached before it is used.
  35. typedef struct {
  36. ULONG nPatSize;
  37. ULONG iBitmapFormat;
  38. ULONG ulForeColor;
  39. ULONG ulBackColor;
  40. ULONG iType; // brush type
  41. ULONG iUniq; // unique value for brush
  42. ULONG cache_slot; // Slot number of cache table entry.
  43. ULONG cache_xy;
  44. ULONG cjMask; // offset to mask bits in ajPattern[]
  45. BYTE ajPattern[0]; // pattern bits followed by mask bits
  46. } RBRUSH, *PRBRUSH;
  47. #define BRUSH_MONO 1
  48. #define BRUSH_4BPP 2
  49. #define BRUSH_DITHER 3
  50. #define BRUSH_COLOR 4
  51. // An entry in the Brush caching table.
  52. typedef struct {
  53. ULONG xy;
  54. PBYTE pjLinear;
  55. VOID *brushID; // Address of realized brush structure if this
  56. // cache entry is used. For verifying that a cache
  57. // entry is still valid.
  58. } BC_ENTRY;
  59. #define XLATE_PATSIZE 32 // 8*8 16-color pattern
  60. #define XLATE_COLORS 16 // 8*8 16-color pattern
  61. // An entry in the mono cache table.
  62. typedef struct
  63. {
  64. ULONG xy; // x,y location of brush
  65. PBYTE pjLinear; // linear address of brush
  66. ULONG iUniq; // unique value for brush
  67. BYTE ajPattern[8]; // 8x8 monochrome pattern
  68. } MC_ENTRY;
  69. // An entry in the 4-bpp caching table.
  70. typedef struct
  71. {
  72. ULONG xy; // x,y location of brush
  73. PBYTE pjLinear; // linear address of brush
  74. ULONG iUniq; // unique value for brush
  75. BYTE ajPattern[XLATE_PATSIZE]; // 8x8 16-color pattern
  76. ULONG ajPalette[XLATE_COLORS]; // 16-color palette
  77. } XC_ENTRY;
  78. // An entry in the dither cache table.
  79. typedef struct
  80. {
  81. ULONG xy; // x,y location of brush
  82. PBYTE pjLinear; // linear address of brush
  83. ULONG ulColor; // logical color of brush
  84. } DC_ENTRY;
  85. // Define the number of brushes to cache.
  86. #define NUM_MONO_BRUSHES 32 // 2 lines
  87. #define NUM_4BPP_BRUSHES 8 // 4, 8, or 16 lines
  88. #define NUM_DITHER_BRUSHES 8 // 4 lines
  89. #define NUM_COLOR_BRUSHES 32 // 16 lines
  90. #define NUM_SOLID_BRUSHES 4 // 8 lines
  91. #define NUM_8BPP_BRUSHES (NUM_COLOR_BRUSHES)
  92. #define NUM_16BPP_BRUSHES (NUM_COLOR_BRUSHES/2)
  93. #define NUM_TC_BRUSHES (NUM_COLOR_BRUSHES/4)
  94. //
  95. // Brush routines.
  96. //
  97. void vInitBrushCache(
  98. struct _PDEV *ppdev);
  99. void vInvalidateBrushCache(
  100. struct _PDEV *ppdev);
  101. ULONG ExpandColor(
  102. ULONG iSolidColor,
  103. ULONG ulBitCount);
  104. BOOL SetBrush(
  105. struct _PDEV *ppdev,
  106. ULONG *bltdef,
  107. BRUSHOBJ* pbo,
  108. POINTL* pptlBrush);
  109. BOOL CacheBrush(
  110. struct _PDEV *ppdev,
  111. PRBRUSH pRbrush);
  112. VOID vDitherColor(ULONG rgb, ULONG *pul);
  113. // restore default structure alignment
  114. #pragma pack()
  115. #endif // _BRUSH_H_