|
|
1.1 root 1: /******************************Module*Header*******************************\
2: * Module Name: paint.c
3: *
4: *
5: *
6: * Copyright (c) 1992 Microsoft Corporation
7: *
8: \**************************************************************************/
9:
10: #include "driver.h"
11:
12: /******************************Public*Data*********************************\
13: * MIX translation table
14: *
15: * Translates a mix 1-16, into an old style Rop 0-255.
16: *
17: \**************************************************************************/
18:
19: BYTE gaMix[] =
20: {
21: 0xFF, // R2_WHITE - Allow rop = gaMix[mix & 0x0F]
22: 0x00, // R2_BLACK
23: 0x05, // R2_NOTMERGEPEN
24: 0x0A, // R2_MASKNOTPEN
25: 0x0F, // R2_NOTCOPYPEN
26: 0x50, // R2_MASKPENNOT
27: 0x55, // R2_NOT
28: 0x5A, // R2_XORPEN
29: 0x5F, // R2_NOTMASKPEN
30: 0xA0, // R2_MASKPEN
31: 0xA5, // R2_NOTXORPEN
32: 0xAA, // R2_NOP
33: 0xAF, // R2_MERGENOTPEN
34: 0xF0, // R2_COPYPEN
35: 0xF5, // R2_MERGEPENNOT
36: 0xFA, // R2_MERGEPEN
37: 0xFF // R2_WHITE
38: };
39:
40: /*****************************************************************************
41: * DrvPaint -
42: ****************************************************************************/
43: BOOL DrvPaint(
44: SURFOBJ *pso,
45: CLIPOBJ *pco,
46: BRUSHOBJ *pbo,
47: POINTL *pptlBrushOrg,
48: MIX mix)
49: {
50: INT i;
51: ROP4 rop4;
52: BOOL bRet,
53: bMoreClips;
54:
55: PPDEV ppdev;
56: ENUMTRAPS8 traps8;
57: DDAENUM ddae;
58: LONG yRow;
59: RECTL rcl;
60: PULONG px;
61:
62: DISPDBG((3, "S3.DLL: DrvPaint - Entry\n"));
63:
64: ppdev = (PPDEV) pso->dhsurf;
65:
66: // Protect against a potentially NULL clip object.
67:
68: if (pco == NULL)
69: return FALSE;
70:
71: rop4 = (gaMix[(mix >> 8) & 0x0F]) << 8;
72: rop4 |= ((ULONG) gaMix[mix & 0x0F]);
73:
74: bRet = FALSE;
75:
76: switch (pco->iMode)
77: {
78: case TC_RECTANGLES:
79:
80: bRet = DrvBitBlt(pso,
81: (SURFOBJ *) NULL,
82: (SURFOBJ *) NULL,
83: pco,
84: (XLATEOBJ *) NULL,
85: &(pco->rclBounds),
86: (PPOINTL) NULL,
87: (PPOINTL) NULL,
88: pbo,
89: pptlBrushOrg,
90: rop4);
91: break;
92:
93: case TC_TRAPEZOIDS:
94:
95: // Enumerate all the trapezodial clip objects.
96:
97: CLIPOBJ_cEnumStart(pco, TRUE, CT_TRAPEZOIDS, CD_ANY, 8);
98:
99: do
100: {
101: bMoreClips = CLIPOBJ_bEnum(pco, sizeof(traps8), (PULONG) &traps8);
102:
103: for (i = 0; i < (INT) traps8.c; i++)
104: {
105: // Enumerate all the rectangles in this trapezoid.
106:
107: if (!(DDAOBJ_bEnum(ppdev->pdda, &(traps8.atrap[i]),
108: sizeof(ddae), (DDALIST *) &ddae,
109: JD_ENUM_TRAPEZOID)))
110: {
111: continue;
112: }
113:
114: do
115: {
116: px = (PULONG) (&ddae.axPairs[0]);
117:
118: for (yRow = ddae.yTop; yRow < ddae.yBottom; yRow++)
119: {
120: if (*px < *(px + 1))
121: {
122: rcl.top = yRow;
123: rcl.left = *px;
124: rcl.bottom = yRow + 1;
125: rcl.right = *(px + 1);
126:
127: bRet = DrvBitBlt(pso,
128: (SURFOBJ *) NULL,
129: (SURFOBJ *) NULL,
130: ppdev->pcoDefault,
131: (XLATEOBJ *) NULL,
132: &rcl,
133: (PPOINTL) NULL,
134: (PPOINTL) NULL,
135: pbo,
136: pptlBrushOrg,
137: rop4);
138: }
139: px += 2;
140: }
141: } while (DDAOBJ_bEnum(ppdev->pdda, NULL,
142: sizeof(ddae), (DDALIST *) &ddae,
143: JD_ENUM_TRAPEZOID));
144: }
145:
146: } while (bMoreClips);
147:
148: bRet = TRUE;
149: break;
150:
151: default:
152:
153: DISPDBG((0, "S3.DLL!DrvPaint - Unhandled TC_xxxx\n"));
154:
155: break;
156: }
157:
158: return (bRet);
159: }
160:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.