ReactOS 0.4.17-dev-470-gf9e3448
dib8bpp.c File Reference
#include <win32k.h>
#include <debug.h>
Include dependency graph for dib8bpp.c:

Go to the source code of this file.

Macros

#define NDEBUG
 
#define DEC_OR_INC(var, decTrue, amount)    ((var) = (decTrue) ? ((var) - (amount)) : ((var) + (amount)))
 

Functions

VOID DIB_8BPP_PutPixel (SURFOBJ *SurfObj, LONG x, LONG y, ULONG c)
 
ULONG DIB_8BPP_GetPixel (SURFOBJ *SurfObj, LONG x, LONG y)
 
VOID DIB_8BPP_HLine (SURFOBJ *SurfObj, LONG x1, LONG x2, LONG y, ULONG c)
 
VOID DIB_8BPP_VLine (SURFOBJ *SurfObj, LONG x, LONG y1, LONG y2, ULONG c)
 
BOOLEAN DIB_8BPP_BitBltSrcCopy (PBLTINFO BltInfo)
 
BOOLEAN DIB_8BPP_ColorFill (SURFOBJ *DestSurface, RECTL *DestRect, ULONG color)
 
BOOLEAN DIB_8BPP_TransparentBlt (SURFOBJ *DestSurf, SURFOBJ *SourceSurf, RECTL *DestRect, RECTL *SourceRect, XLATEOBJ *ColorTranslation, ULONG iTransColor)
 

Macro Definition Documentation

◆ DEC_OR_INC

#define DEC_OR_INC (   var,
  decTrue,
  amount 
)     ((var) = (decTrue) ? ((var) - (amount)) : ((var) + (amount)))

Definition at line 17 of file dib8bpp.c.

◆ NDEBUG

#define NDEBUG

Definition at line 14 of file dib8bpp.c.

Function Documentation

◆ DIB_8BPP_BitBltSrcCopy()

BOOLEAN DIB_8BPP_BitBltSrcCopy ( PBLTINFO  BltInfo)

Definition at line 62 of file dib8bpp.c.

