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.

219 lines
6.4 KiB

  1. /****************************************************************************/
  2. // nsbcdisp.h
  3. //
  4. // RDP Send Bitmap Cache display driver header.
  5. //
  6. // Copyright(c) Microsoft 1997-2000
  7. /****************************************************************************/
  8. #ifndef _H_NSBCDISP
  9. #define _H_NSBCDISP
  10. #include <nddapi.h>
  11. #include <asbcapi.h>
  12. #define GH_STATUS_SUCCESS 0
  13. #define GH_STATUS_NO_MEMORY 1
  14. #define GH_STATUS_CLIPPED 2
  15. #define SBC_NUM_BRUSH_CACHE_ENTRIES 64
  16. #define SBC_NUM_GLYPH_CACHE_ENTRIES 256
  17. /****************************************************************************/
  18. // Structure: SBC_COLOR_TABLE
  19. /****************************************************************************/
  20. typedef struct tagSBC_COLOR_TABLE
  21. {
  22. PALETTEENTRY color[SBC_NUM_8BPP_COLORS];
  23. } SBC_COLOR_TABLE, *PSBC_COLOR_TABLE;
  24. /****************************************************************************/
  25. // Structure: MEMBLT_ORDER_EXTRA_INFO
  26. //
  27. // Description: Extra information required by SBC to process a MEMBLT
  28. // order.
  29. /****************************************************************************/
  30. typedef struct
  31. {
  32. // MemBlt source and destination surfaces.
  33. SURFOBJ *pSource;
  34. SURFOBJ *pDest;
  35. // iUniq value from the device surface
  36. ULONG iDeviceUniq;
  37. // XLATEOBJ for the blt.
  38. XLATEOBJ *pXlateObj;
  39. // Tile size per side, in ID form (corresponding to a bitmap cache ID
  40. // and its protocol-defined cell size) and expanded form.
  41. unsigned TileID;
  42. unsigned TileSize;
  43. // Determines if special background screen bit construction is needed
  44. // before caching a bitmap.
  45. BOOLEAN bDeltaRLE;
  46. // Used under special conditions where we need to turn off fast-path
  47. // caching. Only use right now is when caching directly from the screen
  48. // bitmap.
  49. BOOLEAN bNoFastPathCaching;
  50. // Used during caching call chain to keep from attempting to re-cache
  51. // the same tile for each intersecting clip rect.
  52. unsigned CacheID;
  53. unsigned CacheIndex;
  54. #ifdef PERF_SPOILING
  55. // Used to tell the caching functions if the target for the current
  56. // operation is the screen. If it is the caching functions will force
  57. // waitlist orders to be sent as screen data.
  58. BOOL bIsPrimarySurface;
  59. #endif
  60. } MEMBLT_ORDER_EXTRA_INFO, *PMEMBLT_ORDER_EXTRA_INFO;
  61. /****************************************************************************/
  62. // Structure: SBC_FAST_PATH_INFO
  63. //
  64. // Description: Information used to create fast-path cache keys.
  65. /****************************************************************************/
  66. typedef struct tagSBC_FAST_PATH_INFO
  67. {
  68. HSURF hsurf;
  69. ULONG iUniq;
  70. ULONG iDeviceUniq;
  71. XLATEOBJ *pXlateObj;
  72. ULONG iUniqXlate;
  73. POINTL tileOrigin;
  74. unsigned TileSize;
  75. BOOL bDeltaRLE;
  76. } SBC_FAST_PATH_INFO, *PSBC_FAST_PATH_INFO;
  77. /****************************************************************************/
  78. // SBC_FRAG_INFO
  79. //
  80. // Glyph fragment info.
  81. /****************************************************************************/
  82. typedef struct tagSBC_FRAG_INFO
  83. {
  84. INT32 dx; // width of fragment background rect
  85. INT32 dy; // height of fragment background rect
  86. } SBC_FRAG_INFO, *PSBC_FRAG_INFO;
  87. /****************************************************************************/
  88. // SBC_OFFSCR_BITMAP_DELETE_INFO
  89. /****************************************************************************/
  90. typedef struct tagSBC_OFFSCR_BITMAP_DEL_INFO
  91. {
  92. unsigned bitmapId;
  93. unsigned bitmapSize;
  94. } SBC_OFFSCR_BITMAP_DEL_INFO, *PSBC_OFFSCR_BITMAP_DEL_INFO;
  95. /****************************************************************************/
  96. // Prototypes and inlines
  97. /****************************************************************************/
  98. void RDPCALL SBC_DDInit(PDD_PDEV);
  99. void RDPCALL SBC_InitShm(void);
  100. BOOLEAN RDPCALL SBCSelectGlyphCache(unsigned, PINT32);
  101. BOOLEAN __fastcall SBCBitmapCacheCallback(
  102. CHCACHEHANDLE hCache,
  103. unsigned Event,
  104. unsigned iCacheEntry,
  105. void *UserDefined);
  106. BOOLEAN __fastcall SBCFastPathCacheCallback(
  107. CHCACHEHANDLE hCache,
  108. unsigned event,
  109. unsigned iCacheEntry,
  110. void *UserDefined);
  111. BOOLEAN RDPCALL SBCCreateGlyphCache(
  112. unsigned cEntries,
  113. unsigned cbCellSize,
  114. PCHCACHEDATA pCacheHandle);
  115. BOOLEAN RDPCALL SBCCreateFragCache(
  116. unsigned cEntries,
  117. unsigned cbCellSize,
  118. PCHCACHEDATA pCacheHandle);
  119. BOOLEAN __fastcall SBCGlyphCallback(
  120. CHCACHEHANDLE hCache,
  121. unsigned event,
  122. unsigned iCacheEntry,
  123. void *UserDefined);
  124. BOOLEAN __fastcall SBCOffscreenCallback(
  125. CHCACHEHANDLE hCache,
  126. unsigned event,
  127. unsigned iCacheEntry,
  128. void *UserDefined);
  129. unsigned RDPCALL SBCSelectBitmapCache(unsigned, unsigned);
  130. unsigned SBC_DDQueryBitmapTileSize(unsigned, unsigned, PPOINTL, unsigned,
  131. unsigned);
  132. BOOLEAN RDPCALL SBCCacheBits(PDD_PDEV, BYTE *, unsigned, unsigned, unsigned,
  133. #ifdef PERF_SPOILING
  134. unsigned, unsigned, unsigned *, unsigned *, BOOL);
  135. #else
  136. unsigned, unsigned, unsigned *, unsigned *);
  137. #endif
  138. BOOLEAN RDPCALL SBC_SendCacheColorTableOrder(PDD_PDEV, unsigned *);
  139. BOOLEAN RDPCALL SBC_CacheBitmapTile(PDD_PDEV, PMEMBLT_ORDER_EXTRA_INFO,
  140. RECTL *, RECTL *);
  141. void RDPCALL SBC_Update(SBC_BITMAP_CACHE_KEY_INFO *);
  142. void RDPCALL SBC_DDSync(BOOLEAN bMustSync);
  143. unsigned RDPCALL SBCAllocGlyphCache(PCHCACHEHANDLE);
  144. unsigned RDPCALL SBCAllocBitmapCache(PCHCACHEHANDLE);
  145. void RDPCALL SBCFreeColorTableCacheData(void);
  146. void RDPCALL SBCFreeGlyphCacheData(void);
  147. void RDPCALL SBCFreeBitmapCacheData(void);
  148. void RDPCALL SBCFreeCacheData(void);
  149. UINT32 RDPCALL SBCDDGetTickCount(void);
  150. /****************************************************************************/
  151. // SBC_DDTerm
  152. /****************************************************************************/
  153. __inline void RDPCALL SBC_DDTerm(void)
  154. {
  155. SBCFreeCacheData();
  156. }
  157. /****************************************************************************/
  158. // SBC_DDDisc
  159. /****************************************************************************/
  160. __inline void RDPCALL SBC_DDDisc(void)
  161. {
  162. SBCFreeCacheData();
  163. }
  164. #endif /* _H_NSBCDISP */