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 LONG DestWidth, DestHeight;
63 BOOLEAN bTopToBottom, bLeftToRight;
64 BOOLEAN blDeltaSrcNeg, blDeltaDestNeg;
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",
74 DPRINT(
"BltInfo->DestSurface->lDelta is '%d' and BltInfo->SourceSurface->lDelta is '%d'.\n",
80 DPRINT(
"BltInfo->SourcePoint.x is '%d' and BltInfo->SourcePoint.y is '%d'.\n",
98 DPRINT(
"bTopToBottom is '%d' and DestSurface->lDelta < 0 is '%d' and SourceSurface->lDelta < 0 is '%d'.\n",
112 DestWidth, DestHeight);
117 DPRINT(
"1BPP Case Selected with DestRect Width of '%d'.\n",
120 if (bLeftToRight || bTopToBottom)
121 DPRINT(
"bLeftToRight is '%d' and bTopToBottom is '%d'.\n", bLeftToRight, bTopToBottom);
134 for (
j=BltInfo->
DestRect.
top; j<BltInfo->DestRect.bottom;
j++)
141 sx += (DestWidth - 1);
144 for (
i = BltInfo->
DestRect.
left; i < BltInfo->DestRect.right;
i++)
162 DPRINT(
"4BPP Case Selected with DestRect Width of '%d'.\n",
165 if (bLeftToRight || bTopToBottom)
166 DPRINT(
"bLeftToRight is '%d' and bTopToBottom is '%d'.\n", bLeftToRight, bTopToBottom);
179 for (
j=BltInfo->
DestRect.
top; j<BltInfo->DestRect.bottom;
j++)
181 SourceLine_4BPP = SourceBits_4BPP;
187 sx += (DestWidth - 1);
210 DPRINT(
"8BPP Case Selected with DestRect Width of '%d'.\n",
213 if (bLeftToRight || bTopToBottom)
214 DPRINT(
"bLeftToRight is '%d' and bTopToBottom is '%d'.\n", bLeftToRight, bTopToBottom);
228 for (
j = BltInfo->
DestRect.
top; j < BltInfo->DestRect.bottom;
j++)
230 SourceBits = SourceLine;
236 SourceBits += (DestWidth - 1);
239 for (
i = BltInfo->
DestRect.
left; i < BltInfo->DestRect.right;
i++)
241 xColor = *SourceBits;
252 DPRINT(
"16BPP Case Selected with DestRect Width of '%d'.\n",
255 if (bLeftToRight || bTopToBottom)
256 DPRINT(
"bLeftToRight is '%d' and bTopToBottom is '%d'.\n", bLeftToRight, bTopToBottom);
270 for (
j = BltInfo->
DestRect.
top; j < BltInfo->DestRect.bottom;
j++)
272 SourceBits = SourceLine;
278 SourceBits += (DestWidth - 1) * 2;
281 for (
i = BltInfo->
DestRect.
left; i < BltInfo->DestRect.right;
i++)
283 xColor = *((
PWORD) SourceBits);
295 DPRINT(
"24BPP Case Selected with DestRect Width of '%d'.\n",
298 if (bLeftToRight || bTopToBottom)
299 DPRINT(
"bLeftToRight is '%d' and bTopToBottom is '%d'.\n", bLeftToRight, bTopToBottom);
314 for (
j = BltInfo->
DestRect.
top; j < BltInfo->DestRect.bottom;
j++)
316 SourceBits = SourceLine;
322 SourceBits += (DestWidth - 1) * 3;
325 for (
i = BltInfo->
DestRect.
left; i < BltInfo->DestRect.right;
i++)
327 xColor = (*(SourceBits + 2) << 0x10) +
328 (*(SourceBits + 1) << 0x08) +
341 DPRINT(
"32BPP Case Selected with SourcePoint (%d,%d) and DestRect Width/height of '%d/%d' DestRect: (%d,%d)-(%d,%d).\n",
345 if (bLeftToRight || bTopToBottom)
346 DPRINT(
"bLeftToRight is '%d' and bTopToBottom is '%d'.\n", bLeftToRight, bTopToBottom);
349 if (((blDeltaSrcNeg || blDeltaDestNeg) && !(blDeltaSrcNeg && blDeltaDestNeg)) && bTopToBottom)
351 DPRINT(
"Adjusting for lDelta's here.\n");
358 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;
726 for (
X = DestRect->
left; X < DestRect->
right;
X++, DestBits++)
728 SourceX = SourceRect->
left+(
X - DestRect->
left) * SrcWidth / DstWidth;
729 if (SourceX >= 0 && SourceY >= 0 &&
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));
ULONG DIB_32BPP_GetPixel(SURFOBJ *SurfObj, LONG x, LONG y)
BOOLEAN DIB_32BPP_BitBltSrcCopy(PBLTINFO BltInfo)
VOID DIB_32BPP_VLine(SURFOBJ *SurfObj, LONG x, LONG y1, LONG y2, ULONG c)
#define DEC_OR_INC(var, decTrue, amount)
BOOLEAN DIB_32BPP_AlphaBlend(SURFOBJ *Dest, SURFOBJ *Source, RECTL *DestRect, RECTL *SourceRect, CLIPOBJ *ClipRegion, XLATEOBJ *ColorTranslation, BLENDOBJ *BlendObj)
VOID DIB_32BPP_PutPixel(SURFOBJ *SurfObj, LONG x, LONG y, ULONG c)
static __inline UCHAR Clamp8(ULONG val)
BOOLEAN DIB_32BPP_TransparentBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf, RECTL *DestRect, RECTL *SourceRect, XLATEOBJ *ColorTranslation, ULONG iTransColor)
static const BLENDFUNCTION BlendFunc
#define ExAllocatePoolWithTag(hernya, size, tag)
GLint GLint GLint GLint GLint x
GLclampf GLclampf GLclampf alpha
GLint GLint GLint GLint GLint GLint y
GLenum const GLvoid * addr
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)
_In_ UINT _In_ UINT _In_ PNDIS_PACKET Source
BLENDFUNCTION BlendFunction
XLATEOBJ * XlateSourceToDest
#define RtlMoveMemory(Destination, Source, Length)
struct NICEPIXEL32::@5079 col
_In_ WDFCOLLECTION _In_ ULONG Index
unsigned char altnotmask[2]
#define DIB_GetSource(SourceSurf, sx, sy, ColorTranslation)
ULONG DIB_1BPP_GetPixel(SURFOBJ *, LONG, LONG)
#define DIB_GetSourceIndex(SourceSurf, sx, sy)
#define BitsPerFormat(Format)
VOID FASTCALL RECTL_vMakeWellOrdered(_Inout_ RECTL *prcl)
_In_ SURFOBJ _In_ CLIPOBJ _In_opt_ XLATEOBJ _In_ RECTL _In_ RECTL _In_ ULONG iTransColor
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG _In_ LONG y1
ENGAPI ULONG APIENTRY XLATEOBJ_iXlate(_In_ XLATEOBJ *pxlo, _In_ ULONG iColor)
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG _In_ LONG _In_ LONG _In_ LONG y2