57 DPRINT(
"Entering CallDibStretchBlt: psoSource cx/cy (%d/%d), psoDest cx/cy (%d/%d) OutputRect: (%d,%d)-(%d,%d)\n",
62 if (BrushOrigin ==
NULL)
64 RealBrushOrigin.
x = RealBrushOrigin.
y = 0;
68 RealBrushOrigin = *BrushOrigin;
85 OutputRect, InputRect, MaskOrigin,
pbo, &RealBrushOrigin,
86 ColorTranslation, Rop4);
122 POINTL AdjustedBrushOrigin;
131 RECTL InputToCombinedRect;
139 LONG cxSrc, cySrc, cxDest, cyDest;
140 BOOLEAN bLeftToRight, bTopToBottom;
143 DPRINT(
"Entering EngStretchBltROP: prclSrc: (%d/%d)-(%d/%d) prclDest: (%d,%d)-(%d,%d)\n",
153 if (((cxSrc < 0) && (cxDest < 0)) || ((cxSrc >= 0) && (cxDest >= 0)))
154 bLeftToRight =
FALSE;
158 if (((cySrc < 0) && (cyDest < 0)) || ((cySrc >= 0) && (cyDest >= 0)))
159 bTopToBottom =
FALSE;
182 clippingType = ClipRegion->iDComplexity;
206 &Translate, &psoInput))
211 InputRect.
left += Translate.
x;
212 InputRect.
right += Translate.
x;
213 InputRect.
top += Translate.
y;
214 InputRect.
bottom += Translate.
y;
225 if (
NULL != ClipRegion)
227 if (OutputRect.
left < ClipRegion->rclBounds.left)
229 InputRect.
left += ClipRegion->rclBounds.left - OutputRect.
left;
230 OutputRect.
left = ClipRegion->rclBounds.left;
232 if (ClipRegion->rclBounds.right < OutputRect.
right)
234 InputRect.
right -= OutputRect.
right - ClipRegion->rclBounds.right;
235 OutputRect.
right = ClipRegion->rclBounds.right;
237 if (OutputRect.
top < ClipRegion->rclBounds.top)
239 InputRect.
top += ClipRegion->rclBounds.top - OutputRect.
top;
240 OutputRect.
top = ClipRegion->rclBounds.top;
242 if (ClipRegion->rclBounds.bottom < OutputRect.
bottom)
244 InputRect.
bottom -= OutputRect.
bottom - ClipRegion->rclBounds.bottom;
245 OutputRect.
bottom = ClipRegion->rclBounds.bottom;
260 if (!
IntEngEnter(&EnterLeaveDest, psoDest, &OutputRect,
FALSE, &Translate, &psoOutput))
269 OutputRect.
left += Translate.
x;
270 OutputRect.
right += Translate.
x;
271 OutputRect.
top += Translate.
y;
272 OutputRect.
bottom += Translate.
y;
276 AdjustedBrushOrigin.
x = BrushOrigin->x + Translate.
x;
277 AdjustedBrushOrigin.
y = BrushOrigin->y + Translate.
y;
281 AdjustedBrushOrigin = Translate;
286 DstHeight = OutputRect.
bottom - OutputRect.
top;
287 DstWidth = OutputRect.
right - OutputRect.
left;
288 SrcHeight = InputRect.
bottom - InputRect.
top;
289 SrcWidth = InputRect.
right - InputRect.
left;
291 DPRINT(
"bLeftToRight is '%d' and bTopToBottom is '%d'.\n", bLeftToRight, bTopToBottom);
293 switch (clippingType)
298 lTmp = OutputRect.
left;
300 OutputRect.
right = lTmp;
305 lTmp = OutputRect.
top;
310 DPRINT(
"About to call CallDibStretchBlt: OutputRect: (%d,%d)-(%d,%d)\n",
313 Ret = (*BltRectFunc)(psoOutput, psoInput,
Mask,
314 ColorTranslation, &OutputRect, &InputRect, MaskOrigin,
315 pbo, &AdjustedBrushOrigin, Rop4);
319 ClipRect.
left = ClipRegion->rclBounds.left + Translate.
x;
320 ClipRect.
right = ClipRegion->rclBounds.right + Translate.
x;
321 ClipRect.
top = ClipRegion->rclBounds.top + Translate.
y;
322 ClipRect.
bottom = ClipRegion->rclBounds.bottom + Translate.
y;
325 InputToCombinedRect.
top = InputRect.top + (CombinedRect.
top - OutputRect.top) * SrcHeight / DstHeight;
326 InputToCombinedRect.
bottom = InputRect.top + (CombinedRect.
bottom - OutputRect.top) * SrcHeight / DstHeight;
327 InputToCombinedRect.
left = InputRect.left + (CombinedRect.
left - OutputRect.left) * SrcWidth / DstWidth;
328 InputToCombinedRect.
right = InputRect.left + (CombinedRect.
right - OutputRect.left) * SrcWidth / DstWidth;
332 lTmp = CombinedRect.
left;
334 CombinedRect.
right = lTmp;
339 lTmp = CombinedRect.
top;
341 CombinedRect.
bottom = lTmp;
344 DPRINT(
"About to call CallDibStretchBlt: CombinedRect: (%d,%d)-(%d,%d)\n",
347 Ret = (*BltRectFunc)(psoOutput, psoInput,
Mask,
350 &InputToCombinedRect,
353 &AdjustedBrushOrigin,
358 if (psoOutput == psoInput)
360 if (OutputRect.top < InputRect.top)
362 Direction = OutputRect.left < InputRect.left ?
367 Direction = OutputRect.left < InputRect.left ?
380 for (
i = 0;
i < RectEnum.c;
i++)
382 ClipRect.
left = RectEnum.arcl[
i].left + Translate.
x;
383 ClipRect.
right = RectEnum.arcl[
i].right + Translate.
x;
384 ClipRect.
top = RectEnum.arcl[
i].top + Translate.
y;
385 ClipRect.
bottom = RectEnum.arcl[
i].bottom + Translate.
y;
388 InputToCombinedRect.
top = InputRect.top + (CombinedRect.
top - OutputRect.top) * SrcHeight / DstHeight;
389 InputToCombinedRect.
bottom = InputRect.top + (CombinedRect.
bottom - OutputRect.top) * SrcHeight / DstHeight;
390 InputToCombinedRect.
left = InputRect.left + (CombinedRect.
left - OutputRect.left) * SrcWidth / DstWidth;
391 InputToCombinedRect.
right = InputRect.left + (CombinedRect.
right - OutputRect.left) * SrcWidth / DstWidth;
395 lTmp = CombinedRect.
left;
397 CombinedRect.
right = lTmp;
402 lTmp = CombinedRect.
top;
404 CombinedRect.
bottom = lTmp;
407 DPRINT(
"About to call CallDibStretchBlt: CombinedRect: (%d,%d)-(%d,%d)\n",
410 Ret = (*BltRectFunc)(psoOutput, psoInput,
Mask,
413 &InputToCombinedRect,
416 &AdjustedBrushOrigin,
483 POINTL MaskOrigin = {0, 0};
486 RECTL InputClippedRect;
490 LONG InputClWidth, InputClHeight, InputWidth, InputHeight;
491 LONG lTmp, cxSrc, cySrc, cxDest, cyDest;
492 BOOLEAN bTopToBottom, bLeftToRight;
493 INT Case0000, Case0001, Case0010, Case0011;
494 INT Case0100, Case0101, Case0110, Case0111;
495 INT Case1000, Case1001, Case1010, Case1011;
496 INT Case1100, Case1101, Case1110;
498 DPRINT(
"Source cx/cy (%d/%d) and Destination cx/cy (%d/%d).\n",
501 DPRINT(
"Source lDelta is '%d' and Destination lDelta is '%d'.\n",
513 DPRINT(
"Using trivial clip region.\n");
518 DPRINT(
"ClipRegion->rclBounds is (%d,%d)-(%d,%d).\n",
528 cxSrc = SourceRect->
right - SourceRect->
left;
529 cySrc = SourceRect->
bottom - SourceRect->
top;
530 cxDest = DestRect->
right - DestRect->
left;
531 cyDest = DestRect->
bottom - DestRect->
top;
533 Case1110 = ((cxDest > 0) && (cyDest > 0) && (cxSrc > 0) && (cySrc < 0));
534 Case1101 = ((cxDest > 0) && (cyDest > 0) && (cxSrc < 0) && (cySrc > 0));
535 Case1100 = ((cxDest > 0) && (cyDest > 0) && (cxSrc < 0) && (cySrc < 0));
536 Case1011 = ((cxDest > 0) && (cyDest < 0) && (cxSrc > 0) && (cySrc > 0));
537 Case1010 = ((cxDest > 0) && (cyDest < 0) && (cxSrc > 0) && (cySrc < 0));
538 Case1001 = ((cxDest > 0) && (cyDest < 0) && (cxSrc < 0) && (cySrc > 0));
539 Case1000 = ((cxDest > 0) && (cyDest < 0) && (cxSrc < 0) && (cySrc < 0));
540 Case0111 = ((cxDest < 0) && (cyDest > 0) && (cxSrc > 0) && (cySrc > 0));
541 Case0110 = ((cxDest < 0) && (cyDest > 0) && (cxSrc > 0) && (cySrc < 0));
542 Case0101 = ((cxDest < 0) && (cyDest > 0) && (cxSrc < 0) && (cySrc > 0));
543 Case0100 = ((cxDest < 0) && (cyDest > 0) && (cxSrc < 0) && (cySrc < 0));
544 Case0011 = ((cxDest < 0) && (cyDest < 0) && (cxSrc > 0) && (cySrc > 0));
545 Case0010 = ((cxDest < 0) && (cyDest < 0) && (cxSrc > 0) && (cySrc < 0));
546 Case0001 = ((cxDest < 0) && (cyDest < 0) && (cxSrc < 0) && (cySrc > 0));
547 Case0000 = ((cxDest < 0) && (cyDest < 0) && (cxSrc < 0) && (cySrc < 0));
551 OutputRect = *DestRect;
554 if (((cxSrc < 0) && (cxDest < 0)) || ((cxSrc >= 0) && (cxDest >= 0)))
555 bLeftToRight =
FALSE;
559 if (((cySrc < 0) && (cyDest < 0)) || ((cySrc >= 0) && (cyDest >= 0)))
560 bTopToBottom =
FALSE;
564 DPRINT(
"bTopToBottom is '%d' and bLeftToRight is '%d'.\n", bTopToBottom, bLeftToRight);
570 DPRINT(
"source and dest size are equal.\n");
572 DPRINT(
"IntEngStretchBlt: dstRect: (%d,%d)-(%d,%d)\n",
575 if (Case0000 || Case0001 || Case0010 || Case0011)
577 lTmp = SourceRect->
left;
579 SourceRect->
right = lTmp;
581 lTmp = SourceRect->
top;
583 SourceRect->
bottom = lTmp;
586 if (Case0100 || Case0101 || Case0110 || Case0111)
588 lTmp = SourceRect->
left;
590 SourceRect->
right = lTmp;
593 if (Case1000 || Case1001 || Case1010 || Case1011)
595 lTmp = SourceRect->
top;
597 SourceRect->
bottom = lTmp;
602 lTmp = DestRect->
left;
604 DestRect->
right = lTmp;
609 lTmp = DestRect->
top;
614 DPRINT(
"Calling IntEngBitBlt: SourceRect (%d,%d)-(%d,%d) DestRect: (%d,%d)-(%d,%d)\n",
632 DPRINT(
"source and dest size are NOT equal.\n");
634 DPRINT(
"SourceRect: (%d,%d)-(%d,%d) and DestRect: (%d,%d)-(%d,%d)\n",
643 lTmp = SourceRect->
left;
645 SourceRect->
right = lTmp;
646 lTmp = DestRect->
left;
648 DestRect->
right = lTmp;
657 lTmp = DestRect->
top;
660 lTmp = SourceRect->
top;
662 SourceRect->
bottom = lTmp;
667 if (Case0010 || Case0111)
672 if (Case0010 || Case0111 || Case1000 || Case1101)
678 if (Case0001 || Case0100 || Case1011 || Case1110)
684 if (Case0011 || Case0110 || Case1001 || Case1100)
693 if (Case0000 || Case1010)
702 if (Case0000 || Case0101)
712 DPRINT(
"SourceRect: (%d,%d)-(%d,%d) and DestRect: (%d,%d)-(%d,%d)\n",
716 InputClippedRect = *DestRect;
717 if (InputClippedRect.
right < InputClippedRect.
left)
722 if (InputClippedRect.
bottom < InputClippedRect.
top)
728 if (
NULL == psoSource)
730 DPRINT(
"Returning FALSE.\n");
733 InputRect = *SourceRect;
738 DPRINT(
"Returning TRUE.\n");
743 DPRINT(
"InputRect: (%d,%d)-(%d,%d) and InputClippedRect: (%d,%d)-(%d,%d)\n",
745 InputClippedRect.
left, InputClippedRect.
top, InputClippedRect.
right, InputClippedRect.
bottom);
752 DPRINT(
"Returning TRUE.\n");
756 DPRINT(
"InputClippedRect: (%d,%d)-(%d,%d) and OutputRect: (%d,%d)-(%d,%d)\n",
757 InputClippedRect.
left, InputClippedRect.
top, InputClippedRect.
right, InputClippedRect.
bottom,
761 InputClWidth = InputClippedRect.
right - InputClippedRect.
left;
762 InputClHeight = InputClippedRect.
bottom - InputClippedRect.
top;
763 InputWidth = InputRect.
right - InputRect.
left;
764 InputHeight = InputRect.
bottom - InputRect.
top;
766 InputRect.
left += (InputWidth * (OutputRect.
left - InputClippedRect.
left)) / InputClWidth;
767 InputRect.
right -= (InputWidth * (InputClippedRect.
right - OutputRect.
right)) / InputClWidth;
768 InputRect.
top += (InputHeight * (OutputRect.
top - InputClippedRect.
top)) / InputClHeight;
769 InputRect.
bottom -= (InputHeight * (InputClippedRect.
bottom - OutputRect.
bottom)) / InputClHeight;
773 DPRINT(
"Complexity = DC_TRIVIAL.\n");
774 OutputRect = InputClippedRect;
778 DPRINT(
"InputRect: (%d,%d)-(%d,%d) and OutputRect: (%d,%d)-(%d,%d)\n",
782 if (pMaskOrigin !=
NULL)
784 MaskOrigin.
x = pMaskOrigin->
x;
785 MaskOrigin.
y = pMaskOrigin->
y;
799 DPRINT(
"About to call GDIDEVFUNCS(psoDest).StretchBltROP.\n");
821 lTmp = OutputRect.
left;
823 OutputRect.
right = lTmp;
828 lTmp = OutputRect.
top;
833 DPRINT(
"Calling EngStretchBltROP: InputRect: (%d,%d)-(%d,%d) and OutputRect: (%d,%d)-(%d,%d)\n",
904 return EngStretchBlt(psoDest, psoSource,
Mask, ClipRegion, ColorTranslation,
pca, &lBrushOrigin, &rclDest, &rclSrc, &lMaskOrigin,
Mode);
#define R3_OPINDEX_SRCCOPY
static BOOLEAN APIENTRY CallDibStretchBlt(SURFOBJ *psoDest, SURFOBJ *psoSource, SURFOBJ *Mask, XLATEOBJ *ColorTranslation, RECTL *OutputRect, RECTL *InputRect, POINTL *MaskOrigin, BRUSHOBJ *pbo, POINTL *BrushOrigin, ROP4 Rop4)
BOOL APIENTRY NtGdiEngStretchBlt(IN SURFOBJ *psoDest, IN SURFOBJ *psoSource, IN SURFOBJ *Mask, IN CLIPOBJ *ClipRegion, IN XLATEOBJ *ColorTranslation, IN COLORADJUSTMENT *pca, IN POINTL *BrushOrigin, IN RECTL *prclDest, IN RECTL *prclSrc, IN POINTL *MaskOrigin, IN ULONG Mode)
BOOL APIENTRY IntEngStretchBlt(SURFOBJ *psoDest, SURFOBJ *psoSource, SURFOBJ *MaskSurf, CLIPOBJ *ClipRegion, XLATEOBJ *ColorTranslation, COLORADJUSTMENT *pca, RECTL *DestRect, RECTL *SourceRect, POINTL *pMaskOrigin, BRUSHOBJ *pbo, POINTL *BrushOrigin, DWORD Rop4)
BOOL APIENTRY EngStretchBltROP(IN SURFOBJ *psoDest, IN SURFOBJ *psoSource, IN SURFOBJ *Mask, IN CLIPOBJ *ClipRegion, IN XLATEOBJ *ColorTranslation, IN COLORADJUSTMENT *pca, IN POINTL *BrushOrigin, IN RECTL *prclDest, IN RECTL *prclSrc, IN POINTL *MaskOrigin, IN ULONG Mode, IN BRUSHOBJ *pbo, IN ROP4 Rop4)
BOOL APIENTRY EngStretchBlt(IN SURFOBJ *psoDest, IN SURFOBJ *psoSource, IN SURFOBJ *Mask, IN CLIPOBJ *ClipRegion, IN XLATEOBJ *ColorTranslation, IN COLORADJUSTMENT *pca, IN POINTL *BrushOrigin, IN RECTL *prclDest, IN RECTL *prclSrc, IN POINTL *MaskOrigin, IN ULONG Mode)
BOOLEAN(APIENTRY * PSTRETCHRECTFUNC)(SURFOBJ *OutputObj, SURFOBJ *InputObj, SURFOBJ *Mask, XLATEOBJ *ColorTranslation, RECTL *OutputRect, RECTL *InputRect, POINTL *MaskOrigin, BRUSHOBJ *pbo, POINTL *BrushOrigin, ROP4 Rop4)
BOOL APIENTRY IntEngEnter(PINTENG_ENTER_LEAVE EnterLeave, SURFOBJ *psoDest, RECTL *DestRect, BOOL ReadOnly, POINTL *Translate, SURFOBJ **ppsoOutput)
BOOL APIENTRY IntEngLeave(PINTENG_ENTER_LEAVE EnterLeave)
VOID NTAPI ProbeForRead(IN CONST VOID *Address, IN SIZE_T Length, IN ULONG Alignment)
#define BRUSHOBJ_psoPattern(pbo)
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
#define EXCEPTION_EXECUTE_HANDLER
#define ROP4_FROM_INDEX(index)
#define ROP4_USES_PATTERN(Rop4)
#define IS_VALID_ROP4(rop)
#define ROP4_USES_SOURCE(Rop4)
#define _SEH2_EXCEPT(...)
#define _SEH2_YIELD(__stmt)
PFN_DIB_StretchBlt DIB_StretchBlt
#define RtlCopyMemory(Destination, Source, Length)
#define CONTAINING_RECORD(address, type, field)
WDF_EXTERN_C_START typedef _In_ WDFDEVICE _In_ WDFCONTEXT _In_ WDF_DMA_DIRECTION Direction
DIB_FUNCTIONS DibFunctionsForBitmapFormat[]
BOOL APIENTRY IntEngBitBlt(SURFOBJ *psoTrg, SURFOBJ *psoSrc, SURFOBJ *psoMask, CLIPOBJ *pco, XLATEOBJ *pxlo, RECTL *prclTrg, POINTL *pptlSrc, POINTL *pptlMask, BRUSHOBJ *pbo, POINTL *pptlBrush, ROP4 Rop4)
#define GDIDEVFUNCS(SurfObj)
VOID FASTCALL RECTL_vMakeWellOrdered(_Inout_ RECTL *prcl)
BOOL FASTCALL RECTL_bIntersectRect(_Out_ RECTL *prclDst, _In_ const RECTL *prcl1, _In_ const RECTL *prcl2)
_Inout_ SURFOBJ _In_opt_ SURFOBJ * psoPattern
ENGAPI BOOL APIENTRY CLIPOBJ_bEnum(_In_ CLIPOBJ *pco, _In_ ULONG cj, _Out_bytecap_(cj) ULONG *pul)
_Inout_ SURFOBJ _In_opt_ SURFOBJ _In_ CLIPOBJ _In_opt_ XLATEOBJ _In_opt_ COLORADJUSTMENT * pca
_In_ SURFOBJ _In_ CLIPOBJ _In_opt_ XLATEOBJ _In_ RECTL _In_ RECTL * prclSrc
ENGAPI ULONG APIENTRY CLIPOBJ_cEnumStart(_Inout_ CLIPOBJ *pco, _In_ BOOL bAll, _In_ ULONG iType, _In_ ULONG iDirection, _In_ ULONG cLimit)
#define HOOK_STRETCHBLTROP
_In_opt_ SURFOBJ _In_opt_ SURFOBJ _In_ CLIPOBJ _In_opt_ XLATEOBJ _In_ RECTL _In_opt_ POINTL _In_opt_ POINTL _In_opt_ BRUSHOBJ * pbo
_In_ SURFOBJ _In_ CLIPOBJ _In_opt_ XLATEOBJ _In_ RECTL * prclDest