63{
64 LONG i, j, sx, sy, xColor, f1;
65 PBYTE SourceBits, DestBits, SourceLine, DestLine;
66 PBYTE SourceBits_4BPP, SourceLine_4BPP;
67 BOOLEAN bTopToBottom, bLeftToRight;
68
69 DPRINT("DIB_8BPP_BitBltSrcCopy: SrcSurf cx/cy (%d/%d), DestSuft cx/cy (%d/%d) dstRect: (%d,%d)-(%d,%d)\n",
71 BltInfo->DestSurface->sizlBitmap.cx, BltInfo->DestSurface->sizlBitmap.cy,
72 BltInfo->DestRect.left, BltInfo->DestRect.top, BltInfo->DestRect.right, BltInfo->DestRect.bottom);
73
74 /* Get back left to right flip here */
75 bLeftToRight = (BltInfo->DestRect.left > BltInfo->DestRect.right);
76
77 /* Check for top to bottom flip needed. */
78 bTopToBottom = BltInfo->DestRect.top > BltInfo->DestRect.bottom;
79
80 DPRINT("bTopToBottom is '%d' and bLeftToRight is '%d'.\n", bTopToBottom, bLeftToRight);
81
82 /* Make WellOrdered by making top < bottom and left < right */
84
85 DPRINT("BPP is '%d' & BltInfo->SourcePoint.x is '%d' & BltInfo->SourcePoint.y is '%d'.\n",
86 BltInfo->SourceSurface->iBitmapFormat, BltInfo->SourcePoint.x, BltInfo->SourcePoint.y);
87
88 DestBits = (PBYTE)BltInfo->DestSurface->pvScan0 + (BltInfo->DestRect.top * BltInfo->DestSurface->lDelta) + BltInfo->DestRect.left;
89
90 switch(BltInfo->SourceSurface->iBitmapFormat)
91 {
92 case BMF_1BPP:
93 DPRINT("1BPP Case Selected with DestRect Width of '%d'.\n",
94 BltInfo->DestRect.right - BltInfo->DestRect.left);
95
96 sx = BltInfo->SourcePoint.x;
97
98 /* This sets sy to the top line */
99 sy = BltInfo->SourcePoint.y;
100
101 if (bTopToBottom)
102 {
103 /* This sets sy to the bottom line */
104 sy += BltInfo->DestRect.bottom - BltInfo->DestRect.top - 1;
105 }
106
107 for (j=BltInfo->DestRect.top; j<BltInfo->DestRect.bottom; j++)
108 {
109 sx = BltInfo->SourcePoint.x;
110
111 if (bLeftToRight)
112 {
113 /* This sets the sx to the rightmost pixel */
114 sx += (BltInfo->DestRect.right - BltInfo->DestRect.left - 1);
115 }
116
117 for (i=BltInfo->DestRect.left; i<BltInfo->DestRect.right; i++)
118 {
119 if(DIB_1BPP_GetPixel(BltInfo->SourceSurface, sx, sy) == 0)
120 {
122 }
123 else
124 {
126 }
127 DEC_OR_INC(sx, bLeftToRight, 1);
128 }
129 DEC_OR_INC(sy, bTopToBottom, 1);
130 }
131 break;
132
133 case BMF_4BPP:
134 DPRINT("4BPP Case Selected with DestRect Width of '%d'.\n",
135 BltInfo->DestRect.right - BltInfo->DestRect.left);
136
137 /* This sets SourceBits_4BPP to the top line */
138 SourceBits_4BPP = (PBYTE)BltInfo->SourceSurface->pvScan0 + (BltInfo->SourcePoint.y * BltInfo->SourceSurface->lDelta) + (BltInfo->SourcePoint.x >> 1);
139
140 if (bTopToBottom)
141 {
142 /* This sets SourceBits_4BPP to the bottom line */
143 SourceBits_4BPP += (BltInfo->DestRect.bottom - BltInfo->DestRect.top - 1) * BltInfo->SourceSurface->lDelta;
144 }
145
146 for (j=BltInfo->DestRect.top; j<BltInfo->DestRect.bottom; j++)
147 {
148 SourceLine_4BPP = SourceBits_4BPP;
149 sx = BltInfo->SourcePoint.x;
150
151 if (bLeftToRight)
152 {
153 /* This sets sx to the rightmost pixel */
154 sx += (BltInfo->DestRect.right - BltInfo->DestRect.left - 1);
155 }
156
157 f1 = sx & 1;
158
159 for (i=BltInfo->DestRect.left; i<BltInfo->DestRect.right; i++)
160 {
161 xColor = XLATEOBJ_iXlate(BltInfo->XlateSourceToDest,
162 (*SourceLine_4BPP & altnotmask[f1]) >> (4 * (1 - f1)));
163 DIB_8BPP_PutPixel(BltInfo->DestSurface, i, j, xColor);
164 if(f1 == 1)
165 {
166 DEC_OR_INC(SourceLine_4BPP, bLeftToRight, 1);
167 f1 = 0;
168 }
169 else
170 {
171 f1 = 1;
172 }
173
174 DEC_OR_INC(sx, bLeftToRight, 1);
175 }
176 DEC_OR_INC(SourceBits_4BPP, bTopToBottom, BltInfo->SourceSurface->lDelta);
177 }
178 break;
179
180 case BMF_8BPP:
181 DPRINT("8BPP-dstRect: (%d,%d)-(%d,%d) and Width of '%d'.\n",
182 BltInfo->DestRect.left, BltInfo->DestRect.top,
183 BltInfo->DestRect.right, BltInfo->DestRect.bottom,
184 BltInfo->DestRect.right - BltInfo->DestRect.left);
185
186 if ((BltInfo->XlateSourceToDest == NULL ||
187 (BltInfo->XlateSourceToDest->flXlate & XO_TRIVIAL) != 0) &&
188 (!bTopToBottom && !bLeftToRight))
189 {
190 if (BltInfo->DestRect.top < BltInfo->SourcePoint.y)
191 {
192 DPRINT("BltInfo->DestRect.top < BltInfo->SourcePoint.y.\n");
193 SourceBits = (PBYTE)BltInfo->SourceSurface->pvScan0 + (BltInfo->SourcePoint.y * BltInfo->SourceSurface->lDelta) + BltInfo->SourcePoint.x;
194 for (j = BltInfo->DestRect.top; j < BltInfo->DestRect.bottom; j++)
195 {
196 RtlMoveMemory(DestBits, SourceBits, BltInfo->DestRect.right - BltInfo->DestRect.left);
197 SourceBits += BltInfo->SourceSurface->lDelta;
198 DestBits += BltInfo->DestSurface->lDelta;
199 }
200 }
201 else
202 {
203 DPRINT("BltInfo->DestRect.top >= BltInfo->SourcePoint.y.\n");
204 SourceBits = (PBYTE)BltInfo->SourceSurface->pvScan0 + ((BltInfo->SourcePoint.y + BltInfo->DestRect.bottom - BltInfo->DestRect.top - 1) * BltInfo->SourceSurface->lDelta) + BltInfo->SourcePoint.x;
205 DestBits = (PBYTE)BltInfo->DestSurface->pvScan0 + ((BltInfo->DestRect.bottom - 1) * BltInfo->DestSurface->lDelta) + BltInfo->DestRect.left;
206 for (j = BltInfo->DestRect.bottom - 1; BltInfo->DestRect.top <= j; j--)
207 {
208 RtlMoveMemory(DestBits, SourceBits, BltInfo->DestRect.right - BltInfo->DestRect.left);
209 SourceBits -= BltInfo->SourceSurface->lDelta;
210 DestBits -= BltInfo->DestSurface->lDelta;
211 }
212 }
213 }
214 else
215 {
216 DPRINT("XO_TRIVIAL is NOT TRUE or we have flips.\n");
217
218 if (!bTopToBottom && !bLeftToRight)
219 /* **Note: Indent is purposefully less than desired to keep reviewable differences to a minimum for PR** */
220 {
221 if (BltInfo->DestRect.top < BltInfo->SourcePoint.y)
222 {
223 DPRINT("Dest.top < SourcePoint.y.\n");
224 SourceLine = (PBYTE)BltInfo->SourceSurface->pvScan0 + (BltInfo->SourcePoint.y * BltInfo->SourceSurface->lDelta) + BltInfo->SourcePoint.x;
225 DestLine = DestBits;
226 for (j = BltInfo->DestRect.top; j < BltInfo->DestRect.bottom; j++)
227 {
228 SourceBits = SourceLine;
229 DestBits = DestLine;
230 for (i=BltInfo->DestRect.left; i<BltInfo->DestRect.right; i++)
231 {
232 *DestBits++ = (BYTE)XLATEOBJ_iXlate(BltInfo->XlateSourceToDest, *SourceBits++);
233 }
234 SourceLine += BltInfo->SourceSurface->lDelta;
235 DestLine += BltInfo->DestSurface->lDelta;
236 }
237 }
238 else
239 {
240 DPRINT("Dest.top >= SourcePoint.y.\n");
241 SourceLine = (PBYTE)BltInfo->SourceSurface->pvScan0 + ((BltInfo->SourcePoint.y + BltInfo->DestRect.bottom - BltInfo->DestRect.top - 1) * BltInfo->SourceSurface->lDelta) + BltInfo->SourcePoint.x;
242 DestLine = (PBYTE)BltInfo->DestSurface->pvScan0 + ((BltInfo->DestRect.bottom - 1) * BltInfo->DestSurface->lDelta) + BltInfo->DestRect.left;
243 for (j = BltInfo->DestRect.bottom - 1; BltInfo->DestRect.top <= j; j--)
244 {
245 SourceBits = SourceLine;
246 DestBits = DestLine;
247 for (i=BltInfo->DestRect.left; i<BltInfo->DestRect.right; i++)
248 {
249 *DestBits++ = (BYTE)XLATEOBJ_iXlate(BltInfo->XlateSourceToDest, *SourceBits++);
250 }
251 SourceLine -= BltInfo->SourceSurface->lDelta;
252 DestLine -= BltInfo->DestSurface->lDelta;
253 }
254 }
255 }
256 else
257 {
258 /* Buffering for source and destination flip overlaps. Fixes KHMZ MirrorTest CORE-16642 */
259 BOOL OneDone = FALSE;
260
261 if (bLeftToRight)
262 {
263 DPRINT("Flip is bLeftToRight.\n");
264
265 /* Allocate enough pixels for a row in BYTE's */
267 BltInfo->DestRect.right - BltInfo->DestRect.left + 1, TAG_DIB);
268 if (store == NULL)
269 {
270 DPRINT1("Storage Allocation Failed.\n");
271 return FALSE;
272 }
273 WORD Index;
274
275 /* This sets SourceLine to the top line */
276 SourceLine = (PBYTE)BltInfo->SourceSurface->pvScan0 +
277 (BltInfo->SourcePoint.y *
278 BltInfo->SourceSurface->lDelta) +
279 BltInfo->SourcePoint.x;
280
281 /* This set the DestLine to the top line */
282 DestLine = (PBYTE)BltInfo->DestSurface->pvScan0 +
283 (BltInfo->DestRect.top * BltInfo->DestSurface->lDelta) +
284 BltInfo->DestRect.left;
285
286 for (j = BltInfo->DestRect.top; j < BltInfo->DestRect.bottom; j++)
287 {
288 SourceBits = SourceLine;
289 DestBits = DestLine;
290
291 /* This sets SourceBits to the rightmost pixel */
292 SourceBits += (BltInfo->DestRect.right - BltInfo->DestRect.left - 1);
293
294 Index = 0;
295
296 for (i = BltInfo->DestRect.left; i < BltInfo->DestRect.right; i++)
297 {
298 store[Index] = (BYTE)XLATEOBJ_iXlate(
299 BltInfo->XlateSourceToDest,
300 *SourceBits);
301 SourceBits--;
302 Index++;
303 }
304
305 Index = 0;
306
307 for (i = BltInfo->DestRect.left; i < BltInfo->DestRect.right; i++)
308 {
309 *DestBits = store[Index];
310 DestBits++;
311 Index++;
312 }
313
314 SourceLine += BltInfo->SourceSurface->lDelta;
315 DestLine += BltInfo->DestSurface->lDelta;
316 }
318 OneDone = TRUE;
319 }
320
321 if (bTopToBottom)
322 {
323 DPRINT("Flip is bTopToBottom.\n");
324
325 DWORD Index;
326 LONG SrcDelta;
327
328 /* Allocate enough pixels for a column in BYTE's */
330 BltInfo->DestRect.bottom - BltInfo->DestRect.top + 1, TAG_DIB);
331 if (store == NULL)
332 {
333 DPRINT1("Storage Allocation Failed.\n");
334 return FALSE;
335 }
336
337 /* The OneDone flag indicates that we are flipping for bTopToBottom and bLeftToRight
338 * and have already completed the bLeftToRight. So we will lose our first flip output
339 * unless we work with its output which is at the destination site. So in this case
340 * our new Source becomes the previous outputs Destination. */
341
342 if (OneDone)
343 {
344 /* This sets SourceLine to the bottom line of our previous destination */
345 SourceLine = (PBYTE)BltInfo->DestSurface->pvScan0 +
346 (BltInfo->DestRect.top * BltInfo->DestSurface->lDelta) + BltInfo->DestRect.left +
347 (BltInfo->DestRect.bottom - BltInfo->DestRect.top - 1) * BltInfo->DestSurface->lDelta;
348 SrcDelta = BltInfo->DestSurface->lDelta;
349 }
350 else
351 {
352 /* This sets SourceLine to the bottom line */
353 SourceLine = (PBYTE)BltInfo->SourceSurface->pvScan0 +
354 ((BltInfo->SourcePoint.y + BltInfo->DestRect.bottom - BltInfo->DestRect.top - 1)
355 * BltInfo->SourceSurface->lDelta) +
356 BltInfo->SourcePoint.x;
357 SrcDelta = BltInfo->SourceSurface->lDelta;
358 }
359
360 /* This set the DestLine to the top line */
361 DestLine = (PBYTE)BltInfo->DestSurface->pvScan0 +
362 (BltInfo->DestRect.top * BltInfo->DestSurface->lDelta) +
363 BltInfo->DestRect.left;
364
365 /* Read columns */
366 for (i = BltInfo->DestRect.left; i < BltInfo->DestRect.right; i++)
367 {
368
369 DestBits = DestLine;
370 SourceBits = SourceLine;
371
372 Index = 0;
373
374 /* Read up the column and store the pixels */
375 for (j = BltInfo->DestRect.top; j < BltInfo->DestRect.bottom; j++)
376 {
377 store[Index] = OneDone ? *SourceBits : (BYTE)XLATEOBJ_iXlate(BltInfo->XlateSourceToDest, *SourceBits);
378 /* Go up a line */
379 SourceBits -= SrcDelta;
380 Index++;
381 }
382
383 Index = 0;
384
385 /* Get the stored pixel and copy then down the column */
386 for (j = BltInfo->DestRect.top; j < BltInfo->DestRect.bottom; j++)
387 {
388 *DestBits = store[Index];
389 /* Go down a line */
390 DestBits += BltInfo->DestSurface->lDelta;
391 Index++;
392 }
393 /* Index to next column */
394 SourceLine += 1;
395 DestLine += 1;
396 }
398 }
399
400 }
401 }
402 break;
403
404 case BMF_16BPP:
405 DPRINT("16BPP Case Selected with DestRect Width of '%d'.\n",
406 BltInfo->DestRect.right - BltInfo->DestRect.left);
407
408 DPRINT("BMF_16BPP-dstRect: (%d,%d)-(%d,%d) and Width of '%d'.\n",
409 BltInfo->DestRect.left, BltInfo->DestRect.top,
410 BltInfo->DestRect.right, BltInfo->DestRect.bottom,
411 BltInfo->DestRect.right - BltInfo->DestRect.left);
412
413 SourceLine = (PBYTE)BltInfo->SourceSurface->pvScan0 + (BltInfo->SourcePoint.y * BltInfo->SourceSurface->lDelta) + 2 * BltInfo->SourcePoint.x;
414
415 if (bTopToBottom)
416 {
417 /* This sets SourceLine to the bottom line */
418 SourceLine += (BltInfo->DestRect.bottom - BltInfo->DestRect.top - 1) * BltInfo->SourceSurface->lDelta;;
419 }
420 DestLine = DestBits;
421
422 for (j = BltInfo->DestRect.top; j < BltInfo->DestRect.bottom; j++)
423 {
424 SourceBits = SourceLine;
425
426 if (bLeftToRight)
427 {
428 /* This sets SourceBits to the rightmost pixel */
429 SourceBits += (BltInfo->DestRect.right - BltInfo->DestRect.left - 1) * 2;
430 }
431 DestBits = DestLine;
432
433 for (i = BltInfo->DestRect.left; i < BltInfo->DestRect.right; i++)
434 {
435 xColor = *((PWORD) SourceBits);
436 *DestBits = (BYTE)XLATEOBJ_iXlate(BltInfo->XlateSourceToDest, xColor);
437
438 DEC_OR_INC(SourceBits, bLeftToRight, 2);
439 DestBits += 1;
440 }
441 DEC_OR_INC(SourceLine, bTopToBottom, BltInfo->SourceSurface->lDelta);
442 DestLine += BltInfo->DestSurface->lDelta;
443 }
444 break;
445
446 case BMF_24BPP:
447 DPRINT("24BPP-dstRect: (%d,%d)-(%d,%d) and Width of '%d'.\n",
448 BltInfo->DestRect.left, BltInfo->DestRect.top,
449 BltInfo->DestRect.right, BltInfo->DestRect.bottom,
450 BltInfo->DestRect.right - BltInfo->DestRect.left);
451
452 SourceLine = (PBYTE)BltInfo->SourceSurface->pvScan0 + (BltInfo->SourcePoint.y * BltInfo->SourceSurface->lDelta) + 3 * BltInfo->SourcePoint.x;
453 DestLine = DestBits;
454
455 if (bTopToBottom)
456 {
457 /* This sets SourceLine to the bottom line */
458 SourceLine += BltInfo->SourceSurface->lDelta * (BltInfo->DestRect.bottom - BltInfo->DestRect.top - 1);
459 }
460
461 for (j = BltInfo->DestRect.top; j < BltInfo->DestRect.bottom; j++)
462 {
463 SourceBits = SourceLine;
464 DestBits = DestLine;
465
466 if (bLeftToRight)
467 {
468 /* This sets the SourceBits to the rightmost pixel */
469 SourceBits += (BltInfo->DestRect.right - BltInfo->DestRect.left - 1) * 3;
470 }
471
472 for (i = BltInfo->DestRect.left; i < BltInfo->DestRect.right; i++)
473 {
474 xColor = (*(SourceBits + 2) << 0x10) +
475 (*(SourceBits + 1) << 0x08) +
476 (*(SourceBits));
477 *DestBits = (BYTE)XLATEOBJ_iXlate(BltInfo->XlateSourceToDest, xColor);
478 DEC_OR_INC(SourceBits, bLeftToRight, 3);
479 DestBits += 1;
480 }
481 DEC_OR_INC(SourceLine, bTopToBottom, BltInfo->SourceSurface->lDelta);
482 DestLine += BltInfo->DestSurface->lDelta;
483 }
484 break;
485
486 case BMF_32BPP:
487 DPRINT("32BPP Case Selected with DestRect Width of '%d'.\n",
488 BltInfo->DestRect.right - BltInfo->DestRect.left);
489
490 SourceLine = (PBYTE)BltInfo->SourceSurface->pvScan0 + (BltInfo->SourcePoint.y * BltInfo->SourceSurface->lDelta) + 4 * BltInfo->SourcePoint.x;
491
492 if (bTopToBottom)
493 {
494 /* This sets SourceLine to the bottom line */
495 SourceLine += BltInfo->DestRect.bottom - BltInfo->DestRect.top - 1;
496 }
497 DestLine = DestBits;
498
499 for (j = BltInfo->DestRect.top; j < BltInfo->DestRect.bottom; j++)
500 {
501 SourceBits = SourceLine;
502 DestBits = DestLine;
503
504 if (bLeftToRight)
505 {
506 /* This sets SourceBits to the rightmost pixel */
507 SourceBits += (BltInfo->DestRect.right - BltInfo->DestRect.left - 1) * 4;
508 }
509
510 for (i = BltInfo->DestRect.left; i < BltInfo->DestRect.right; i++)
511 {
512 xColor = *((PDWORD) SourceBits);
513 *DestBits = (BYTE)XLATEOBJ_iXlate(BltInfo->XlateSourceToDest, xColor);
514
515 DEC_OR_INC(SourceBits, bLeftToRight, 4);
516 DestBits += 1;
517 }
518 DEC_OR_INC(SourceLine, bTopToBottom, BltInfo->SourceSurface->lDelta);
519 DestLine += BltInfo->DestSurface->lDelta;
520 }
521 break;
522
523 default:
524 DPRINT1("DIB_8BPP_Bitblt: Unhandled Source BPP: %u\n", BitsPerFormat(BltInfo->SourceSurface->iBitmapFormat));
525 return FALSE;
526 }
527
528 return TRUE;
529}
unsigned char BOOLEAN
Definition: actypes.h:127
#define DPRINT1
Definition: precomp.h:8
#define DEC_OR_INC(var, decTrue, amount)
Definition: dib8bpp.c:17
VOID DIB_8BPP_PutPixel(SURFOBJ *SurfObj, LONG x, LONG y, ULONG c)
Definition: dib8bpp.c:21
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
#define NonPagedPool
Definition: env_spec_w32.h:307
unsigned short WORD
Definition: ntddk_ex.h:93
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
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
Definition: glfuncs.h:248
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
Definition: glfuncs.h:250
#define ExFreePoolWithTag(_P, _T)
Definition: module.h:1109
WORD * PWORD
Definition: pedump.c:67
BYTE * PBYTE
Definition: pedump.c:66
DWORD * PDWORD
Definition: pedump.c:68
long LONG
Definition: pedump.c:60
#define f1(x, y, z)
Definition: sha1.c:30
#define DPRINT
Definition: sndvol32.h:73
long bottom
Definition: polytest.cpp:53
long right
Definition: polytest.cpp:53
long top
Definition: polytest.cpp:53
long left
Definition: polytest.cpp:53
RECTL DestRect
Definition: dib.h:26
SURFOBJ * SourceSurface
Definition: dib.h:23
SURFOBJ * DestSurface
Definition: dib.h:22
POINTL SourcePoint
Definition: dib.h:27
XLATEOBJ * XlateSourceToDest
Definition: dib.h:25
LONG y
Definition: windef.h:130
LONG x
Definition: windef.h:129
LONG cx
Definition: kdterminal.h:27
LONG cy
Definition: kdterminal.h:28
SIZEL sizlBitmap
Definition: winddi.h:1209
ULONG iBitmapFormat
Definition: winddi.h:1215
PVOID pvScan0
Definition: winddi.h:1212
LONG lDelta
Definition: winddi.h:1213
FLONG flXlate
Definition: winddi.h:1256
#define RtlMoveMemory(Destination, Source, Length)
Definition: typedefs.h:264
_In_ WDFCOLLECTION _In_ ULONG Index
unsigned char altnotmask[2]
Definition: dib.c:18
ULONG DIB_1BPP_GetPixel(SURFOBJ *, LONG, LONG)
Definition: dib1bpp.c:30
#define BitsPerFormat(Format)
Definition: surface.h:109
VOID FASTCALL RECTL_vMakeWellOrdered(_Inout_ RECTL *prcl)
Definition: rect.c:81
#define TAG_DIB
Definition: tags.h:17
#define BMF_16BPP
Definition: winddi.h:358
#define BMF_8BPP
Definition: winddi.h:357
#define BMF_1BPP
Definition: winddi.h:355
ENGAPI ULONG APIENTRY XLATEOBJ_iXlate(_In_ XLATEOBJ *pxlo, _In_ ULONG iColor)
Definition: xlateobj.c:909
#define BMF_24BPP
Definition: winddi.h:359
#define BMF_32BPP
Definition: winddi.h:360
#define XO_TRIVIAL
Definition: winddi.h:1247
#define BMF_4BPP
Definition: winddi.h:356
unsigned char BYTE
Definition: xxhash.c:193

