17 #define DEC_OR_INC(var, decTrue, amount) \ 18 ((var) = (decTrue) ? ((var) - (amount)) : ((var) + (amount))) 35 return (
ULONG)(*addr);
57 PBYTE SourceBits, DestBits, SourceLine, DestLine;
58 PBYTE SourceBitsT, SourceBitsB, DestBitsT, DestBitsB;
59 PBYTE SourceBits_4BPP, SourceLine_4BPP;
62 BOOLEAN bTopToBottom, bLeftToRight;
63 BOOLEAN blDeltaSrcNeg, blDeltaDestNeg;
66 DPRINT(
"DIB_32BPP_BitBltSrcCopy: SourcePoint (%d, %d), SourceSurface cx/cy (%d/%d), " 67 "DestSurface cx/cy (%d/%d) DestRect: (%d,%d)-(%d,%d)\n",
73 DPRINT(
"BltInfo->DestSurface->lDelta is '%d' and BltInfo->SourceSurface->lDelta is '%d'.\n",
79 DPRINT(
"BltInfo->SourcePoint.x is '%d' and BltInfo->SourcePoint.y is '%d'.\n",
97 DPRINT(
"bTopToBottom is '%d' and DestSurface->lDelta < 0 is '%d' and SourceSurface->lDelta < 0 is '%d'.\n",
111 DestWidth, DestHeight);
116 DPRINT(
"1BPP Case Selected with DestRect Width of '%d'.\n",
119 if (bLeftToRight || bTopToBottom)
120 DPRINT(
"bLeftToRight is '%d' and bTopToBottom is '%d'.\n", bLeftToRight, bTopToBottom);
133 for (
j=BltInfo->
DestRect.
top; j<BltInfo->DestRect.bottom;
j++)
140 sx += (DestWidth - 1);
143 for (
i = BltInfo->
DestRect.
left; i < BltInfo->DestRect.right;
i++)
161 DPRINT(
"4BPP Case Selected with DestRect Width of '%d'.\n",
164 if (bLeftToRight || bTopToBottom)
165 DPRINT(
"bLeftToRight is '%d' and bTopToBottom is '%d'.\n", bLeftToRight, bTopToBottom);
178 for (
j=BltInfo->
DestRect.
top; j<BltInfo->DestRect.bottom;
j++)
180 SourceLine_4BPP = SourceBits_4BPP;
186 sx += (DestWidth - 1);
209 DPRINT(
"8BPP Case Selected with DestRect Width of '%d'.\n",
212 if (bLeftToRight || bTopToBottom)
213 DPRINT(
"bLeftToRight is '%d' and bTopToBottom is '%d'.\n", bLeftToRight, bTopToBottom);
227 for (
j = BltInfo->
DestRect.
top; j < BltInfo->DestRect.bottom;
j++)
229 SourceBits = SourceLine;
235 SourceBits += (DestWidth - 1);
238 for (
i = BltInfo->
DestRect.
left; i < BltInfo->DestRect.right;
i++)
240 xColor = *SourceBits;
251 DPRINT(
"16BPP Case Selected with DestRect Width of '%d'.\n",
254 if (bLeftToRight || bTopToBottom)
255 DPRINT(
"bLeftToRight is '%d' and bTopToBottom is '%d'.\n", bLeftToRight, bTopToBottom);
269 for (
j = BltInfo->
DestRect.
top; j < BltInfo->DestRect.bottom;
j++)
271 SourceBits = SourceLine;
277 SourceBits += (DestWidth - 1) * 2;
280 for (
i = BltInfo->
DestRect.
left; i < BltInfo->DestRect.right;
i++)
282 xColor = *((
PWORD) SourceBits);
294 DPRINT(
"24BPP Case Selected with DestRect Width of '%d'.\n",
297 if (bLeftToRight || bTopToBottom)
298 DPRINT(
"bLeftToRight is '%d' and bTopToBottom is '%d'.\n", bLeftToRight, bTopToBottom);
313 for (
j = BltInfo->
DestRect.
top; j < BltInfo->DestRect.bottom;
j++)
315 SourceBits = SourceLine;
321 SourceBits += (DestWidth - 1) * 3;
324 for (
i = BltInfo->
DestRect.
left; i < BltInfo->DestRect.right;
i++)
326 xColor = (*(SourceBits + 2) << 0x10) +
327 (*(SourceBits + 1) << 0x08) +
340 DPRINT(
"32BPP Case Selected with SourcePoint (%d,%d) and DestRect Width/height of '%d/%d' DestRect: (%d,%d)-(%d,%d).\n",
344 if (bLeftToRight || bTopToBottom)
345 DPRINT(
"bLeftToRight is '%d' and bTopToBottom is '%d'.\n", bLeftToRight, bTopToBottom);
348 if (((blDeltaSrcNeg || blDeltaDestNeg) && !(blDeltaSrcNeg && blDeltaDestNeg)) && bTopToBottom)
350 DPRINT(
"Adjusting for lDelta's here.\n");
357 for (
j = BltInfo->
DestRect.
top; j < BltInfo->DestRect.bottom;
j++)
382 blDeltaAdjustDone =
TRUE;
390 (!bTopToBottom && !bLeftToRight))
392 DPRINT(
"XO_TRIVIAL is TRUE.\n");
400 for (
j = BltInfo->
DestRect.
top; j < BltInfo->DestRect.bottom;
j++)
428 DPRINT(
"XO_TRIVIAL is NOT TRUE.\n");
430 if (!bTopToBottom && !bLeftToRight)
437 for (
j = BltInfo->
DestRect.
top; j < BltInfo->DestRect.bottom;
j++)
441 Dest32 = (
DWORD *) DestBits;
442 Source32 = (
DWORD *) SourceBits;
443 for (
i = BltInfo->
DestRect.
left; i < BltInfo->DestRect.right;
i++)
450 Dest32 = (
DWORD *) DestBits + (DestWidth - 1);
451 Source32 = (
DWORD *) SourceBits + (DestWidth - 1);
474 Dest32 = (
DWORD *) DestBits;
475 Source32 = (
DWORD *) SourceBits;
476 for (
i = BltInfo->
DestRect.
left; i < BltInfo->DestRect.right;
i++)
483 Dest32 = (
DWORD *) DestBits + (DestWidth - 1);
484 Source32 = (
DWORD *) SourceBits + (DestWidth - 1);
501 if ((bLeftToRight) && (DestWidth > 1))
503 DPRINT(
"Flip is bLeftToRight.\n");
510 DPRINT1(
"Storage Allocation Failed.\n");
528 Dest32 = (
DWORD *) DestBits + (DestWidth - 1);
529 Source32 = (
DWORD *) SourceBits;
536 store[
Index] = *Source32++;
545 *Dest32-- = store[
Index];
552 TopToBottomDone =
TRUE;
556 if ((bTopToBottom) && (DestHeight > 1))
563 DPRINT(
"Flip is bTopToBottom.\n");
570 DPRINT1(
"Storage Allocation Failed.\n");
592 if (TopToBottomDone || blDeltaAdjustDone)
595 SourceBitsB = DestBitsB;
598 SourceBitsT = DestBitsT;
620 DPRINT(
"Flips Need Adjustments, so do move here.\n");
628 for (
j = BltInfo->
DestRect.
top; j < BltInfo->DestRect.bottom;
j++)
655 SourceBitsB = DestBitsB;
658 SourceBitsT = DestBitsT;
662 for (
j = 0;
j < DestHeight / 2 ;
j++)
683 DPRINT(
"Handling Top To Bottom with Odd Number of lines.\n");
705 LONG X,
Y, SourceX, SourceY = 0, wd;
713 DstHeight = DestRect->
bottom - DestRect->
top;
714 DstWidth = DestRect->
right - DestRect->
left;
715 SrcHeight = SourceRect->
bottom - SourceRect->
top;
716 SrcWidth = SourceRect->
right - SourceRect->
left;
719 (DestRect->
left << 2) +
725 SourceY = SourceRect->
top+(
Y - DestRect->
top) * SrcHeight / DstHeight;
728 SourceX = SourceRect->
left+(
X - DestRect->
left) * SrcWidth / DstWidth;
729 if (SourceX >= 0 && SourceY >= 0 &&
756 static __inline
UCHAR 773 DPRINT(
"DIB_32BPP_AlphaBlend: SourceRect: (%d,%d)-(%d,%d), DestRect: (%d,%d)-(%d,%d)\n",
780 DPRINT1(
"BlendOp != AC_SRC_OVER\n");
796 DPRINT1(
"Source bitmap must be 32bpp when AC_SRC_ALPHA is set\n");
801 (DestRect->
left << 2));
805 SrcY = SourceRect->
top;
806 while (++Rows <= DestRect->
bottom - DestRect->
top)
809 SrcX = SourceRect->
left;
810 while (++Cols <= DestRect->
right - DestRect->
left)
816 SrcPixel.
col.alpha = (32 == SrcBpp) ?
824 DstPixel.
col.red =
Clamp8((DstPixel.
col.red * (255 - Alpha)) / 255 + SrcPixel.
col.red) ;
825 DstPixel.
col.green =
Clamp8((DstPixel.
col.green * (255 - Alpha)) / 255 + SrcPixel.
col.green) ;
826 DstPixel.
col.blue =
Clamp8((DstPixel.
col.blue * (255 - Alpha)) / 255 + SrcPixel.
col.blue) ;
827 DstPixel.
col.alpha =
Clamp8((DstPixel.
col.alpha * (255 - Alpha)) / 255 + SrcPixel.
col.alpha) ;
828 *
Dst++ = DstPixel.
ul;
829 SrcX = SourceRect->
left + (Cols*(SourceRect->
right - SourceRect->
left))/(DestRect->
right - DestRect->
left);
832 (DestRect->
left << 2));
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG _In_ LONG y1
struct NICEPIXEL32::@4862 col
XLATEOBJ * XlateSourceToDest
unsigned char altnotmask[2]
#define BitsPerFormat(Format)
ULONG DIB_32BPP_GetPixel(SURFOBJ *SurfObj, LONG x, LONG y)
GLint GLint GLint GLint GLint x
BOOLEAN DIB_32BPP_BitBltSrcCopy(PBLTINFO BltInfo)
_In_ SURFOBJ _In_ CLIPOBJ _In_opt_ XLATEOBJ _In_ RECTL _In_ RECTL _In_ ULONG iTransColor
VOID DIB_32BPP_PutPixel(SURFOBJ *SurfObj, LONG x, LONG y, ULONG c)
#define RtlMoveMemory(Destination, Source, Length)
#define DIB_GetSource(SourceSurf, sx, sy, ColorTranslation)
#define DIB_GetSourceIndex(SourceSurf, sx, sy)
BOOLEAN DIB_32BPP_TransparentBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf, RECTL *DestRect, RECTL *SourceRect, XLATEOBJ *ColorTranslation, ULONG iTransColor)
static const BLENDFUNCTION BlendFunc
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
_In_ WDFCOLLECTION _In_ ULONG Index
#define DEC_OR_INC(var, decTrue, amount)
#define ExAllocatePoolWithTag(hernya, size, tag)
GLenum const GLvoid * addr
static __inline UCHAR Clamp8(ULONG val)
ULONG DIB_1BPP_GetPixel(SURFOBJ *, LONG, LONG)
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG _In_ LONG _In_ LONG _In_ LONG y2
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
GLint GLint GLint GLint GLint GLint y
GLclampf GLclampf GLclampf alpha
VOID DIB_32BPP_VLine(SURFOBJ *SurfObj, LONG x, LONG y1, LONG y2, ULONG c)
BOOLEAN DIB_32BPP_AlphaBlend(SURFOBJ *Dest, SURFOBJ *Source, RECTL *DestRect, RECTL *SourceRect, CLIPOBJ *ClipRegion, XLATEOBJ *ColorTranslation, BLENDOBJ *BlendObj)
_In_ UINT _In_ UINT _In_ PNDIS_PACKET Source
ENGAPI ULONG APIENTRY XLATEOBJ_iXlate(_In_ XLATEOBJ *pxlo, _In_ ULONG iColor)
#define ExFreePoolWithTag(_P, _T)
VOID FASTCALL RECTL_vMakeWellOrdered(_Inout_ RECTL *prcl)
BLENDFUNCTION BlendFunction