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.

72 lines
1.7 KiB

  1. /******************************Module*Header*******************************\
  2. * Module Name: paint.c
  3. *
  4. * Copyright (c) 1992 Microsoft Corporation
  5. \**************************************************************************/
  6. #include "driver.h"
  7. /******************************Public*Data*********************************\
  8. * MIX translation table
  9. *
  10. * Translates a mix 1-16, into an old style Rop 0-255.
  11. *
  12. \**************************************************************************/
  13. BYTE gaMix[] =
  14. {
  15. 0xFF, // R2_WHITE - Allow rop = gaMix[mix & 0x0F]
  16. 0x00, // R2_BLACK
  17. 0x05, // R2_NOTMERGEPEN
  18. 0x0A, // R2_MASKNOTPEN
  19. 0x0F, // R2_NOTCOPYPEN
  20. 0x50, // R2_MASKPENNOT
  21. 0x55, // R2_NOT
  22. 0x5A, // R2_XORPEN
  23. 0x5F, // R2_NOTMASKPEN
  24. 0xA0, // R2_MASKPEN
  25. 0xA5, // R2_NOTXORPEN
  26. 0xAA, // R2_NOP
  27. 0xAF, // R2_MERGENOTPEN
  28. 0xF0, // R2_COPYPEN
  29. 0xF5, // R2_MERGEPENNOT
  30. 0xFA, // R2_MERGEPEN
  31. 0xFF // R2_WHITE
  32. };
  33. /**************************************************************************\
  34. * DrvPaint
  35. *
  36. * Paint the clipping region with the specified brush
  37. *
  38. \**************************************************************************/
  39. BOOL DrvPaint
  40. (
  41. SURFOBJ *pso,
  42. CLIPOBJ *pco,
  43. BRUSHOBJ *pbo,
  44. POINTL *pptlBrush,
  45. MIX mix
  46. )
  47. {
  48. ROP4 rop4;
  49. rop4 = (gaMix[(mix >> 8) & 0x0F]) << 8;
  50. rop4 |= ((ULONG) gaMix[mix & 0x0F]);
  51. return(DrvBitBlt(
  52. pso,
  53. (SURFOBJ *) NULL,
  54. (SURFOBJ *) NULL,
  55. pco,
  56. (XLATEOBJ *) NULL,
  57. &pco->rclBounds,
  58. (POINTL *) NULL,
  59. (POINTL *) NULL,
  60. pbo,
  61. pptlBrush,
  62. rop4));
  63. }
  64.