◆ DIB_8BPP_ColorFill()

BOOLEAN DIB_8BPP_ColorFill ( SURFOBJ DestSurface,
RECTL DestRect,
ULONG  color 
)

Definition at line 533 of file dib8bpp.c.

534{
535 LONG DestY;
536
537 /* Make WellOrdered by making top < bottom and left < right */
538 RECTL_vMakeWellOrdered(DestRect);
539
540 for (DestY = DestRect->top; DestY< DestRect->bottom; DestY++)
541 {
542 DIB_8BPP_HLine(DestSurface, DestRect->left, DestRect->right, DestY, color);
543 }
544 return TRUE;
545}
VOID DIB_8BPP_HLine(SURFOBJ *SurfObj, LONG x1, LONG x2, LONG y, ULONG c)
Definition: dib8bpp.c:37
GLuint color
Definition: glext.h:6243
GLint GLint bottom
Definition: glext.h:7726

◆ DIB_8BPP_GetPixel()

ULONG DIB_8BPP_GetPixel ( SURFOBJ SurfObj,
LONG  x,
LONG  y 
)

Definition at line 29 of file dib8bpp.c.

30{
31 PBYTE byteaddr = (PBYTE)SurfObj->pvScan0 + y * SurfObj->lDelta + x;
32
33 return (ULONG)(*byteaddr);
34}
return
Definition: dirsup.c:529
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
uint32_t ULONG
Definition: typedefs.h:59

