55{
57 PBYTE SourceBits, DestBits, SourceLine, DestLine;
58 PBYTE SourceBitsT, SourceBitsB, DestBitsT, DestBitsB;
59 PBYTE SourceBits_4BPP, SourceLine_4BPP;
62 LONG DestWidth, DestHeight;
63 BOOLEAN bTopToBottom, bLeftToRight;
64 BOOLEAN blDeltaSrcNeg, blDeltaDestNeg;
66
67 DPRINT(
"DIB_32BPP_BitBltSrcCopy: SourcePoint (%d, %d), SourceSurface cx/cy (%d/%d), "
68 "DestSurface cx/cy (%d/%d) DestRect: (%d,%d)-(%d,%d)\n",
73
74 DPRINT(
"BltInfo->DestSurface->lDelta is '%d' and BltInfo->SourceSurface->lDelta is '%d'.\n",
76
79
80 DPRINT(
"BltInfo->SourcePoint.x is '%d' and BltInfo->SourcePoint.y is '%d'.\n",
82
83
87
88
91
92
94
95
97
98 DPRINT(
"bTopToBottom is '%d' and DestSurface->lDelta < 0 is '%d' and SourceSurface->lDelta < 0 is '%d'.\n",
100
101
103
106
110
112 DestWidth, DestHeight);
113
115 {
117 DPRINT(
"1BPP Case Selected with DestRect Width of '%d'.\n",
118 DestWidth);
119
120 if (bLeftToRight || bTopToBottom)
121 DPRINT(
"bLeftToRight is '%d' and bTopToBottom is '%d'.\n", bLeftToRight, bTopToBottom);
122
124
125
127
128 if (bTopToBottom)
129 {
130
132 }
133
134 for (
j=BltInfo->
DestRect.
top; j<BltInfo->DestRect.bottom;
j++)
135 {
137
138 if (bLeftToRight)
139 {
140
141 sx += (DestWidth - 1);
142 }
143
144 for (
i = BltInfo->
DestRect.
left; i < BltInfo->DestRect.right;
i++)
145 {
147 {
149 }
150 else
151 {
153 }
154
156 }
158 }
159 break;
160
162 DPRINT(
"4BPP Case Selected with DestRect Width of '%d'.\n",
163 DestWidth);
164
165 if (bLeftToRight || bTopToBottom)
166 DPRINT(
"bLeftToRight is '%d' and bTopToBottom is '%d'.\n", bLeftToRight, bTopToBottom);
167
168
172
173 if (bTopToBottom)
174 {
175
177 }
178
179 for (
j=BltInfo->
DestRect.
top; j<BltInfo->DestRect.bottom;
j++)
180 {
181 SourceLine_4BPP = SourceBits_4BPP;
183
184 if (bLeftToRight)
185 {
186
187 sx += (DestWidth - 1);
188 }
189
191
193 {
200 } else {
202 }
204 }
206 }
207 break;
208
210 DPRINT(
"8BPP Case Selected with DestRect Width of '%d'.\n",
211 DestWidth);
212
213 if (bLeftToRight || bTopToBottom)
214 DPRINT(
"bLeftToRight is '%d' and bTopToBottom is '%d'.\n", bLeftToRight, bTopToBottom);
215
216
220 DestLine = DestBits;
221
222 if (bTopToBottom)
223 {
224
226 }
227
228 for (
j = BltInfo->
DestRect.
top; j < BltInfo->DestRect.bottom;
j++)
229 {
230 SourceBits = SourceLine;
231 DestBits = DestLine;
232
233 if (bLeftToRight)
234 {
235
236 SourceBits += (DestWidth - 1);
237 }
238
239 for (
i = BltInfo->
DestRect.
left; i < BltInfo->DestRect.right;
i++)
240 {
241 xColor = *SourceBits;
244 DestBits += 4;
245 }
248 }
249 break;
250
252 DPRINT(
"16BPP Case Selected with DestRect Width of '%d'.\n",
253 DestWidth);
254
255 if (bLeftToRight || bTopToBottom)
256 DPRINT(
"bLeftToRight is '%d' and bTopToBottom is '%d'.\n", bLeftToRight, bTopToBottom);
257
258
262 DestLine = DestBits;
263
264 if (bTopToBottom)
265 {
266
268 }
269
270 for (
j = BltInfo->
DestRect.
top; j < BltInfo->DestRect.bottom;
j++)
271 {
272 SourceBits = SourceLine;
273 DestBits = DestLine;
274
275 if (bLeftToRight)
276 {
277
278 SourceBits += (DestWidth - 1) * 2;
279 }
280
281 for (
i = BltInfo->
DestRect.
left; i < BltInfo->DestRect.right;
i++)
282 {
283 xColor = *((
PWORD) SourceBits);
286 DestBits += 4;
287 }
288
291 }
292 break;
293
295 DPRINT(
"24BPP Case Selected with DestRect Width of '%d'.\n",
296 DestWidth);
297
298 if (bLeftToRight || bTopToBottom)
299 DPRINT(
"bLeftToRight is '%d' and bTopToBottom is '%d'.\n", bLeftToRight, bTopToBottom);
300
301
305
306 if (bTopToBottom)
307 {
308
310 }
311
312 DestLine = DestBits;
313
314 for (
j = BltInfo->
DestRect.
top; j < BltInfo->DestRect.bottom;
j++)
315 {
316 SourceBits = SourceLine;
317 DestBits = DestLine;
318
319 if (bLeftToRight)
320 {
321
322 SourceBits += (DestWidth - 1) * 3;
323 }
324
325 for (
i = BltInfo->
DestRect.
left; i < BltInfo->DestRect.right;
i++)
326 {
327 xColor = (*(SourceBits + 2) << 0x10) +
328 (*(SourceBits + 1) << 0x08) +
329 (*(SourceBits));
332 DestBits += 4;
333 }
334
337 }
338 break;
339
341 DPRINT(
"32BPP Case Selected with SourcePoint (%d,%d) and DestRect Width/height of '%d/%d' DestRect: (%d,%d)-(%d,%d).\n",
344
345 if (bLeftToRight || bTopToBottom)
346 DPRINT(
"bLeftToRight is '%d' and bTopToBottom is '%d'.\n", bLeftToRight, bTopToBottom);
347
348
349 if (((blDeltaSrcNeg || blDeltaDestNeg) && !(blDeltaSrcNeg && blDeltaDestNeg)) && bTopToBottom)
350 {
351 DPRINT(
"Adjusting for lDelta's here.\n");
353 {
354
358 for (
j = BltInfo->
DestRect.
top; j < BltInfo->DestRect.bottom;
j++)
359 {
363 }
364 }
365 else
366 {
367
371
376 {
380 }
381 }
382 blDeltaAdjustDone =
TRUE;
383 }
384
385
386
387
390 (!bTopToBottom && !bLeftToRight))
391 {
392 DPRINT(
"XO_TRIVIAL is TRUE.\n");
393
395 {
396
400 for (
j = BltInfo->
DestRect.
top; j < BltInfo->DestRect.bottom;
j++)
401 {
405 }
406 }
407 else
408 {
409
414
419 {
423 }
424 }
425 }
426 else
427 {
428 DPRINT(
"XO_TRIVIAL is NOT TRUE.\n");
429
430 if (!bTopToBottom && !bLeftToRight)
431 {
433 {
437 for (
j = BltInfo->
DestRect.
top; j < BltInfo->DestRect.bottom;
j++)
438 {
440 {
441 Dest32 = (
DWORD *) DestBits;
442 Source32 = (
DWORD *) SourceBits;
443 for (
i = BltInfo->
DestRect.
left; i < BltInfo->DestRect.right;
i++)
444 {
446 }
447 }
448 else
449 {
450 Dest32 = (
DWORD *) DestBits + (DestWidth - 1);
451 Source32 = (
DWORD *) SourceBits + (DestWidth - 1);
453 {
455 }
456 }
459 }
460 }
461 else
462 {
471 {
473 {
474 Dest32 = (
DWORD *) DestBits;
475 Source32 = (
DWORD *) SourceBits;
476 for (
i = BltInfo->
DestRect.
left; i < BltInfo->DestRect.right;
i++)
477 {
479 }
480 }
481 else
482 {
483 Dest32 = (
DWORD *) DestBits + (DestWidth - 1);
484 Source32 = (
DWORD *) SourceBits + (DestWidth - 1);
486 {
488 }
489 }
492 }
493 }
494 }
495 else
496 {
497
499
500
501 if ((bLeftToRight) && (DestWidth > 1))
502 {
503 DPRINT(
"Flip is bLeftToRight.\n");
504
505
509 {
510 DPRINT1(
"Storage Allocation Failed.\n");
512 }
513
514
518
519
523
525 {
526
527
528 Dest32 = (
DWORD *) DestBits + (DestWidth - 1);
529 Source32 = (
DWORD *) SourceBits;
530
532
533
535 {
536 store[
Index] = *Source32++;
538 }
539
541
542
544 {
545 *Dest32-- = store[
Index];
547 }
550 }
552 TopToBottomDone =
TRUE;
553 }
554
555
556 if ((bTopToBottom) && (DestHeight > 1))
557 {
558
559
560
561
562
563 DPRINT(
"Flip is bTopToBottom.\n");
564
565
569 {
570 DPRINT1(
"Storage Allocation Failed.\n");
572 }
573
574
578
579
583
584
585
586
587
588
589
590
591
592 if (TopToBottomDone || blDeltaAdjustDone)
593 {
594
595 SourceBitsB = DestBitsB;
596
597
598 SourceBitsT = DestBitsT;
599 }
600 else
601 {
602
606
607
610 }
611
612
613
614
615
619 {
620 DPRINT(
"Flips Need Adjustments, so do move here.\n");
621
623 {
624
628 for (
j = BltInfo->
DestRect.
top; j < BltInfo->DestRect.bottom;
j++)
629 {
633 }
634 }
635 else
636 {
637
642
647 {
651 }
652 }
653
654
655 SourceBitsB = DestBitsB;
656
657
658 SourceBitsT = DestBitsT;
659 }
660
661
662 for (
j = 0;
j < DestHeight / 2 ;
j++)
663 {
664
666
667
669
670
672
673
676
679 }
680 if (DestHeight % 2)
681 {
682
683 DPRINT(
"Handling Top To Bottom with Odd Number of lines.\n");
685 }
687 }
688 }
689 }
690 break;
691
692 default:
695 }
696
698}
#define DEC_OR_INC(var, decTrue, amount)
VOID DIB_32BPP_PutPixel(SURFOBJ *SurfObj, LONG x, LONG y, ULONG c)
#define ExAllocatePoolWithTag(hernya, size, tag)
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
#define ExFreePoolWithTag(_P, _T)
XLATEOBJ * XlateSourceToDest
#define RtlMoveMemory(Destination, Source, Length)
_In_ WDFCOLLECTION _In_ ULONG Index
unsigned char altnotmask[2]
ULONG DIB_1BPP_GetPixel(SURFOBJ *, LONG, LONG)
VOID FASTCALL RECTL_vMakeWellOrdered(_Inout_ RECTL *prcl)
ENGAPI ULONG APIENTRY XLATEOBJ_iXlate(_In_ XLATEOBJ *pxlo, _In_ ULONG iColor)