23{
28
35
40
46
47 LONG PatternX = 0, PatternY = 0;
48
51 BOOLEAN bTopToBottom, bLeftToRight;
52
54
57
58 DPRINT(
"Dest BPP: %u, DestRect: (%d,%d)-(%d,%d)\n",
60
61 DstHeight = DestRect->
bottom - DestRect->
top;
62 DstWidth = DestRect->
right - DestRect->
left;
63 SrcHeight = SourceRect->
bottom - SourceRect->
top;
64 SrcWidth = SourceRect->
right - SourceRect->
left;
65
66
67 if (((SrcWidth < 0) && (DstWidth < 0)) || ((SrcWidth >= 0) && (DstWidth >= 0)))
69 else
71
72 if (((SrcHeight < 0) && (DstHeight < 0)) || ((SrcHeight >= 0) && (DstHeight >= 0)))
74 else
76
77
79
80 if (UsesSource)
81 {
84 DPRINT(
"Source BPP: %u, SourceRect: (%d,%d)-(%d,%d)\n",
86 }
87
88 if (MaskSurf)
89 {
90 DPRINT(
"MaskSurf is not NULL.\n");
93 }
94
95 DstHeight = DestRect->
bottom - DestRect->
top;
96 DstWidth = DestRect->
right - DestRect->
left;
97 SrcHeight = SourceRect->
bottom - SourceRect->
top;
98 SrcWidth = SourceRect->
right - SourceRect->
left;
99
100
101
103 {
104 case BMF_1BPP: xxBPPMask = 0x1;
break;
105 case BMF_4BPP: xxBPPMask = 0xF;
break;
106 case BMF_8BPP: xxBPPMask = 0xFF;
break;
107 case BMF_16BPP: xxBPPMask = 0xFFFF;
break;
108 case BMF_24BPP: xxBPPMask = 0xFFFFFF;
break;
109 default:
110 xxBPPMask = 0xFFFFFFFF;
111 }
112 DPRINT(
"xxBPPMask is 0x%x.\n", xxBPPMask);
113
114 if (UsesPattern)
115 {
116 DPRINT(
"UsesPattern is not NULL.\n");
117 if (PatternSurface)
118 {
119 PatternY = (DestRect->
top - BrushOrigin->
y) % PatternSurface->
sizlBitmap.
cy;
121 {
123 }
125 }
126 else
127 {
129 Pattern =
Brush->iSolidColor;
130 }
131 }
132
133 if (PatternSurface)
134 {
135 DPRINT(
"PatternSurface is not NULL.\n");
136 }
137
138 DPRINT(
"bLeftToRight is '%d' and bTopToBottom is '%d'.\n", bLeftToRight, bTopToBottom);
139
140 for (DesY = DestRect->
top; DesY < DestRect->
bottom; DesY++)
141 {
142 if (PatternSurface)
143 {
146 {
148 }
149 }
150 if (UsesSource)
151 {
152 if (bTopToBottom)
153 {
154 sy = SourceRect->
bottom-(DesY - DestRect->
top) * SrcHeight / DstHeight;
155 }
156 else
157 {
158 sy = SourceRect->
top+(DesY - DestRect->
top) * SrcHeight / DstHeight;
159 }
160 }
161
162 for (DesX = DestRect->
left; DesX < DestRect->
right; DesX++)
163 {
165
166 if (fnMask_GetPixel)
167 {
168 if (bLeftToRight)
169 {
170 sx = SourceRect->
right - (DesX - DestRect->
left) * SrcWidth / DstWidth;
171 }
172 else
173 {
174 sx = SourceRect->
left+(DesX - DestRect->
left) * SrcWidth / DstWidth;
175 }
176 if (sx < 0 || sy < 0 ||
178 fnMask_GetPixel(MaskSurf, sx, sy) != 0)
179 {
181 }
182 }
183
184 if (UsesSource && CanDraw)
185 {
186 if (bLeftToRight)
187 {
188 sx = SourceRect->
right-(DesX - DestRect->
left) * SrcWidth / DstWidth;
189 }
190 else
191 {
192 sx = SourceRect->
left + (DesX - DestRect->
left) * SrcWidth / DstWidth;
193 }
194 if (sx >= 0 && sy >= 0 &&
196 {
198 }
199 else
200 {
203 }
204 }
205
206 if (CanDraw)
207 {
208 if (UsesPattern && PatternSurface)
209 {
210 Pattern = fnPattern_GetPixel(PatternSurface, PatternX, PatternY);
211 PatternX++;
213 }
214
215 Dest = fnDest_GetPixel(DestSurf, DesX, DesY);
217
218 fnDest_PutPixel(DestSurf, DesX, DesY,
Color);
219 }
220 }
221
222 if (PatternSurface)
223 {
224 PatternY++;
226 }
227 }
228
230}
#define R3_OPINDEX_SRCCOPY
#define ROP4_USES_PATTERN(Rop4)
#define IS_VALID_ROP4(rop)
#define ROP4_USES_SOURCE(Rop4)
_In_ UINT _In_ UINT _In_ PNDIS_PACKET Source
PFN_DIB_PutPixel DIB_PutPixel
PFN_DIB_GetPixel DIB_GetPixel
ULONG DIB_DoRop(ULONG Rop, ULONG Dest, ULONG Source, ULONG Pattern)
DIB_FUNCTIONS DibFunctionsForBitmapFormat[]
ULONG(* PFN_DIB_GetPixel)(SURFOBJ *, LONG, LONG)
VOID(* PFN_DIB_PutPixel)(SURFOBJ *, LONG, LONG, ULONG)
#define BitsPerFormat(Format)
VOID FASTCALL RECTL_vMakeWellOrdered(_Inout_ RECTL *prcl)
ENGAPI ULONG APIENTRY XLATEOBJ_iXlate(_In_ XLATEOBJ *pxlo, _In_ ULONG iColor)