Referenced by DIB_1BPP_BitBltSrcCopy().

◆ DIB_8BPP_HLine()

VOID DIB_8BPP_HLine ( SURFOBJ SurfObj,
LONG  x1,
LONG  x2,
LONG  y,
ULONG  c 
)

Definition at line 37 of file dib8bpp.c.

38{
39 if (x1 >= x2)
40 return;
41
42 memset((PBYTE)SurfObj->pvScan0 + y * SurfObj->lDelta + x1, (BYTE) c, x2 - x1);
43}
const GLubyte * c
Definition: glext.h:8905
#define memset(x, y, z)
Definition: compat.h:39
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG x1
Definition: winddi.h:3708
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG _In_ LONG _In_ LONG x2
Definition: winddi.h:3710

Referenced by DIB_8BPP_ColorFill().

◆ DIB_8BPP_PutPixel()

VOID DIB_8BPP_PutPixel ( SURFOBJ SurfObj,
LONG  x,
LONG  y,
ULONG  c 
)

Definition at line 21 of file dib8bpp.c.

22{
23 PBYTE byteaddr = (PBYTE)SurfObj->pvScan0 + y * SurfObj->lDelta + x;
24
25 *byteaddr = (BYTE)c;
26}
#define c
Definition: ke_i.h:80

