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.

61 lines
1.8 KiB

  1. /******************************Module*Header*******************************\
  2. * Module Name: paint.c
  3. *
  4. * Copyright (c) 1992-1995 Microsoft Corporation
  5. *
  6. \**************************************************************************/
  7. #include "precomp.h"
  8. /******************************Public*Data*********************************\
  9. * MIX translation table
  10. *
  11. * Translates a mix 1-16, into an old style Rop 0-255.
  12. *
  13. \**************************************************************************/
  14. BYTE gaMix[] =
  15. {
  16. 0xFF, // R2_WHITE - Allow rop = gaMix[mix & 0x0F]
  17. 0x00, // R2_BLACK
  18. 0x05, // R2_NOTMERGEPEN
  19. 0x0A, // R2_MASKNOTPEN
  20. 0x0F, // R2_NOTCOPYPEN
  21. 0x50, // R2_MASKPENNOT
  22. 0x55, // R2_NOT
  23. 0x5A, // R2_XORPEN
  24. 0x5F, // R2_NOTMASKPEN
  25. 0xA0, // R2_MASKPEN
  26. 0xA5, // R2_NOTXORPEN
  27. 0xAA, // R2_NOP
  28. 0xAF, // R2_MERGENOTPEN
  29. 0xF0, // R2_COPYPEN
  30. 0xF5, // R2_MERGEPENNOT
  31. 0xFA, // R2_MERGEPEN
  32. 0xFF // R2_WHITE - Allow rop = gaMix[mix & 0xFF]
  33. };
  34. /******************************Public*Routine******************************\
  35. * BOOL DrvPaint
  36. *
  37. \**************************************************************************/
  38. BOOL DrvPaint(
  39. SURFOBJ* pso,
  40. CLIPOBJ* pco,
  41. BRUSHOBJ* pbo,
  42. POINTL* pptlBrush,
  43. MIX mix)
  44. {
  45. ROP4 rop4;
  46. rop4 = ((MIX) gaMix[mix >> 8] << 8) | gaMix[mix & 0xf];
  47. // Since our DrvFillPath routine handles almost all fills, DrvPaint
  48. // won't get called all that much (mainly via PaintRgn, FillRgn, or
  49. // complex clipped polygons). As such, we save some code and simply
  50. // punt to DrvBitBlt:
  51. return(DrvBitBlt(pso, NULL, NULL, pco, NULL, &pco->rclBounds, NULL,
  52. NULL, pbo, pptlBrush, rop4));
  53. }