Referenced by DIB_8BPP_BitBltSrcCopy().

◆ DIB_8BPP_TransparentBlt()

BOOLEAN DIB_8BPP_TransparentBlt ( SURFOBJ DestSurf,
SURFOBJ SourceSurf,
RECTL DestRect,
RECTL SourceRect,
XLATEOBJ ColorTranslation,
ULONG  iTransColor 
)

Definition at line 549 of file dib8bpp.c.

552{
553 LONG RoundedRight, X, Y, SourceX = 0, SourceY = 0;
554 ULONG *DestBits, Source, Dest;
555
556 LONG DstHeight;
557 LONG DstWidth;
558 LONG SrcHeight;
559 LONG SrcWidth;
560
561 DstHeight = DestRect->bottom - DestRect->top;
562 DstWidth = DestRect->right - DestRect->left;
563 SrcHeight = SourceRect->bottom - SourceRect->top;
564 SrcWidth = SourceRect->right - SourceRect->left;
565
566 RoundedRight = DestRect->right - ((DestRect->right - DestRect->left) & 0x3);
567 DestBits = (ULONG*)((PBYTE)DestSurf->pvScan0 + DestRect->left +
568 (DestRect->top * DestSurf->lDelta));
569
570 for(Y = DestRect->top; Y < DestRect->bottom; Y++)
571 {
572 DestBits = (ULONG*)((PBYTE)DestSurf->pvScan0 + DestRect->left +
573 (Y * DestSurf->lDelta));
574 SourceY = SourceRect->top+(Y - DestRect->top) * SrcHeight / DstHeight;
575 for (X = DestRect->left; X < RoundedRight; X += 4, DestBits++)
576 {
577 Dest = *DestBits;
578
579 SourceX = SourceRect->left+(X - DestRect->left) * SrcWidth / DstWidth;
580 if (SourceX >= 0 && SourceY >= 0 &&
581 SourceSurf->sizlBitmap.cx > SourceX && SourceSurf->sizlBitmap.cy > SourceY)
582 {
583 Source = DIB_GetSourceIndex(SourceSurf, SourceX, SourceY);
584 if(Source != iTransColor)
585 {
586 Dest &= 0xFFFFFF00;
587 Dest |= (XLATEOBJ_iXlate(ColorTranslation, Source) & 0xFF);
588 }
589 }
590
591 SourceX = SourceRect->left+(X+1 - DestRect->left) * SrcWidth / DstWidth;
592 if (SourceX >= 0 && SourceY >= 0 &&
593 SourceSurf->sizlBitmap.cx > SourceX && SourceSurf->sizlBitmap.cy > SourceY)
594 {
595 Source = DIB_GetSourceIndex(SourceSurf, SourceX, SourceY);
596 if(Source != iTransColor)
597 {
598 Dest &= 0xFFFF00FF;
599 Dest |= ((XLATEOBJ_iXlate(ColorTranslation, Source) << 8) & 0xFF00);
600 }
601 }
602
603 SourceX = SourceRect->left+(X+2 - DestRect->left) * SrcWidth / DstWidth;
604 if (SourceX >= 0 && SourceY >= 0 &&
605 SourceSurf->sizlBitmap.cx > SourceX && SourceSurf->sizlBitmap.cy > SourceY)
606 {
607 Source = DIB_GetSourceIndex(SourceSurf, SourceX, SourceY);
608 if(Source != iTransColor)
609 {
610 Dest &= 0xFF00FFFF;
611 Dest |= ((XLATEOBJ_iXlate(ColorTranslation, Source) << 16) & 0xFF0000);
612 }
613 }
614
615 SourceX = SourceRect->left+(X+3 - DestRect->left) * SrcWidth / DstWidth;
616 if (SourceX >= 0 && SourceY >= 0 &&
617 SourceSurf->sizlBitmap.cx > SourceX && SourceSurf->sizlBitmap.cy > SourceY)
618 {
619 Source = DIB_GetSourceIndex(SourceSurf, SourceX, SourceY);
620 if(Source != iTransColor)
621 {
622 Dest &= 0x00FFFFFF;
623 Dest |= ((XLATEOBJ_iXlate(ColorTranslation, Source) << 24) & 0xFF000000);
624 }
625 }
626
627 *DestBits = Dest;
628 }
629
630 if(X < DestRect->right)
631 {
632 for (; X < DestRect->right; X++)
633 {
634 SourceX = SourceRect->left+(X - DestRect->left) * SrcWidth / DstWidth;
635 if (SourceX >= 0 && SourceY >= 0 &&
636 SourceSurf->sizlBitmap.cx > SourceX && SourceSurf->sizlBitmap.cy > SourceY)
637 {
638 Source = DIB_GetSourceIndex(SourceSurf, SourceX, SourceY);
639 if(Source != iTransColor)
640 {
641 *((BYTE*)DestBits) = (BYTE)(XLATEOBJ_iXlate(ColorTranslation, Source) & 0xFF);
642 }
643 }
644 DestBits = (PULONG)((ULONG_PTR)DestBits + 1);
645 }
646 }
647 }
648
649 return TRUE;
650}
#define Y(I)
GLdouble GLdouble right
Definition: glext.h:10859
#define X(b, s)
_In_ UINT _In_ UINT _In_ PNDIS_PACKET Source
Definition: ndis.h:3169
uint32_t * PULONG
Definition: typedefs.h:59
uint32_t ULONG_PTR
Definition: typedefs.h:65
#define DIB_GetSourceIndex(SourceSurf, sx, sy)
Definition: dib.h:141
_In_ SURFOBJ _In_ CLIPOBJ _In_opt_ XLATEOBJ _In_ RECTL _In_ RECTL _In_ ULONG iTransColor
Definition: winddi.h:4195

◆ DIB_8BPP_VLine()

VOID DIB_8BPP_VLine ( SURFOBJ SurfObj,
LONG  x,
LONG  y1,
LONG  y2,
ULONG  c 
)

Definition at line 46 of file dib8bpp.c.

47{
48 PBYTE byteaddr = (PBYTE)SurfObj->pvScan0 + y1 * SurfObj->lDelta;
49 PBYTE addr = byteaddr + x;
50 LONG lDelta = SurfObj->lDelta;
51
52 byteaddr = addr;
53 while(y1++ < y2)
54 {
55 *addr = (BYTE)c;
56
57 addr += lDelta;
58 }
59}
GLenum const GLvoid * addr
Definition: glext.h:9621
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG _In_ LONG y1
Definition: winddi.h:3709
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG _In_ LONG _In_ LONG _In_ LONG y2
Definition: winddi.h:3711