ReactOS  0.4.12-dev-75-g00dd17e
bitblt.c File Reference
#include <win32k.h>
Include dependency graph for bitblt.c:

Go to the source code of this file.

Functions

 DBG_DEFAULT_CHANNEL (GdiBlt)
 
BOOL APIENTRY NtGdiAlphaBlend (HDC hDCDest, LONG XOriginDest, LONG YOriginDest, LONG WidthDest, LONG HeightDest, HDC hDCSrc, LONG XOriginSrc, LONG YOriginSrc, LONG WidthSrc, LONG HeightSrc, BLENDFUNCTION BlendFunc, HANDLE hcmXform)
 
BOOL APIENTRY NtGdiBitBlt (HDC hDCDest, INT XDest, INT YDest, INT Width, INT Height, HDC hDCSrc, INT XSrc, INT YSrc, DWORD dwRop, IN DWORD crBackColor, IN FLONG fl)
 
BOOL APIENTRY NtGdiTransparentBlt (HDC hdcDst, INT xDst, INT yDst, INT cxDst, INT cyDst, HDC hdcSrc, INT xSrc, INT ySrc, INT cxSrc, INT cySrc, COLORREF TransColor)
 
BOOL APIENTRY NtGdiMaskBlt (HDC hdcDest, INT nXDest, INT nYDest, INT nWidth, INT nHeight, HDC hdcSrc, INT nXSrc, INT nYSrc, HBITMAP hbmMask, INT xMask, INT yMask, DWORD dwRop4, IN DWORD crBackColor)
 
BOOL APIENTRY NtGdiPlgBlt (IN HDC hdcTrg, IN LPPOINT pptlTrg, IN HDC hdcSrc, IN INT xSrc, IN INT ySrc, IN INT cxSrc, IN INT cySrc, IN HBITMAP hbmMask, IN INT xMask, IN INT yMask, IN DWORD crBackColor)
 
BOOL NTAPI GreStretchBltMask (HDC hDCDest, INT XOriginDest, INT YOriginDest, INT WidthDest, INT HeightDest, HDC hDCSrc, INT XOriginSrc, INT YOriginSrc, INT WidthSrc, INT HeightSrc, DWORD dwRop4, IN DWORD dwBackColor, HDC hDCMask, INT XOriginMask, INT YOriginMask)
 
BOOL APIENTRY NtGdiStretchBlt (HDC hDCDest, INT XOriginDest, INT YOriginDest, INT WidthDest, INT HeightDest, HDC hDCSrc, INT XOriginSrc, INT YOriginSrc, INT WidthSrc, INT HeightSrc, DWORD dwRop3, IN DWORD dwBackColor)
 
BOOL FASTCALL IntPatBlt (PDC pdc, INT XLeft, INT YLeft, INT Width, INT Height, DWORD dwRop3, PEBRUSHOBJ pebo)
 
BOOL FASTCALL IntGdiPolyPatBlt (HDC hDC, DWORD dwRop, PPATRECT pRects, INT cRects, ULONG Reserved)
 
BOOL APIENTRY NtGdiPatBlt (_In_ HDC hdcDest, _In_ INT x, _In_ INT y, _In_ INT cx, _In_ INT cy, _In_ DWORD dwRop)
 
BOOL APIENTRY NtGdiPolyPatBlt (HDC hDC, DWORD dwRop, IN PPOLYPATBLT pRects, IN DWORD cRects, IN DWORD Mode)
 
static BOOL FASTCALL REGION_LPTODP (_In_ PDC pdc, _Inout_ PREGION prgnDest, _In_ PREGION prgnSrc)
 
BOOL APIENTRY IntGdiBitBltRgn (_In_ PDC pdc, _In_ PREGION prgn, _In_opt_ BRUSHOBJ *pbo, _In_opt_ POINTL *pptlBrush, _In_ ROP4 rop4)
 
BOOL IntGdiFillRgn (_In_ PDC pdc, _In_ PREGION prgn, _In_opt_ PBRUSH pbrFill)
 
BOOL FASTCALL IntGdiPaintRgn (_In_ PDC pdc, _In_ PREGION prgn)
 
BOOL APIENTRY NtGdiFillRgn (_In_ HDC hdc, _In_ HRGN hrgn, _In_ HBRUSH hbrush)
 
BOOL APIENTRY NtGdiFrameRgn (_In_ HDC hdc, _In_ HRGN hrgn, _In_ HBRUSH hbrush, _In_ INT xWidth, _In_ INT yHeight)
 
BOOL APIENTRY NtGdiInvertRgn (_In_ HDC hdc, _In_ HRGN hrgn)
 
COLORREF APIENTRY NtGdiSetPixel (_In_ HDC hdc, _In_ INT x, _In_ INT y, _In_ COLORREF crColor)
 
COLORREF APIENTRY NtGdiGetPixel (_In_ HDC hdc, _In_ INT x, _In_ INT y)
 

Function Documentation

◆ DBG_DEFAULT_CHANNEL()

DBG_DEFAULT_CHANNEL ( GdiBlt  )

◆ GreStretchBltMask()

BOOL NTAPI GreStretchBltMask ( HDC  hDCDest,
INT  XOriginDest,
INT  YOriginDest,
INT  WidthDest,
INT  HeightDest,
HDC  hDCSrc,
INT  XOriginSrc,
INT  YOriginSrc,
INT  WidthSrc,
INT  HeightSrc,
DWORD  dwRop4,
IN DWORD  dwBackColor,
HDC  hDCMask,
INT  XOriginMask,
INT  YOriginMask 
)

Definition at line 536 of file bitblt.c.

Referenced by NtGdiStretchBlt().

552 {
553  PDC DCDest;
554  PDC DCSrc = NULL;
555  PDC DCMask = NULL;
556  HDC ahDC[3];
557  PGDIOBJ apObj[3];
558  PDC_ATTR pdcattr;
559  SURFACE *BitmapDest, *BitmapSrc = NULL;
560  SURFACE *BitmapMask = NULL;
561  RECTL DestRect;
562  RECTL SourceRect;
563  POINTL MaskPoint;
564  BOOL Status = FALSE;
565  EXLATEOBJ exlo;
566  XLATEOBJ *XlateObj = NULL;
567  POINTL BrushOrigin;
568  BOOL UsesSource;
569  BOOL UsesMask;
570  ROP4 rop4;
571 
572  rop4 = WIN32_ROP4_TO_ENG_ROP4(dwRop4);
573 
574  UsesSource = ROP4_USES_SOURCE(rop4);
575  UsesMask = ROP4_USES_MASK(rop4);
576 
577  if (0 == WidthDest || 0 == HeightDest || 0 == WidthSrc || 0 == HeightSrc)
578  {
580  return TRUE;
581  }
582 
583  if (!hDCDest || (UsesSource && !hDCSrc) || (UsesMask && !hDCMask))
584  {
586  return FALSE;
587  }
588 
589  ahDC[0] = hDCDest;
590  ahDC[1] = UsesSource ? hDCSrc : NULL;
591  ahDC[2] = UsesMask ? hDCMask : NULL;
593  {
594  WARN("Invalid dc handle (dest=0x%p, src=0x%p) passed to GreStretchBltMask\n", hDCDest, hDCSrc);
596  return FALSE;
597  }
598  DCDest = apObj[0];
599  DCSrc = apObj[1];
600  DCMask = apObj[2];
601 
602  if (DCDest->dctype == DC_TYPE_INFO)
603  {
604  if(DCSrc) GDIOBJ_vUnlockObject(&DCSrc->BaseObject);
605  if(DCMask) GDIOBJ_vUnlockObject(&DCMask->BaseObject);
606  GDIOBJ_vUnlockObject(&DCDest->BaseObject);
607  /* Yes, Windows really returns TRUE in this case */
608  return TRUE;
609  }
610 
611  if (UsesSource)
612  {
613  if (DCSrc->dctype == DC_TYPE_INFO)
614  {
615  GDIOBJ_vUnlockObject(&DCDest->BaseObject);
616  GDIOBJ_vUnlockObject(&DCSrc->BaseObject);
617  if(DCMask) GDIOBJ_vUnlockObject(&DCMask->BaseObject);
618  /* Yes, Windows really returns TRUE in this case */
619  return TRUE;
620  }
621  }
622 
623  pdcattr = DCDest->pdcattr;
624 
625  DestRect.left = XOriginDest;
626  DestRect.top = YOriginDest;
627  DestRect.right = XOriginDest+WidthDest;
628  DestRect.bottom = YOriginDest+HeightDest;
629  IntLPtoDP(DCDest, (LPPOINT)&DestRect, 2);
630 
631  DestRect.left += DCDest->ptlDCOrig.x;
632  DestRect.top += DCDest->ptlDCOrig.y;
633  DestRect.right += DCDest->ptlDCOrig.x;
634  DestRect.bottom += DCDest->ptlDCOrig.y;
635 
636  if (DCDest->fs & (DC_ACCUM_APP|DC_ACCUM_WMGR))
637  {
638  IntUpdateBoundsRect(DCDest, &DestRect);
639  }
640 
641  SourceRect.left = XOriginSrc;
642  SourceRect.top = YOriginSrc;
643  SourceRect.right = XOriginSrc+WidthSrc;
644  SourceRect.bottom = YOriginSrc+HeightSrc;
645 
646  if (UsesSource)
647  {
648  IntLPtoDP(DCSrc, (LPPOINT)&SourceRect, 2);
649 
650  SourceRect.left += DCSrc->ptlDCOrig.x;
651  SourceRect.top += DCSrc->ptlDCOrig.y;
652  SourceRect.right += DCSrc->ptlDCOrig.x;
653  SourceRect.bottom += DCSrc->ptlDCOrig.y;
654  }
655 
656  BrushOrigin.x = 0;
657  BrushOrigin.y = 0;
658 
659  /* Only prepare Source and Dest, hdcMask represents a DIB */
660  DC_vPrepareDCsForBlit(DCDest, &DestRect, DCSrc, &SourceRect);
661 
662  if (pdcattr->ulDirty_ & (DIRTY_FILL | DC_BRUSH_DIRTY))
663  DC_vUpdateFillBrush(DCDest);
664 
665  /* Determine surfaces to be used in the bitblt */
666  BitmapDest = DCDest->dclevel.pSurface;
667  if (BitmapDest == NULL)
668  goto failed;
669  if (UsesSource)
670  {
671  BitmapSrc = DCSrc->dclevel.pSurface;
672  if (BitmapSrc == NULL)
673  goto failed;
674 
675  /* Create the XLATEOBJ. */
676  EXLATEOBJ_vInitXlateFromDCs(&exlo, DCSrc, DCDest);
677  XlateObj = &exlo.xlo;
678  }
679 
680  /* Offset the brush */
681  BrushOrigin.x += DCDest->ptlDCOrig.x;
682  BrushOrigin.y += DCDest->ptlDCOrig.y;
683 
684  /* Make mask surface for source surface */
685  if (BitmapSrc && DCMask)
686  {
687  BitmapMask = DCMask->dclevel.pSurface;
688  if (BitmapMask &&
689  (BitmapMask->SurfObj.sizlBitmap.cx < WidthSrc ||
690  BitmapMask->SurfObj.sizlBitmap.cy < HeightSrc))
691  {
692  WARN("%dx%d mask is smaller than %dx%d bitmap\n",
693  BitmapMask->SurfObj.sizlBitmap.cx, BitmapMask->SurfObj.sizlBitmap.cy,
694  WidthSrc, HeightSrc);
695  EXLATEOBJ_vCleanup(&exlo);
696  goto failed;
697  }
698  /* Create mask offset point */
699  MaskPoint.x = XOriginMask;
700  MaskPoint.y = YOriginMask;
701  IntLPtoDP(DCMask, &MaskPoint, 1);
702  MaskPoint.x += DCMask->ptlDCOrig.x;
703  MaskPoint.y += DCMask->ptlDCOrig.y;
704  }
705 
706  /* Perform the bitblt operation */
707  Status = IntEngStretchBlt(&BitmapDest->SurfObj,
708  BitmapSrc ? &BitmapSrc->SurfObj : NULL,
709  BitmapMask ? &BitmapMask->SurfObj : NULL,
710  (CLIPOBJ *)&DCDest->co,
711  XlateObj,
712  &DCDest->dclevel.ca,
713  &DestRect,
714  &SourceRect,
715  BitmapMask ? &MaskPoint : NULL,
716  &DCDest->eboFill.BrushObject,
717  &BrushOrigin,
718  rop4);
719  if (UsesSource)
720  {
721  EXLATEOBJ_vCleanup(&exlo);
722  }
723 
724 failed:
725  DC_vFinishBlit(DCDest, DCSrc);
726  if (UsesSource)
727  {
728  DC_UnlockDc(DCSrc);
729  }
730  if (DCMask)
731  {
732  DC_UnlockDc(DCMask);
733  }
734  DC_UnlockDc(DCDest);
735 
736  return Status;
737 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:91
#define HDC
Definition: msvc.h:22
#define TRUE
Definition: types.h:120
SIZEL sizlBitmap
Definition: winddi.h:1209
#define WARN(fmt,...)
Definition: debug.h:111
#define ERROR_INVALID_HANDLE
Definition: compat.h:88
_In_opt_ SURFOBJ _In_opt_ SURFOBJ _In_ CLIPOBJ _In_opt_ XLATEOBJ _In_ RECTL _In_opt_ POINTL _In_opt_ POINTL _In_opt_ BRUSHOBJ _In_opt_ POINTL _In_ ROP4 rop4
Definition: winddi.h:3433
#define ROP4_USES_MASK(Rop4)
Definition: inteng.h:47
long bottom
Definition: polytest.cpp:53
ULONG ROP4
Definition: winddi.h:128
LONG y
Definition: windef.h:320
XLATEOBJ xlo
Definition: xlateobj.h:21
long right
Definition: polytest.cpp:53
VOID NTAPI EXLATEOBJ_vInitXlateFromDCs(_Out_ EXLATEOBJ *pexlo, _In_ PDC pdcSrc, _In_ PDC pdcDst)
Definition: xlateobj.c:611
long top
Definition: polytest.cpp:53
SURFOBJ SurfObj
Definition: surface.h:8
smooth NULL
Definition: ftsmooth.c:416
LONG cx
Definition: windef.h:324
#define ROP4_USES_SOURCE(Rop4)
Definition: inteng.h:45
VOID NTAPI EXLATEOBJ_vCleanup(_Inout_ PEXLATEOBJ pexlo)
Definition: xlateobj.c:649
BOOL NTAPI GDIOBJ_bLockMultipleObjects(IN ULONG ulCount, IN HGDIOBJ *ahObj, OUT PGDIOBJ *apObj, IN UCHAR objt)
Definition: gdiobj.c:1026
long left
Definition: polytest.cpp:53
ULONG ulDirty_
Definition: ntgdihdl.h:291
BOOL APIENTRY IntEngStretchBlt(SURFOBJ *DestObj, SURFOBJ *SourceObj, SURFOBJ *Mask, CLIPOBJ *ClipRegion, XLATEOBJ *ColorTranslation, COLORADJUSTMENT *pca, RECTL *DestRect, RECTL *SourceRect, POINTL *pMaskOrigin, BRUSHOBJ *Brush, POINTL *BrushOrigin, ULONG Mode)
Definition: polytest.cpp:40
unsigned int BOOL
Definition: ntddk_ex.h:94
LONG x
Definition: windef.h:319
VOID NTAPI GDIOBJ_vUnlockObject(POBJ pobj)
Definition: gdiobj.c:875
#define IntLPtoDP(pdc, ppt, count)
Definition: coord.h:7
#define DIRTY_FILL
Definition: ntgdihdl.h:145
#define WIN32_ROP4_TO_ENG_ROP4(dwRop4)
Definition: intgdi.h:5
Status
Definition: gdiplustypes.h:24
FORCEINLINE VOID DC_UnlockDc(PDC pdc)
Definition: dc.h:237
#define DC_TYPE_INFO
Definition: ntgdihdl.h:125
#define DC_BRUSH_DIRTY
Definition: ntgdihdl.h:157
VOID FASTCALL DC_vPrepareDCsForBlit(PDC pdcDest, const RECT *rcDest, PDC pdcSrc, const RECT *rcSrc)
Definition: dclife.c:497
VOID FASTCALL DC_vFinishBlit(PDC pdc1, PDC pdc2)
Definition: dclife.c:606
VOID FASTCALL IntUpdateBoundsRect(PDC, PRECTL)
Definition: dcutil.c:685
LONG cy
Definition: windef.h:325
ENGAPI VOID APIENTRY EngSetLastError(_In_ ULONG iError)
Definition: error.c:27
VOID FASTCALL DC_vUpdateFillBrush(PDC pdc)
Definition: dcobjs.c:16

◆ IntGdiBitBltRgn()

BOOL APIENTRY IntGdiBitBltRgn ( _In_ PDC  pdc,
_In_ PREGION  prgn,
_In_opt_ BRUSHOBJ pbo,
_In_opt_ POINTL pptlBrush,
_In_ ROP4  rop4 
)

Definition at line 1041 of file bitblt.c.

Referenced by NtGdiInvertRgn().

1047 {
1048  PREGION prgnClip;
1049  XCLIPOBJ xcoClip;
1050  BOOL bResult;
1051  NT_ASSERT((pdc != NULL) && (prgn != NULL));
1052 
1053  /* Check if we have a surface */
1054  if (pdc->dclevel.pSurface == NULL)
1055  {
1056  return TRUE;
1057  }
1058 
1059  /* Create an empty clip region */
1060  prgnClip = IntSysCreateRectpRgn(0, 0, 0, 0);
1061  if (prgnClip == NULL)
1062  {
1063  return FALSE;
1064  }
1065 
1066  /* Transform given region into device coordinates */
1067  if (!REGION_LPTODP(pdc, prgnClip, prgn))
1068  {
1069  REGION_Delete(prgnClip);
1070  return FALSE;
1071  }
1072 
1073  /* Intersect with the system or RAO region (these are (atm) without DC-origin) */
1074  if (pdc->prgnRao)
1075  IntGdiCombineRgn(prgnClip, prgnClip, pdc->prgnRao, RGN_AND);
1076  else
1077  IntGdiCombineRgn(prgnClip, prgnClip, pdc->prgnVis, RGN_AND);
1078 
1079  /* Now account for the DC-origin */
1080  if (!REGION_bOffsetRgn(prgnClip, pdc->ptlDCOrig.x, pdc->ptlDCOrig.y))
1081  {
1082  REGION_Delete(prgnClip);
1083  return FALSE;
1084  }
1085 
1086  if (pdc->fs & (DC_ACCUM_APP|DC_ACCUM_WMGR))
1087  {
1088  RECTL rcrgn;
1089  REGION_GetRgnBox(prgnClip, &rcrgn);
1090  IntUpdateBoundsRect(pdc, &rcrgn);
1091  }
1092 
1093  /* Prepare the DC */
1094  DC_vPrepareDCsForBlit(pdc, &prgnClip->rdh.rcBound, NULL, NULL);
1095 
1096  /* Initialize a clip object */
1097  IntEngInitClipObj(&xcoClip);
1098  IntEngUpdateClipRegion(&xcoClip,
1099  prgnClip->rdh.nCount,
1100  prgnClip->Buffer,
1101  &prgnClip->rdh.rcBound);
1102 
1103  /* Call the Eng or Drv function */
1104  bResult = IntEngBitBlt(&pdc->dclevel.pSurface->SurfObj,
1105  NULL,
1106  NULL,
1107  (CLIPOBJ *)&xcoClip,
1108  NULL,
1109  &prgnClip->rdh.rcBound,
1110  NULL,
1111  NULL,
1112  pbo,
1113  pptlBrush,
1114  rop4);
1115 
1116  /* Cleanup */
1117  DC_vFinishBlit(pdc, NULL);
1118  REGION_Delete(prgnClip);
1119  IntEngFreeClipResources(&xcoClip);
1120 
1121  /* Return the result */
1122  return bResult;
1123 }
#define TRUE
Definition: types.h:120
VOID FASTCALL IntEngInitClipObj(XCLIPOBJ *Clip)
Definition: clip.c:158
_In_opt_ SURFOBJ _In_opt_ SURFOBJ _In_ CLIPOBJ _In_opt_ XLATEOBJ _In_ RECTL _In_opt_ POINTL _In_opt_ POINTL _In_opt_ BRUSHOBJ _In_opt_ POINTL _In_ ROP4 rop4
Definition: winddi.h:3433
BOOL FASTCALL REGION_bOffsetRgn(_Inout_ PREGION prgn, _In_ INT cx, _In_ INT cy)
Definition: region.c:2686
#define RGN_AND
Definition: wingdi.h:354
VOID FASTCALL IntEngFreeClipResources(XCLIPOBJ *Clip)
Definition: clip.c:164
PREGION FASTCALL IntSysCreateRectpRgn(INT LeftRect, INT TopRect, INT RightRect, INT BottomRect)
Definition: region.c:2386
RECTL * Buffer
Definition: region.h:16
smooth NULL
Definition: ftsmooth.c:416
Definition: region.h:7
_In_opt_ SURFOBJ _In_opt_ SURFOBJ _In_ CLIPOBJ _In_opt_ XLATEOBJ _In_ RECTL _In_opt_ POINTL _In_opt_ POINTL _In_opt_ BRUSHOBJ _In_opt_ POINTL * pptlBrush
Definition: winddi.h:3433
INT FASTCALL IntGdiCombineRgn(PREGION prgnDest, PREGION prgnSrc1, PREGION prgnSrc2, INT iCombineMode)
Definition: region.c:2466
unsigned int BOOL
Definition: ntddk_ex.h:94
_In_opt_ SURFOBJ _In_opt_ SURFOBJ _In_ CLIPOBJ _In_opt_ XLATEOBJ _In_ RECTL _In_opt_ POINTL _In_opt_ POINTL _In_opt_ BRUSHOBJ * pbo
Definition: winddi.h:3433
RGNDATAHEADER rdh
Definition: region.h:15
VOID FASTCALL DC_vPrepareDCsForBlit(PDC pdcDest, const RECT *rcDest, PDC pdcSrc, const RECT *rcSrc)
Definition: dclife.c:497
VOID FASTCALL DC_vFinishBlit(PDC pdc1, PDC pdc2)
Definition: dclife.c:606
VOID FASTCALL IntUpdateBoundsRect(PDC, PRECTL)
Definition: dcutil.c:685
VOID FASTCALL IntEngUpdateClipRegion(XCLIPOBJ *Clip, ULONG count, const RECTL *pRect, const RECTL *rcBounds)
Definition: clip.c:173
INT FASTCALL REGION_GetRgnBox(PREGION Rgn, PRECTL pRect)
Definition: region.c:2521
VOID FASTCALL REGION_Delete(PREGION pRgn)
Definition: region.c:2428
static BOOL FASTCALL REGION_LPTODP(_In_ PDC pdc, _Inout_ PREGION prgnDest, _In_ PREGION prgnSrc)
Definition: bitblt.c:1028
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)
Definition: bitblt.c:604
#define NT_ASSERT
Definition: rtlfuncs.h:3312

◆ IntGdiFillRgn()

BOOL IntGdiFillRgn ( _In_ PDC  pdc,
_In_ PREGION  prgn,
_In_opt_ PBRUSH  pbrFill 
)
Todo:
Check parameters

Definition at line 1126 of file bitblt.c.

Referenced by IntGdiPaintRgn(), NtGdiFillRgn(), and PATH_FillPathEx().

1130 {
1131  PREGION prgnClip;
1132  XCLIPOBJ xcoClip;
1133  EBRUSHOBJ eboFill;
1134  BRUSHOBJ *pbo;
1135  BOOL bRet;
1136  DWORD rop2Fg;
1137  MIX mix;
1138  NT_ASSERT((pdc != NULL) && (prgn != NULL));
1139 
1140  if (pdc->dclevel.pSurface == NULL)
1141  {
1142  return TRUE;
1143  }
1144 
1145  prgnClip = IntSysCreateRectpRgn(0, 0, 0, 0);
1146  if (prgnClip == NULL)
1147  {
1148  return FALSE;
1149  }
1150 
1151  /* Transform region into device coordinates */
1152  if (!REGION_LPTODP(pdc, prgnClip, prgn))
1153  {
1154  REGION_Delete(prgnClip);
1155  return FALSE;
1156  }
1157 
1158  /* Intersect with the system or RAO region (these are (atm) without DC-origin) */
1159  if (pdc->prgnRao)
1160  IntGdiCombineRgn(prgnClip, prgnClip, pdc->prgnRao, RGN_AND);
1161  else
1162  IntGdiCombineRgn(prgnClip, prgnClip, pdc->prgnVis, RGN_AND);
1163 
1164  /* Now account for the DC-origin */
1165  if (!REGION_bOffsetRgn(prgnClip, pdc->ptlDCOrig.x, pdc->ptlDCOrig.y))
1166  {
1167  REGION_Delete(prgnClip);
1168  return FALSE;
1169  }
1170 
1171  if (pdc->fs & (DC_ACCUM_APP|DC_ACCUM_WMGR))
1172  {
1173  RECTL rcrgn;
1174  REGION_GetRgnBox(prgnClip, &rcrgn);
1175  IntUpdateBoundsRect(pdc, &rcrgn);
1176  }
1177 
1178  IntEngInitClipObj(&xcoClip);
1179  IntEngUpdateClipRegion(&xcoClip,
1180  prgnClip->rdh.nCount,
1181  prgnClip->Buffer,
1182  &prgnClip->rdh.rcBound );
1183 
1184  /* Get the FG rop and create a MIX based on the BK mode */
1185  rop2Fg = FIXUP_ROP2(pdc->pdcattr->jROP2);
1186  mix = rop2Fg | (pdc->pdcattr->jBkMode == OPAQUE ? rop2Fg : R2_NOP) << 8;
1187 
1188  /* Prepare DC for blit */
1189  DC_vPrepareDCsForBlit(pdc, &prgnClip->rdh.rcBound, NULL, NULL);
1190 
1191  /* Check if we have a fill brush */
1192  if (pbrFill != NULL)
1193  {
1194  /* Initialize the brush object */
1196  EBRUSHOBJ_vInit(&eboFill, pbrFill, pdc->dclevel.pSurface, 0x00FFFFFF, 0, NULL);
1197  pbo = &eboFill.BrushObject;
1198  }
1199  else
1200  {
1201  /* Update the fill brush if needed */
1202  if (pdc->pdcattr->ulDirty_ & (DIRTY_FILL | DC_BRUSH_DIRTY))
1203  DC_vUpdateFillBrush(pdc);
1204 
1205  /* Use the DC brush object */
1206  pbo = &pdc->eboFill.BrushObject;
1207  }
1208 
1209  /* Call the internal function */
1210  bRet = IntEngPaint(&pdc->dclevel.pSurface->SurfObj,
1211  (CLIPOBJ *)&xcoClip,
1212  pbo,
1213  &pdc->pdcattr->ptlBrushOrigin,
1214  mix);
1215 
1216  DC_vFinishBlit(pdc, NULL);
1217  REGION_Delete(prgnClip);
1218  IntEngFreeClipResources(&xcoClip);
1219 
1220  // Fill the region
1221  return bRet;
1222 }
BOOL APIENTRY IntEngPaint(_In_ SURFOBJ *pso, _In_ CLIPOBJ *pco, _In_ BRUSHOBJ *pbo, _In_ POINTL *pptlBrushOrg, _In_ __in_data_source(USER_MODE) MIX mix)
Definition: paint.c:85
#define TRUE
Definition: types.h:120
#define FIXUP_ROP2(rop2)
Definition: intgdi.h:10
VOID FASTCALL IntEngInitClipObj(XCLIPOBJ *Clip)
Definition: clip.c:158
ULONG MIX
Definition: winddi.h:129
#define R2_NOP
Definition: wingdi.h:344
BOOL FASTCALL REGION_bOffsetRgn(_Inout_ PREGION prgn, _In_ INT cx, _In_ INT cy)
Definition: region.c:2686
#define RGN_AND
Definition: wingdi.h:354
VOID NTAPI EBRUSHOBJ_vInit(EBRUSHOBJ *pebo, PBRUSH pbrush, PSURFACE psurf, COLORREF crBackgroundClr, COLORREF crForegroundClr, PPALETTE ppalDC)
Definition: engbrush.c:52
VOID FASTCALL IntEngFreeClipResources(XCLIPOBJ *Clip)
Definition: clip.c:164
PREGION FASTCALL IntSysCreateRectpRgn(INT LeftRect, INT TopRect, INT RightRect, INT BottomRect)
Definition: region.c:2386
RECTL * Buffer
Definition: region.h:16
smooth NULL
Definition: ftsmooth.c:416
Definition: region.h:7
INT FASTCALL IntGdiCombineRgn(PREGION prgnDest, PREGION prgnSrc1, PREGION prgnSrc2, INT iCombineMode)
Definition: region.c:2466
unsigned int BOOL
Definition: ntddk_ex.h:94
_In_opt_ SURFOBJ _In_opt_ SURFOBJ _In_ CLIPOBJ _In_opt_ XLATEOBJ _In_ RECTL _In_opt_ POINTL _In_opt_ POINTL _In_opt_ BRUSHOBJ * pbo
Definition: winddi.h:3433
BRUSHOBJ BrushObject
Definition: brush.h:67
unsigned long DWORD
Definition: ntddk_ex.h:95
#define DIRTY_FILL
Definition: ntgdihdl.h:145
#define OPAQUE
Definition: wingdi.h:947
RGNDATAHEADER rdh
Definition: region.h:15
_In_ PATHOBJ _In_ CLIPOBJ _In_ BRUSHOBJ _In_ POINTL _In_ MIX mix
Definition: winddi.h:3591
#define DC_BRUSH_DIRTY
Definition: ntgdihdl.h:157
VOID FASTCALL DC_vPrepareDCsForBlit(PDC pdcDest, const RECT *rcDest, PDC pdcSrc, const RECT *rcSrc)
Definition: dclife.c:497
VOID FASTCALL DC_vFinishBlit(PDC pdc1, PDC pdc2)
Definition: dclife.c:606
VOID FASTCALL IntUpdateBoundsRect(PDC, PRECTL)
Definition: dcutil.c:685
VOID FASTCALL IntEngUpdateClipRegion(XCLIPOBJ *Clip, ULONG count, const RECTL *pRect, const RECTL *rcBounds)
Definition: clip.c:173
INT FASTCALL REGION_GetRgnBox(PREGION Rgn, PRECTL pRect)
Definition: region.c:2521
VOID FASTCALL REGION_Delete(PREGION pRgn)
Definition: region.c:2428
static BOOL FASTCALL REGION_LPTODP(_In_ PDC pdc, _Inout_ PREGION prgnDest, _In_ PREGION prgnSrc)
Definition: bitblt.c:1028
VOID FASTCALL DC_vUpdateFillBrush(PDC pdc)
Definition: dcobjs.c:16
#define NT_ASSERT
Definition: rtlfuncs.h:3312

◆ IntGdiPaintRgn()

BOOL FASTCALL IntGdiPaintRgn ( _In_ PDC  pdc,
_In_ PREGION  prgn 
)

Definition at line 1226 of file bitblt.c.

1229 {
1230  return IntGdiFillRgn(pdc, prgn, NULL);
1231 }
smooth NULL
Definition: ftsmooth.c:416
BOOL IntGdiFillRgn(_In_ PDC pdc, _In_ PREGION prgn, _In_opt_ PBRUSH pbrFill)
Definition: bitblt.c:1126

◆ IntGdiPolyPatBlt()

BOOL FASTCALL IntGdiPolyPatBlt ( HDC  hDC,
DWORD  dwRop,
PPATRECT  pRects,
INT  cRects,
ULONG  Reserved 
)

Definition at line 865 of file bitblt.c.

Referenced by NtGdiPolyPatBlt().

871 {
872  INT i;
873  PBRUSH pbrush;
874  PDC pdc;
875  EBRUSHOBJ eboFill;
876 
877  pdc = DC_LockDc(hDC);
878  if (!pdc)
879  {
881  return FALSE;
882  }
883 
884  if (pdc->dctype == DC_TYPE_INFO)
885  {
886  DC_UnlockDc(pdc);
887  /* Yes, Windows really returns TRUE in this case */
888  return TRUE;
889  }
890 
891  for (i = 0; i < cRects; i++)
892  {
893  pbrush = BRUSH_ShareLockBrush(pRects->hBrush);
894 
895  /* Check if we could lock the brush */
896  if (pbrush != NULL)
897  {
898  /* Initialize a brush object */
899  EBRUSHOBJ_vInitFromDC(&eboFill, pbrush, pdc);
900 
901  IntPatBlt(
902  pdc,
903  pRects->r.left,
904  pRects->r.top,
905  pRects->r.right,
906  pRects->r.bottom,
907  dwRop,
908  &eboFill);
909 
910  /* Cleanup the brush object and unlock the brush */
911  EBRUSHOBJ_vCleanup(&eboFill);
912  BRUSH_ShareUnlockBrush(pbrush);
913  }
914  pRects++;
915  }
916 
917  DC_UnlockDc(pdc);
918 
919  return TRUE;
920 }
#define BRUSH_ShareUnlockBrush(pBrush)
Definition: brush.h:114
#define TRUE
Definition: types.h:120
VOID NTAPI EBRUSHOBJ_vCleanup(EBRUSHOBJ *pebo)
Definition: engbrush.c:153
FORCEINLINE PDC DC_LockDc(HDC hdc)
Definition: dc.h:219
#define BRUSH_ShareLockBrush(hBrush)
Definition: brush.h:113
#define ERROR_INVALID_HANDLE
Definition: compat.h:88
LONG top
Definition: windef.h:297
LONG left
Definition: windef.h:296
LONG right
Definition: windef.h:298
int32_t INT
Definition: typedefs.h:56
GLenum GLclampf GLint i
Definition: glfuncs.h:14
smooth NULL
Definition: ftsmooth.c:416
Definition: types.h:100
BOOL FASTCALL IntPatBlt(PDC pdc, INT XLeft, INT YLeft, INT Width, INT Height, DWORD dwRop3, PEBRUSHOBJ pebo)
Definition: bitblt.c:777
HBRUSH hBrush
Definition: ntgdityp.h:479
RECT r
Definition: ntgdityp.h:478
Definition: polytest.cpp:40
static HDC hDC
Definition: 3dtext.c:33
VOID NTAPI EBRUSHOBJ_vInitFromDC(EBRUSHOBJ *pebo, PBRUSH pbrush, PDC pdc)
Definition: engbrush.c:112
FORCEINLINE VOID DC_UnlockDc(PDC pdc)
Definition: dc.h:237
#define DC_TYPE_INFO
Definition: ntgdihdl.h:125
LONG bottom
Definition: windef.h:299
ENGAPI VOID APIENTRY EngSetLastError(_In_ ULONG iError)
Definition: error.c:27

◆ IntPatBlt()

BOOL FASTCALL IntPatBlt ( PDC  pdc,
INT  XLeft,
INT  YLeft,
INT  Width,
INT  Height,
DWORD  dwRop3,
PEBRUSHOBJ  pebo 
)

Definition at line 777 of file bitblt.c.

Referenced by IntGdiPolyPatBlt(), NtGdiPatBlt(), and NtGdiSetPixel().

785 {
786  RECTL DestRect;
787  SURFACE *psurf;
788  POINTL BrushOrigin;
789  BOOL ret;
790  PBRUSH pbrush;
791 
792  ASSERT(pebo);
793  pbrush = pebo->pbrush;
794  ASSERT(pbrush);
795 
796  if (pbrush->flAttrs & BR_IS_NULL)
797  {
798  return TRUE;
799  }
800 
801  if (Width > 0)
802  {
803  DestRect.left = XLeft;
804  DestRect.right = XLeft + Width;
805  }
806  else
807  {
808  DestRect.left = XLeft + Width + 1;
809  DestRect.right = XLeft + 1;
810  }
811 
812  if (Height > 0)
813  {
814  DestRect.top = YLeft;
815  DestRect.bottom = YLeft + Height;
816  }
817  else
818  {
819  DestRect.top = YLeft + Height + 1;
820  DestRect.bottom = YLeft + 1;
821  }
822 
823  IntLPtoDP(pdc, (LPPOINT)&DestRect, 2);
824 
825  DestRect.left += pdc->ptlDCOrig.x;
826  DestRect.top += pdc->ptlDCOrig.y;
827  DestRect.right += pdc->ptlDCOrig.x;
828  DestRect.bottom += pdc->ptlDCOrig.y;
829 
830  if (pdc->fs & (DC_ACCUM_APP|DC_ACCUM_WMGR))
831  {
832  IntUpdateBoundsRect(pdc, &DestRect);
833  }
834 
835 #ifdef _USE_DIBLIB_
836  BrushOrigin.x = pbrush->ptOrigin.x + pdc->ptlDCOrig.x + XLeft;
837  BrushOrigin.y = pbrush->ptOrigin.y + pdc->ptlDCOrig.y + YLeft;
838 #else
839  BrushOrigin.x = pbrush->ptOrigin.x + pdc->ptlDCOrig.x;
840  BrushOrigin.y = pbrush->ptOrigin.y + pdc->ptlDCOrig.y;
841 #endif
842 
843  DC_vPrepareDCsForBlit(pdc, &DestRect, NULL, NULL);
844 
845  psurf = pdc->dclevel.pSurface;
846 
847  ret = IntEngBitBlt(&psurf->SurfObj,
848  NULL,
849  NULL,
850  (CLIPOBJ *)&pdc->co,
851  NULL,
852  &DestRect,
853  NULL,
854  NULL,
855  &pebo->BrushObject,
856  &BrushOrigin,
857  WIN32_ROP3_TO_ENG_ROP4(dwRop3));
858 
859  DC_vFinishBlit(pdc, NULL);
860 
861  return ret;
862 }
#define TRUE
Definition: types.h:120
long bottom
Definition: polytest.cpp:53
LONG y
Definition: windef.h:320
long right
Definition: polytest.cpp:53
long top
Definition: polytest.cpp:53
SURFOBJ SurfObj
Definition: surface.h:8
#define WIN32_ROP3_TO_ENG_ROP4(dwRop4)
Definition: intgdi.h:4
smooth NULL
Definition: ftsmooth.c:416
PBRUSH pbrush
Definition: brush.h:84
long left
Definition: polytest.cpp:53
Definition: types.h:100
unsigned int BOOL
Definition: ntddk_ex.h:94
BRUSHOBJ BrushObject
Definition: brush.h:67
#define BR_IS_NULL
Definition: brush.h:101
LONG x
Definition: windef.h:319
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
#define IntLPtoDP(pdc, ppt, count)
Definition: coord.h:7
int ret
VOID FASTCALL DC_vPrepareDCsForBlit(PDC pdcDest, const RECT *rcDest, PDC pdcSrc, const RECT *rcSrc)
Definition: dclife.c:497
VOID FASTCALL DC_vFinishBlit(PDC pdc1, PDC pdc2)
Definition: dclife.c:606
VOID FASTCALL IntUpdateBoundsRect(PDC, PRECTL)
Definition: dcutil.c:685
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)
Definition: bitblt.c:604

◆ NtGdiAlphaBlend()

BOOL APIENTRY NtGdiAlphaBlend ( HDC  hDCDest,
LONG  XOriginDest,
LONG  YOriginDest,
LONG  WidthDest,
LONG  HeightDest,
HDC  hDCSrc,
LONG  XOriginSrc,
LONG  YOriginSrc,
LONG  WidthSrc,
LONG  HeightSrc,
BLENDFUNCTION  BlendFunc,
HANDLE  hcmXform 
)

Definition at line 13 of file bitblt.c.

26 {
27  PDC DCDest;
28  PDC DCSrc;
29  HDC ahDC[2];
30  PGDIOBJ apObj[2];
31  SURFACE *BitmapDest, *BitmapSrc;
32  RECTL DestRect, SourceRect;
33  BOOL bResult;
34  EXLATEOBJ exlo;
35  BLENDOBJ BlendObj;
36  BlendObj.BlendFunction = BlendFunc;
37 
38  if (WidthDest < 0 || HeightDest < 0 || WidthSrc < 0 || HeightSrc < 0)
39  {
41  return FALSE;
42  }
43 
44  if ((hDCDest == NULL) || (hDCSrc == NULL))
45  {
47  return FALSE;
48  }
49 
50  TRACE("Locking DCs\n");
51  ahDC[0] = hDCDest;
52  ahDC[1] = hDCSrc ;
54  {
55  WARN("Invalid dc handle (dest=0x%p, src=0x%p) passed to NtGdiAlphaBlend\n", hDCDest, hDCSrc);
57  return FALSE;
58  }
59  DCDest = apObj[0];
60  DCSrc = apObj[1];
61 
62  if (DCDest->dctype == DC_TYPE_INFO || DCDest->dctype == DCTYPE_INFO)
63  {
64  GDIOBJ_vUnlockObject(&DCSrc->BaseObject);
65  GDIOBJ_vUnlockObject(&DCDest->BaseObject);
66  /* Yes, Windows really returns TRUE in this case */
67  return TRUE;
68  }
69 
70  DestRect.left = XOriginDest;
71  DestRect.top = YOriginDest;
72  DestRect.right = XOriginDest + WidthDest;
73  DestRect.bottom = YOriginDest + HeightDest;
74  IntLPtoDP(DCDest, (LPPOINT)&DestRect, 2);
75 
76  DestRect.left += DCDest->ptlDCOrig.x;
77  DestRect.top += DCDest->ptlDCOrig.y;
78  DestRect.right += DCDest->ptlDCOrig.x;
79  DestRect.bottom += DCDest->ptlDCOrig.y;
80 
81  if (DCDest->fs & (DC_ACCUM_APP|DC_ACCUM_WMGR))
82  {
83  IntUpdateBoundsRect(DCDest, &DestRect);
84  }
85 
86  SourceRect.left = XOriginSrc;
87  SourceRect.top = YOriginSrc;
88  SourceRect.right = XOriginSrc + WidthSrc;
89  SourceRect.bottom = YOriginSrc + HeightSrc;
90  IntLPtoDP(DCSrc, (LPPOINT)&SourceRect, 2);
91 
92  SourceRect.left += DCSrc->ptlDCOrig.x;
93  SourceRect.top += DCSrc->ptlDCOrig.y;
94  SourceRect.right += DCSrc->ptlDCOrig.x;
95  SourceRect.bottom += DCSrc->ptlDCOrig.y;
96 
97  if (!DestRect.right ||
98  !DestRect.bottom ||
99  !SourceRect.right ||
100  !SourceRect.bottom)
101  {
102  GDIOBJ_vUnlockObject(&DCSrc->BaseObject);
103  GDIOBJ_vUnlockObject(&DCDest->BaseObject);
104  return TRUE;
105  }
106 
107  /* Prepare DCs for blit */
108  TRACE("Preparing DCs for blit\n");
109  DC_vPrepareDCsForBlit(DCDest, &DestRect, DCSrc, &SourceRect);
110 
111  /* Determine surfaces to be used in the bitblt */
112  BitmapDest = DCDest->dclevel.pSurface;
113  if (!BitmapDest)
114  {
115  bResult = FALSE ;
116  goto leave ;
117  }
118 
119  BitmapSrc = DCSrc->dclevel.pSurface;
120  if (!BitmapSrc)
121  {
122  bResult = FALSE;
123  goto leave;
124  }
125 
126  /* Create the XLATEOBJ. */
127  EXLATEOBJ_vInitXlateFromDCs(&exlo, DCSrc, DCDest);
128 
129  /* Perform the alpha blend operation */
130  TRACE("Performing the alpha blend\n");
131  bResult = IntEngAlphaBlend(&BitmapDest->SurfObj,
132  &BitmapSrc->SurfObj,
133  (CLIPOBJ *)&DCDest->co,
134  &exlo.xlo,
135  &DestRect,
136  &SourceRect,
137  &BlendObj);
138 
139  EXLATEOBJ_vCleanup(&exlo);
140 leave :
141  TRACE("Finishing blit\n");
142  DC_vFinishBlit(DCDest, DCSrc);
143  GDIOBJ_vUnlockObject(&DCSrc->BaseObject);
144  GDIOBJ_vUnlockObject(&DCDest->BaseObject);
145 
146  return bResult;
147 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:91
#define HDC
Definition: msvc.h:22
BOOL APIENTRY IntEngAlphaBlend(_Inout_ SURFOBJ *psoDest, _In_ SURFOBJ *psoSource, _In_opt_ CLIPOBJ *pco, _In_opt_ XLATEOBJ *pxlo, _In_ RECTL *prclDest, _In_ RECTL *prclSrc, _In_ BLENDOBJ *pBlendObj)
Definition: alphablend.c:196
#define TRUE
Definition: types.h:120
#define WARN(fmt,...)
Definition: debug.h:111
#define ERROR_INVALID_HANDLE
Definition: compat.h:88
long bottom
Definition: polytest.cpp:53
XLATEOBJ xlo
Definition: xlateobj.h:21
long right
Definition: polytest.cpp:53
VOID NTAPI EXLATEOBJ_vInitXlateFromDCs(_Out_ EXLATEOBJ *pexlo, _In_ PDC pdcSrc, _In_ PDC pdcDst)
Definition: xlateobj.c:611
long top
Definition: polytest.cpp:53
SURFOBJ SurfObj
Definition: surface.h:8
smooth NULL
Definition: ftsmooth.c:416
VOID NTAPI EXLATEOBJ_vCleanup(_Inout_ PEXLATEOBJ pexlo)
Definition: xlateobj.c:649
BOOL NTAPI GDIOBJ_bLockMultipleObjects(IN ULONG ulCount, IN HGDIOBJ *ahObj, OUT PGDIOBJ *apObj, IN UCHAR objt)
Definition: gdiobj.c:1026
long left
Definition: polytest.cpp:53
#define TRACE(s)
Definition: solgame.cpp:4
Definition: polytest.cpp:40
unsigned int BOOL
Definition: ntddk_ex.h:94
VOID NTAPI GDIOBJ_vUnlockObject(POBJ pobj)
Definition: gdiobj.c:875
#define IntLPtoDP(pdc, ppt, count)
Definition: coord.h:7
Definition: dc.h:43
#define DC_TYPE_INFO
Definition: ntgdihdl.h:125
VOID FASTCALL DC_vPrepareDCsForBlit(PDC pdcDest, const RECT *rcDest, PDC pdcSrc, const RECT *rcSrc)
Definition: dclife.c:497
VOID FASTCALL DC_vFinishBlit(PDC pdc1, PDC pdc2)
Definition: dclife.c:606
VOID FASTCALL IntUpdateBoundsRect(PDC, PRECTL)
Definition: dcutil.c:685
BLENDFUNCTION BlendFunc
Definition: general.c:32
BLENDFUNCTION BlendFunction
Definition: winddi.h:224
ENGAPI VOID APIENTRY EngSetLastError(_In_ ULONG iError)
Definition: error.c:27

◆ NtGdiBitBlt()

BOOL APIENTRY NtGdiBitBlt ( HDC  hDCDest,
INT  XDest,
INT  YDest,
INT  Width,
INT  Height,
HDC  hDCSrc,
INT  XSrc,
INT  YSrc,
DWORD  dwRop,
IN DWORD  crBackColor,
IN FLONG  fl 
)

Definition at line 150 of file bitblt.c.

162 {
163 
164  if (dwRop & CAPTUREBLT)
165  {
166  return NtGdiStretchBlt(hDCDest,
167  XDest,
168  YDest,
169  Width,
170  Height,
171  hDCSrc,
172  XSrc,
173  YSrc,
174  Width,
175  Height,
176  dwRop,
177  crBackColor);
178  }
179 
180  dwRop = dwRop & ~(NOMIRRORBITMAP|CAPTUREBLT);
181 
182  /* Forward to NtGdiMaskBlt */
183  // TODO: What's fl for? LOL not to send this to MaskBit!
184  return NtGdiMaskBlt(hDCDest,
185  XDest,
186  YDest,
187  Width,
188  Height,
189  hDCSrc,
190  XSrc,
191  YSrc,
192  NULL,
193  0,
194  0,
195  MAKEROP4(dwRop, dwRop),
196  crBackColor);
197 }
#define NOMIRRORBITMAP
Definition: wingdi.h:1358
smooth NULL
Definition: ftsmooth.c:416
#define MAKEROP4(f, b)
Definition: wingdi.h:2923
BOOL APIENTRY NtGdiMaskBlt(HDC hdcDest, INT nXDest, INT nYDest, INT nWidth, INT nHeight, HDC hdcSrc, INT nXSrc, INT nYSrc, HBITMAP hbmMask, INT xMask, INT yMask, DWORD dwRop4, IN DWORD crBackColor)
Definition: bitblt.c:312
BOOL APIENTRY NtGdiStretchBlt(HDC hDCDest, INT XOriginDest, INT YOriginDest, INT WidthDest, INT HeightDest, HDC hDCSrc, INT XOriginSrc, INT YOriginSrc, INT WidthSrc, INT HeightSrc, DWORD dwRop3, IN DWORD dwBackColor)
Definition: bitblt.c:741
#define CAPTUREBLT
Definition: wingdi.h:1357

◆ NtGdiFillRgn()

BOOL APIENTRY NtGdiFillRgn ( _In_ HDC  hdc,
_In_ HRGN  hrgn,
_In_ HBRUSH  hbrush 
)

Definition at line 1235 of file bitblt.c.

Referenced by FillRgn(), and NtGdiFrameRgn().

1239 {
1240  PDC pdc;
1241  PREGION prgn;
1242  PBRUSH pbrFill;
1243  BOOL bResult;
1244 
1245  /* Lock the DC */
1246  pdc = DC_LockDc(hdc);
1247  if (pdc == NULL)
1248  {
1249  ERR("Failed to lock hdc %p\n", hdc);
1250  return FALSE;
1251  }
1252 
1253  /* Check if the DC has no surface (empty mem or info DC) */
1254  if (pdc->dclevel.pSurface == NULL)
1255  {
1256  DC_UnlockDc(pdc);
1257  return TRUE;
1258  }
1259 
1260  /* Lock the region */
1261  prgn = REGION_LockRgn(hrgn);
1262  if (prgn == NULL)
1263  {
1264  ERR("Failed to lock hrgn %p\n", hrgn);
1265  DC_UnlockDc(pdc);
1266  return FALSE;
1267  }
1268 
1269  /* Lock the brush */
1270  pbrFill = BRUSH_ShareLockBrush(hbrush);
1271  if (pbrFill == NULL)
1272  {
1273  ERR("Failed to lock hbrush %p\n", hbrush);
1274  REGION_UnlockRgn(prgn);
1275  DC_UnlockDc(pdc);
1276  return FALSE;
1277  }
1278 
1279  /* Call the internal function */
1280  bResult = IntGdiFillRgn(pdc, prgn, pbrFill);
1281 
1282  /* Cleanup locks */
1283  BRUSH_ShareUnlockBrush(pbrFill);
1284  REGION_UnlockRgn(prgn);
1285  DC_UnlockDc(pdc);
1286 
1287  return bResult;
1288 }
#define BRUSH_ShareUnlockBrush(pBrush)
Definition: brush.h:114
#define TRUE
Definition: types.h:120
static HBRUSH hbrush
FORCEINLINE PDC DC_LockDc(HDC hdc)
Definition: dc.h:219
#define BRUSH_ShareLockBrush(hBrush)
Definition: brush.h:113
PREGION FASTCALL REGION_LockRgn(_In_ HRGN hrgn)
Definition: region.c:2337
HDC hdc
Definition: msvc.h:53
smooth NULL
Definition: ftsmooth.c:416
Definition: region.h:7
Definition: types.h:100
Definition: polytest.cpp:40
unsigned int BOOL
Definition: ntddk_ex.h:94
static HRGN hrgn
Definition: win.c:55
#define ERR(fmt,...)
Definition: debug.h:109
BOOL IntGdiFillRgn(_In_ PDC pdc, _In_ PREGION prgn, _In_opt_ PBRUSH pbrFill)
Definition: bitblt.c:1126
FORCEINLINE VOID DC_UnlockDc(PDC pdc)
Definition: dc.h:237
VOID FASTCALL REGION_UnlockRgn(_In_ PREGION prgn)
Definition: region.c:2352

◆ NtGdiFrameRgn()

BOOL APIENTRY NtGdiFrameRgn ( _In_ HDC  hdc,
_In_ HRGN  hrgn,
_In_ HBRUSH  hbrush,
_In_ INT  xWidth,
_In_ INT  yHeight 
)

Definition at line 1292 of file bitblt.c.

Referenced by FrameRgn().

1298 {
1299  HRGN hrgnFrame;
1300  BOOL bResult;
1301 
1302  hrgnFrame = GreCreateFrameRgn(hrgn, xWidth, yHeight);
1303  if (hrgnFrame == NULL)
1304  {
1305  return FALSE;
1306  }
1307 
1308  bResult = NtGdiFillRgn(hdc, hrgnFrame, hbrush);
1309 
1310  GreDeleteObject(hrgnFrame);
1311  return bResult;
1312 }
BOOL NTAPI GreDeleteObject(HGDIOBJ hobj)
Definition: gdiobj.c:1153
static HBRUSH hbrush
#define HRGN
Definition: msvc.h:39
HDC hdc
Definition: msvc.h:53
smooth NULL
Definition: ftsmooth.c:416
unsigned int BOOL
Definition: ntddk_ex.h:94
HRGN FASTCALL GreCreateFrameRgn(HRGN hrgn, INT cx, INT cy)
Definition: region.c:2002
BOOL APIENTRY NtGdiFillRgn(_In_ HDC hdc, _In_ HRGN hrgn, _In_ HBRUSH hbrush)
Definition: bitblt.c:1235
static HRGN hrgn
Definition: win.c:55
HBITMAP INT INT yHeight
Definition: msvc.h:60
HBITMAP INT xWidth
Definition: msvc.h:60

◆ NtGdiGetPixel()

COLORREF APIENTRY NtGdiGetPixel ( _In_ HDC  hdc,
_In_ INT  x,
_In_ INT  y 
)

Definition at line 1452 of file bitblt.c.

Referenced by GetPixel(), and START_TEST().

1456 {
1457  PDC pdc;
1458  ULONG ulRGBColor = CLR_INVALID;
1459  POINTL ptlSrc;
1460  RECT rcDest;
1461  PSURFACE psurfSrc, psurfDest;
1462 
1463  /* Lock the DC */
1464  pdc = DC_LockDc(hdc);
1465  if (!pdc)
1466  {
1468  return CLR_INVALID;
1469  }
1470 
1471  /* Check if the DC has no surface (empty mem or info DC) */
1472  if (pdc->dclevel.pSurface == NULL)
1473  {
1474  /* Fail! */
1475  goto leave;
1476  }
1477 
1478  /* Get the logical coordinates */
1479  ptlSrc.x = x;
1480  ptlSrc.y = y;
1481 
1482  /* Translate coordinates to device coordinates */
1483  IntLPtoDP(pdc, &ptlSrc, 1);
1484  ptlSrc.x += pdc->ptlDCOrig.x;
1485  ptlSrc.y += pdc->ptlDCOrig.y;
1486 
1487  rcDest.left = x;
1488  rcDest.top = y;
1489  rcDest.right = x + 1;
1490  rcDest.bottom = y + 1;
1491 
1492  /* Prepare DC for blit */
1493  DC_vPrepareDCsForBlit(pdc, &rcDest, NULL, NULL);
1494 
1495  /* Check if the pixel is outside the surface */
1496  psurfSrc = pdc->dclevel.pSurface;
1497  if ((ptlSrc.x >= psurfSrc->SurfObj.sizlBitmap.cx) ||
1498  (ptlSrc.y >= psurfSrc->SurfObj.sizlBitmap.cy) ||
1499  (ptlSrc.x < 0) ||
1500  (ptlSrc.y < 0))
1501  {
1502  /* Fail! */
1503  goto leave;
1504  }
1505 
1506  /* Allocate a surface */
1507  psurfDest = SURFACE_AllocSurface(STYPE_BITMAP,
1508  1,
1509  1,
1510  BMF_32BPP,
1511  0,
1512  0,
1513  0,
1514  &ulRGBColor);
1515  if (psurfDest)
1516  {
1517  RECTL rclDest = {0, 0, 1, 1};
1518  EXLATEOBJ exlo;
1519 
1520  /* Translate from the source palette to RGB color */
1521  EXLATEOBJ_vInitialize(&exlo,
1522  psurfSrc->ppal,
1523  &gpalRGB,
1524  0,
1525  RGB(0xff,0xff,0xff),
1526  RGB(0,0,0));
1527 
1528  /* Call the copy bits function */
1529  EngCopyBits(&psurfDest->SurfObj,
1530  &psurfSrc->SurfObj,
1531  NULL,
1532  &exlo.xlo,
1533  &rclDest,
1534  &ptlSrc);
1535 
1536  /* Cleanup the XLATEOBJ */
1537  EXLATEOBJ_vCleanup(&exlo);
1538 
1539  /* Delete the surface */
1540  GDIOBJ_vDeleteObject(&psurfDest->BaseObject);
1541  }
1542 
1543 leave:
1544 
1545  /* Unlock the DC */
1546  DC_vFinishBlit(pdc, NULL);
1547  DC_UnlockDc(pdc);
1548 
1549  /* Return the new RGB color or -1 on failure */
1550  return ulRGBColor;
1551 }
SIZEL sizlBitmap
Definition: winddi.h:1209
#define BMF_32BPP
Definition: winddi.h:360
FORCEINLINE PDC DC_LockDc(HDC hdc)
Definition: dc.h:219
#define STYPE_BITMAP
Definition: winddi.h:1175
#define ERROR_INVALID_HANDLE
Definition: compat.h:88
#define CLR_INVALID
Definition: wingdi.h:881
struct _PALETTE *const ppal
Definition: surface.h:11
LONG top
Definition: windef.h:297
LONG left
Definition: windef.h:296
LONG right
Definition: windef.h:298
LONG y
Definition: windef.h:320
INT INT y
Definition: msvc.h:62
XLATEOBJ xlo
Definition: xlateobj.h:21
VOID NTAPI EXLATEOBJ_vInitialize(_Out_ PEXLATEOBJ pexlo, _In_opt_ PALETTE *ppalSrc, _In_opt_ PALETTE *ppalDst, _In_ COLORREF crSrcBackColor, _In_ COLORREF crDstBackColor, _In_ COLORREF crDstForeColor)
Definition: xlateobj.c:358
SURFOBJ SurfObj
Definition: surface.h:8
HDC hdc
Definition: msvc.h:53
smooth NULL
Definition: ftsmooth.c:416
LONG cx
Definition: windef.h:324
VOID NTAPI EXLATEOBJ_vCleanup(_Inout_ PEXLATEOBJ pexlo)
Definition: xlateobj.c:649
BASEOBJECT BaseObject
Definition: surface.h:6
Definition: polytest.cpp:40
VOID NTAPI GDIOBJ_vDeleteObject(POBJ pobj)
Definition: gdiobj.c:1106
#define RGB(r, g, b)
Definition: wingdi.h:2917
LONG x
Definition: windef.h:319
PSURFACE NTAPI SURFACE_AllocSurface(_In_ USHORT iType, _In_ ULONG cx, _In_ ULONG cy, _In_ ULONG iFormat, _In_ ULONG fjBitmap, _In_opt_ ULONG cjWidth, _In_opt_ ULONG cjBufSize, _In_opt_ PVOID pvBits)
Definition: surface.c:116
#define IntLPtoDP(pdc, ppt, count)
Definition: coord.h:7
ENGAPI BOOL APIENTRY EngCopyBits(_In_ SURFOBJ *psoDest, _In_ SURFOBJ *psoSrc, _In_opt_ CLIPOBJ *pco, _In_opt_ XLATEOBJ *pxlo, _In_ __in_data_source(USER_MODE) RECTL *prclDest, _In_ __in_data_source(USER_MODE) POINTL *pptlSrc)
FORCEINLINE VOID DC_UnlockDc(PDC pdc)
Definition: dc.h:237
INT x
Definition: msvc.h:62
VOID FASTCALL DC_vPrepareDCsForBlit(PDC pdcDest, const RECT *rcDest, PDC pdcSrc, const RECT *rcSrc)
Definition: dclife.c:497
VOID FASTCALL DC_vFinishBlit(PDC pdc1, PDC pdc2)
Definition: dclife.c:606
unsigned int ULONG
Definition: retypes.h:1
LONG bottom
Definition: windef.h:299
PALETTE gpalRGB
Definition: palette.c:17
LONG cy
Definition: windef.h:325
ENGAPI VOID APIENTRY EngSetLastError(_In_ ULONG iError)
Definition: error.c:27

◆ NtGdiInvertRgn()

BOOL APIENTRY NtGdiInvertRgn ( _In_ HDC  hdc,
_In_ HRGN  hrgn 
)

Definition at line 1316 of file bitblt.c.

Referenced by InvertRgn().

1319 {
1320  BOOL bResult;
1321  PDC pdc;
1322  PREGION prgn;
1323 
1324  /* Lock the DC */
1325  pdc = DC_LockDc(hdc);
1326  if (pdc == NULL)
1327  {
1329  return FALSE;
1330  }
1331 
1332  /* Check if the DC has no surface (empty mem or info DC) */
1333  if (pdc->dclevel.pSurface == NULL)
1334  {
1335  /* Nothing to do, Windows returns TRUE! */
1336  DC_UnlockDc(pdc);
1337  return TRUE;
1338  }
1339 
1340  /* Lock the region */
1341  prgn = REGION_LockRgn(hrgn);
1342  if (prgn == NULL)
1343  {
1344  DC_UnlockDc(pdc);
1345  return FALSE;
1346  }
1347 
1348  /* Call the internal function */
1349  bResult = IntGdiBitBltRgn(pdc,
1350  prgn,
1351  NULL, // pbo
1352  NULL, // pptlBrush,
1353  ROP4_DSTINVERT);
1354 
1355  /* Unlock the region and DC and return the result */
1356  REGION_UnlockRgn(prgn);
1357  DC_UnlockDc(pdc);
1358  return bResult;
1359 }
#define TRUE
Definition: types.h:120
FORCEINLINE PDC DC_LockDc(HDC hdc)
Definition: dc.h:219
#define ERROR_INVALID_HANDLE
Definition: compat.h:88
PREGION FASTCALL REGION_LockRgn(_In_ HRGN hrgn)
Definition: region.c:2337
HDC hdc
Definition: msvc.h:53
smooth NULL
Definition: ftsmooth.c:416
Definition: region.h:7
Definition: polytest.cpp:40
unsigned int BOOL
Definition: ntddk_ex.h:94
#define ROP4_DSTINVERT
Definition: dib.h:7
static HRGN hrgn
Definition: win.c:55
FORCEINLINE VOID DC_UnlockDc(PDC pdc)
Definition: dc.h:237
VOID FASTCALL REGION_UnlockRgn(_In_ PREGION prgn)
Definition: region.c:2352
BOOL APIENTRY IntGdiBitBltRgn(_In_ PDC pdc, _In_ PREGION prgn, _In_opt_ BRUSHOBJ *pbo, _In_opt_ POINTL *pptlBrush, _In_ ROP4 rop4)
Definition: bitblt.c:1041
ENGAPI VOID APIENTRY EngSetLastError(_In_ ULONG iError)
Definition: error.c:27

◆ NtGdiMaskBlt()

BOOL APIENTRY NtGdiMaskBlt ( HDC  hdcDest,
INT  nXDest,
INT  nYDest,
INT  nWidth,
INT  nHeight,
HDC  hdcSrc,
INT  nXSrc,
INT  nYSrc,
HBITMAP  hbmMask,
INT  xMask,
INT  yMask,
DWORD  dwRop4,
IN DWORD  crBackColor 
)

Definition at line 312 of file bitblt.c.

Referenced by NtGdiBitBlt().

326 {
327  PDC DCDest;
328  PDC DCSrc = NULL;
329  HDC ahDC[2];
330  PGDIOBJ apObj[2];
331  PDC_ATTR pdcattr = NULL;
332  SURFACE *BitmapDest, *BitmapSrc = NULL, *psurfMask = NULL;
333  RECTL DestRect, SourceRect;
334  POINTL SourcePoint, MaskPoint;
335  BOOL Status = FALSE;
336  EXLATEOBJ exlo;
337  XLATEOBJ *XlateObj = NULL;
338  BOOL UsesSource;
339  ROP4 rop4;
340 
341  rop4 = WIN32_ROP4_TO_ENG_ROP4(dwRop4);
342 
343  UsesSource = ROP4_USES_SOURCE(rop4);
344  if (!hdcDest || (UsesSource && !hdcSrc))
345  {
347  return FALSE;
348  }
349 
350  /* Check if we need a mask and have a mask bitmap */
351  if (ROP4_USES_MASK(rop4) && (hbmMask != NULL))
352  {
353  /* Reference the mask bitmap */
354  psurfMask = SURFACE_ShareLockSurface(hbmMask);
355  if (psurfMask == NULL)
356  {
358  return FALSE;
359  }
360 
361  /* Make sure the mask bitmap is 1 BPP */
362  if (gajBitsPerFormat[psurfMask->SurfObj.iBitmapFormat] != 1)
363  {
365  SURFACE_ShareUnlockSurface(psurfMask);
366  return FALSE;
367  }
368  }
369  else
370  {
371  /* We use NULL, if we need a mask, the Eng function will take care of
372  that and use the brushobject to get a mask */
373  psurfMask = NULL;
374  }
375 
376  MaskPoint.x = xMask;
377  MaskPoint.y = yMask;
378 
379  /* Take care of source and destination bitmap */
380  TRACE("Locking DCs\n");
381  ahDC[0] = hdcDest;
382  ahDC[1] = UsesSource ? hdcSrc : NULL;
384  {
385  WARN("Invalid dc handle (dest=0x%p, src=0x%p) passed to NtGdiMaskBlt\n", hdcDest, hdcSrc);
387  return FALSE;
388  }
389  DCDest = apObj[0];
390  DCSrc = apObj[1];
391 
392  ASSERT(DCDest);
393  if (NULL == DCDest)
394  {
395  if(DCSrc) DC_UnlockDc(DCSrc);
396  WARN("Invalid destination dc handle (0x%p) passed to NtGdiMaskBlt\n", hdcDest);
397  return FALSE;
398  }
399 
400  if (DCDest->dctype == DC_TYPE_INFO)
401  {
402  if(DCSrc) DC_UnlockDc(DCSrc);
403  DC_UnlockDc(DCDest);
404  /* Yes, Windows really returns TRUE in this case */
405  return TRUE;
406  }
407 
408  if (UsesSource)
409  {
410  ASSERT(DCSrc);
411  if (DCSrc->dctype == DC_TYPE_INFO)
412  {
413  DC_UnlockDc(DCDest);
414  DC_UnlockDc(DCSrc);
415  /* Yes, Windows really returns TRUE in this case */
416  return TRUE;
417  }
418  }
419 
420  pdcattr = DCDest->pdcattr;
421 
422  DestRect.left = nXDest;
423  DestRect.top = nYDest;
424  DestRect.right = nXDest + nWidth;
425  DestRect.bottom = nYDest + nHeight;
426  IntLPtoDP(DCDest, (LPPOINT)&DestRect, 2);
427 
428  DestRect.left += DCDest->ptlDCOrig.x;
429  DestRect.top += DCDest->ptlDCOrig.y;
430  DestRect.right += DCDest->ptlDCOrig.x;
431  DestRect.bottom += DCDest->ptlDCOrig.y;
432 
433  if (DCDest->fs & (DC_ACCUM_APP|DC_ACCUM_WMGR))
434  {
435  IntUpdateBoundsRect(DCDest, &DestRect);
436  }
437 
438  SourcePoint.x = nXSrc;
439  SourcePoint.y = nYSrc;
440 
441  if (UsesSource)
442  {
443  IntLPtoDP(DCSrc, (LPPOINT)&SourcePoint, 1);
444 
445  SourcePoint.x += DCSrc->ptlDCOrig.x;
446  SourcePoint.y += DCSrc->ptlDCOrig.y;
447  /* Calculate Source Rect */
448  SourceRect.left = SourcePoint.x;
449  SourceRect.top = SourcePoint.y;
450  SourceRect.right = SourcePoint.x + DestRect.right - DestRect.left;
451  SourceRect.bottom = SourcePoint.y + DestRect.bottom - DestRect.top ;
452  }
453  else
454  {
455  SourceRect.left = 0;
456  SourceRect.top = 0;
457  SourceRect.right = 0;
458  SourceRect.bottom = 0;
459  }
460 
461  /* Prepare blit */
462  DC_vPrepareDCsForBlit(DCDest, &DestRect, DCSrc, &SourceRect);
463 
464  if (pdcattr->ulDirty_ & (DIRTY_FILL | DC_BRUSH_DIRTY))
465  DC_vUpdateFillBrush(DCDest);
466 
467  /* Determine surfaces to be used in the bitblt */
468  BitmapDest = DCDest->dclevel.pSurface;
469  if (!BitmapDest)
470  goto cleanup;
471 
472  if (UsesSource)
473  {
474  {
475  BitmapSrc = DCSrc->dclevel.pSurface;
476  if (!BitmapSrc)
477  goto cleanup;
478  }
479  }
480 
481  /* Create the XLATEOBJ. */
482  if (UsesSource)
483  {
484  EXLATEOBJ_vInitXlateFromDCs(&exlo, DCSrc, DCDest);
485  XlateObj = &exlo.xlo;
486  }
487 
488  /* Perform the bitblt operation */
489  Status = IntEngBitBlt(&BitmapDest->SurfObj,
490  BitmapSrc ? &BitmapSrc->SurfObj : NULL,
491  psurfMask ? &psurfMask->SurfObj : NULL,
492  (CLIPOBJ *)&DCDest->co,
493  XlateObj,
494  &DestRect,
495  &SourcePoint,
496  &MaskPoint,
497  &DCDest->eboFill.BrushObject,
498  &DCDest->dclevel.pbrFill->ptOrigin,
499  rop4);
500 
501  if (UsesSource)
502  EXLATEOBJ_vCleanup(&exlo);
503 cleanup:
504  DC_vFinishBlit(DCDest, DCSrc);
505  if (UsesSource)
506  {
507  DC_UnlockDc(DCSrc);
508  }
509  DC_UnlockDc(DCDest);
510  if(psurfMask) SURFACE_ShareUnlockSurface(psurfMask);
511 
512  return Status;
513 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:91
#define HDC
Definition: msvc.h:22
#define TRUE
Definition: types.h:120
#define SURFACE_ShareUnlockSurface(pBMObj)
Definition: surface.h:102
#define WARN(fmt,...)
Definition: debug.h:111
#define ERROR_INVALID_HANDLE
Definition: compat.h:88
_In_opt_ SURFOBJ _In_opt_ SURFOBJ _In_ CLIPOBJ _In_opt_ XLATEOBJ _In_ RECTL _In_opt_ POINTL _In_opt_ POINTL _In_opt_ BRUSHOBJ _In_opt_ POINTL _In_ ROP4 rop4
Definition: winddi.h:3433
#define ROP4_USES_MASK(Rop4)
Definition: inteng.h:47
long bottom
Definition: polytest.cpp:53
#define SURFACE_ShareLockSurface(hBMObj)
Definition: surface.h:91
static HDC hdcSrc
Definition: xlate.c:32
ULONG ROP4
Definition: winddi.h:128
LONG y
Definition: windef.h:320
XLATEOBJ xlo
Definition: xlateobj.h:21
long right
Definition: polytest.cpp:53
VOID NTAPI EXLATEOBJ_vInitXlateFromDCs(_Out_ EXLATEOBJ *pexlo, _In_ PDC pdcSrc, _In_ PDC pdcDst)
Definition: xlateobj.c:611
long top
Definition: polytest.cpp:53
SURFOBJ SurfObj
Definition: surface.h:8
smooth NULL
Definition: ftsmooth.c:416
#define ROP4_USES_SOURCE(Rop4)
Definition: inteng.h:45
VOID NTAPI EXLATEOBJ_vCleanup(_Inout_ PEXLATEOBJ pexlo)
Definition: xlateobj.c:649
BOOL NTAPI GDIOBJ_bLockMultipleObjects(IN ULONG ulCount, IN HGDIOBJ *ahObj, OUT PGDIOBJ *apObj, IN UCHAR objt)
Definition: gdiobj.c:1026
long left
Definition: polytest.cpp:53
ULONG ulDirty_
Definition: ntgdihdl.h:291
#define TRACE(s)
Definition: solgame.cpp:4
Definition: polytest.cpp:40
unsigned int BOOL
Definition: ntddk_ex.h:94
LONG x
Definition: windef.h:319
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
#define IntLPtoDP(pdc, ppt, count)
Definition: coord.h:7
#define DIRTY_FILL
Definition: ntgdihdl.h:145
#define WIN32_ROP4_TO_ENG_ROP4(dwRop4)
Definition: intgdi.h:5
Status
Definition: gdiplustypes.h:24
FORCEINLINE VOID DC_UnlockDc(PDC pdc)
Definition: dc.h:237
#define DC_TYPE_INFO
Definition: ntgdihdl.h:125
#define DC_BRUSH_DIRTY
Definition: ntgdihdl.h:157
VOID FASTCALL DC_vPrepareDCsForBlit(PDC pdcDest, const RECT *rcDest, PDC pdcSrc, const RECT *rcSrc)
Definition: dclife.c:497
VOID FASTCALL DC_vFinishBlit(PDC pdc1, PDC pdc2)
Definition: dclife.c:606
VOID FASTCALL IntUpdateBoundsRect(PDC, PRECTL)
Definition: dcutil.c:685
char * cleanup(char *str)
Definition: wpickclick.c:99
ENGAPI VOID APIENTRY EngSetLastError(_In_ ULONG iError)
Definition: error.c:27
UCHAR gajBitsPerFormat[11]
Definition: surface.c:21
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)
Definition: bitblt.c:604
VOID FASTCALL DC_vUpdateFillBrush(PDC pdc)
Definition: dcobjs.c:16

◆ NtGdiPatBlt()

BOOL APIENTRY NtGdiPatBlt ( _In_ HDC  hdcDest,
_In_ INT  x,
_In_ INT  y,
_In_ INT  cx,
_In_ INT  cy,
_In_ DWORD  dwRop 
)

Definition at line 924 of file bitblt.c.

Referenced by co_IntDrawCaret(), FillRect(), FrameRect(), IntDrawScrollInterior(), IntPaintDesktop(), IntUpdateLayeredWindowI(), NC_DoNCPaint(), NC_DrawFrame(), PatBlt(), UITOOLS_DrawCheckedRect(), UserDrawCaption(), UserDrawCaptionBar(), and UserDrawWindowFrame().

931 {
932  BOOL bResult;
933  PDC pdc;
934 
935  /* Convert the ROP3 to a ROP4 */
936  dwRop = MAKEROP4(dwRop & 0xFF0000, dwRop);
937 
938  /* Check if the rop uses a source */
939  if (WIN32_ROP4_USES_SOURCE(dwRop))
940  {
941  /* This is not possible */
942  return FALSE;
943  }
944 
945  /* Lock the DC */
946  pdc = DC_LockDc(hdcDest);
947  if (pdc == NULL)
948  {
950  return FALSE;
951  }
952 
953  /* Check if the DC has no surface (empty mem or info DC) */
954  if (pdc->dclevel.pSurface == NULL)
955  {
956  /* Nothing to do, Windows returns TRUE! */
957  DC_UnlockDc(pdc);
958  return TRUE;
959  }
960 
961  /* Update the fill brush, if necessary */
962  if (pdc->pdcattr->ulDirty_ & (DIRTY_FILL | DC_BRUSH_DIRTY))
963  DC_vUpdateFillBrush(pdc);
964 
965  /* Call the internal function */
966  bResult = IntPatBlt(pdc, x, y, cx, cy, dwRop, &pdc->eboFill);
967 
968  /* Unlock the DC and return the result */
969  DC_UnlockDc(pdc);
970  return bResult;
971 }
#define TRUE
Definition: types.h:120
FORCEINLINE PDC DC_LockDc(HDC hdc)
Definition: dc.h:219
#define WIN32_ROP4_USES_SOURCE(Rop)
Definition: intgdi.h:7
#define ERROR_INVALID_HANDLE
Definition: compat.h:88
INT INT y
Definition: msvc.h:62
_Out_opt_ int _Out_opt_ int * cy
Definition: commctrl.h:570
smooth NULL
Definition: ftsmooth.c:416
#define MAKEROP4(f, b)
Definition: wingdi.h:2923
BOOL FASTCALL IntPatBlt(PDC pdc, INT XLeft, INT YLeft, INT Width, INT Height, DWORD dwRop3, PEBRUSHOBJ pebo)
Definition: bitblt.c:777
Definition: polytest.cpp:40
unsigned int BOOL
Definition: ntddk_ex.h:94
#define DIRTY_FILL
Definition: ntgdihdl.h:145
FORCEINLINE VOID DC_UnlockDc(PDC pdc)
Definition: dc.h:237
INT x
Definition: msvc.h:62
#define DC_BRUSH_DIRTY
Definition: ntgdihdl.h:157
_Out_opt_ int * cx
Definition: commctrl.h:570
ENGAPI VOID APIENTRY EngSetLastError(_In_ ULONG iError)
Definition: error.c:27
VOID FASTCALL DC_vUpdateFillBrush(PDC pdc)
Definition: dcobjs.c:16

◆ NtGdiPlgBlt()

BOOL APIENTRY NtGdiPlgBlt ( IN HDC  hdcTrg,
IN LPPOINT  pptlTrg,
IN HDC  hdcSrc,
IN INT  xSrc,
IN INT  ySrc,
IN INT  cxSrc,
IN INT  cySrc,
IN HBITMAP  hbmMask,
IN INT  xMask,
IN INT  yMask,
IN DWORD  crBackColor 
)

Definition at line 517 of file bitblt.c.

529 {
530  FIXME("NtGdiPlgBlt: unimplemented.\n");
531  return FALSE;
532 }
#define FIXME(fmt,...)
Definition: debug.h:110

◆ NtGdiPolyPatBlt()

BOOL APIENTRY NtGdiPolyPatBlt ( HDC  hDC,
DWORD  dwRop,
IN PPOLYPATBLT  pRects,
IN DWORD  cRects,
IN DWORD  Mode 
)

Definition at line 975 of file bitblt.c.

981 {
982  PPATRECT rb = NULL;
984  BOOL Ret;
985 
986  if (cRects > 0)
987  {
989  if (!rb)
990  {
992  return FALSE;
993  }
994  _SEH2_TRY
995  {
996  ProbeForRead(pRects,
997  cRects * sizeof(PATRECT),
998  1);
999  RtlCopyMemory(rb,
1000  pRects,
1001  cRects * sizeof(PATRECT));
1002  }
1004  {
1005  Status = _SEH2_GetExceptionCode();
1006  }
1007  _SEH2_END;
1008 
1009  if (!NT_SUCCESS(Status))
1010  {
1012  SetLastNtError(Status);
1013  return FALSE;
1014  }
1015  }
1016 
1017  Ret = IntGdiPolyPatBlt(hDC, dwRop, rb, cRects, Mode);
1018 
1019  if (cRects > 0)
1021 
1022  return Ret;
1023 }
#define GDITAG_PLGBLT_DATA
Definition: tags.h:150
NTSYSAPI VOID NTAPI RtlCopyMemory(VOID UNALIGNED *Destination, CONST VOID UNALIGNED *Source, ULONG Length)
_In_ ULONG Mode
Definition: hubbusif.h:303
LONG NTSTATUS
Definition: precomp.h:26
#define ERROR_NOT_ENOUGH_MEMORY
Definition: dderror.h:7
_SEH2_TRY
Definition: create.c:4250
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
smooth NULL
Definition: ftsmooth.c:416
unsigned int BOOL
Definition: ntddk_ex.h:94
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:24
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
VOID NTAPI ProbeForRead(IN CONST VOID *Address, IN SIZE_T Length, IN ULONG Alignment)
Definition: exintrin.c:102
VOID FASTCALL SetLastNtError(NTSTATUS Status)
Definition: error.c:36
Status
Definition: gdiplustypes.h:24
static HDC hDC
Definition: 3dtext.c:33
_SEH2_END
Definition: create.c:4424
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:6
#define ExFreePoolWithTag(_P, _T)
Definition: module.h:1099
#define _SEH2_GetExceptionCode()
Definition: pseh2_64.h:12
return STATUS_SUCCESS
Definition: btrfs.c:2710
BOOL FASTCALL IntGdiPolyPatBlt(HDC hDC, DWORD dwRop, PPATRECT pRects, INT cRects, ULONG Reserved)
Definition: bitblt.c:865
ENGAPI VOID APIENTRY EngSetLastError(_In_ ULONG iError)
Definition: error.c:27

◆ NtGdiSetPixel()

COLORREF APIENTRY NtGdiSetPixel ( _In_ HDC  hdc,
_In_ INT  x,
_In_ INT  y,
_In_ COLORREF  crColor 
)

FIXME: we shouldn't dereference pSurface while the PDEV is not locked!

Definition at line 1363 of file bitblt.c.

Referenced by SetPixel(), and START_TEST().

1368 {
1369  PDC pdc;
1370  ULONG iOldColor, iSolidColor;
1371  BOOL bResult;
1372  PEBRUSHOBJ pebo;
1373  ULONG ulDirty;
1374  EXLATEOBJ exlo;
1375 
1376  /* Lock the DC */
1377  pdc = DC_LockDc(hdc);
1378  if (!pdc)
1379  {
1381  return -1;
1382  }
1383 
1384  /* Check if the DC has no surface (empty mem or info DC) */
1385  if (pdc->dclevel.pSurface == NULL)
1386  {
1387  /* Fail! */
1388  DC_UnlockDc(pdc);
1389  return -1;
1390  }
1391 
1392  if (pdc->fs & (DC_ACCUM_APP|DC_ACCUM_WMGR))
1393  {
1394  RECTL rcDst;
1395 
1396  RECTL_vSetRect(&rcDst, x, y, x+1, y+1);
1397 
1398  IntLPtoDP(pdc, (LPPOINT)&rcDst, 2);
1399 
1400  rcDst.left += pdc->ptlDCOrig.x;
1401  rcDst.top += pdc->ptlDCOrig.y;
1402  rcDst.right += pdc->ptlDCOrig.x;
1403  rcDst.bottom += pdc->ptlDCOrig.y;
1404 
1405  IntUpdateBoundsRect(pdc, &rcDst);
1406  }
1407 
1408  /* Translate the color to the target format */
1409  iSolidColor = TranslateCOLORREF(pdc, crColor);
1410 
1411  /* Use the DC's text brush, which is always a solid brush */
1412  pebo = &pdc->eboText;
1413 
1414  /* Save the old solid color and set the one for the pixel */
1415  iOldColor = EBRUSHOBJ_iSetSolidColor(pebo, iSolidColor);
1416 
1417  /* Save dirty flags and reset dirty text brush flag */
1418  ulDirty = pdc->pdcattr->ulDirty_;
1419  pdc->pdcattr->ulDirty_ &= ~DIRTY_TEXT;
1420 
1421  /* Call the internal function */
1422  bResult = IntPatBlt(pdc, x, y, 1, 1, PATCOPY, pebo);
1423 
1424  /* Restore old text brush color and dirty flags */
1425  EBRUSHOBJ_iSetSolidColor(pebo, iOldColor);
1426  pdc->pdcattr->ulDirty_ = ulDirty;
1427 
1429  /* Initialize an XLATEOBJ from the target surface to RGB */
1430  EXLATEOBJ_vInitialize(&exlo,
1431  pdc->dclevel.pSurface->ppal,
1432  &gpalRGB,
1433  0,
1434  pdc->pdcattr->crBackgroundClr,
1435  pdc->pdcattr->crForegroundClr);
1436 
1437  /* Translate the color back to RGB */
1438  crColor = XLATEOBJ_iXlate(&exlo.xlo, iSolidColor);
1439 
1440  /* Cleanup and return the target format color */
1441  EXLATEOBJ_vCleanup(&exlo);
1442 
1443  /* Unlock the DC */
1444  DC_UnlockDc(pdc);
1445 
1446  /* Return the new RGB color or -1 on failure */
1447  return bResult ? crColor : -1;
1448 }
ULONG TranslateCOLORREF(PDC pdc, COLORREF crColor)
Definition: dcutil.c:860
FORCEINLINE PDC DC_LockDc(HDC hdc)
Definition: dc.h:219
#define ERROR_INVALID_HANDLE
Definition: compat.h:88
long bottom
Definition: polytest.cpp:53
INT INT y
Definition: msvc.h:62
XLATEOBJ xlo
Definition: xlateobj.h:21
long right
Definition: polytest.cpp:53
VOID NTAPI EXLATEOBJ_vInitialize(_Out_ PEXLATEOBJ pexlo, _In_opt_ PALETTE *ppalSrc, _In_opt_ PALETTE *ppalDst, _In_ COLORREF crSrcBackColor, _In_ COLORREF crDstBackColor, _In_ COLORREF crDstForeColor)
Definition: xlateobj.c:358
long top
Definition: polytest.cpp:53
HDC hdc
Definition: msvc.h:53
smooth NULL
Definition: ftsmooth.c:416
VOID NTAPI EXLATEOBJ_vCleanup(_Inout_ PEXLATEOBJ pexlo)
Definition: xlateobj.c:649
long left
Definition: polytest.cpp:53
BOOL FASTCALL IntPatBlt(PDC pdc, INT XLeft, INT YLeft, INT Width, INT Height, DWORD dwRop3, PEBRUSHOBJ pebo)
Definition: bitblt.c:777
Definition: polytest.cpp:40
unsigned int BOOL
Definition: ntddk_ex.h:94
#define DIRTY_TEXT
Definition: ntgdihdl.h:147
#define IntLPtoDP(pdc, ppt, count)
Definition: coord.h:7
#define PATCOPY
Definition: wingdi.h:333
FORCEINLINE VOID DC_UnlockDc(PDC pdc)
Definition: dc.h:237
INT x
Definition: msvc.h:62
VOID FASTCALL IntUpdateBoundsRect(PDC, PRECTL)
Definition: dcutil.c:685
unsigned int ULONG
Definition: retypes.h:1
FORCEINLINE ULONG EBRUSHOBJ_iSetSolidColor(EBRUSHOBJ *pebo, ULONG iSolidColor)
Definition: brush.h:183
PALETTE gpalRGB
Definition: palette.c:17
ENGAPI ULONG APIENTRY XLATEOBJ_iXlate(_In_ XLATEOBJ *pxlo, _In_ ULONG iColor)
Definition: xlateobj.c:664
FORCEINLINE VOID RECTL_vSetRect(_Out_ RECTL *prcl, _In_ LONG left, _In_ LONG top, _In_ LONG right, _In_ LONG bottom)
Definition: rect.h:5
ENGAPI VOID APIENTRY EngSetLastError(_In_ ULONG iError)
Definition: error.c:27

◆ NtGdiStretchBlt()

BOOL APIENTRY NtGdiStretchBlt ( HDC  hDCDest,
INT  XOriginDest,
INT  YOriginDest,
INT  WidthDest,
INT  HeightDest,
HDC  hDCSrc,
INT  XOriginSrc,
INT  YOriginSrc,
INT  WidthSrc,
INT  HeightSrc,
DWORD  dwRop3,
IN DWORD  dwBackColor 
)

Definition at line 741 of file bitblt.c.

Referenced by NtGdiBitBlt().

754 {
755  dwRop3 = dwRop3 & ~(NOMIRRORBITMAP|CAPTUREBLT);
756 
757  return GreStretchBltMask(
758  hDCDest,
759  XOriginDest,
760  YOriginDest,
761  WidthDest,
762  HeightDest,
763  hDCSrc,
764  XOriginSrc,
765  YOriginSrc,
766  WidthSrc,
767  HeightSrc,
768  MAKEROP4(dwRop3 & 0xFF0000, dwRop3),
769  dwBackColor,
770  NULL,
771  0,
772  0);
773 }
#define NOMIRRORBITMAP
Definition: wingdi.h:1358
smooth NULL
Definition: ftsmooth.c:416
#define MAKEROP4(f, b)
Definition: wingdi.h:2923
BOOL NTAPI GreStretchBltMask(HDC hDCDest, INT XOriginDest, INT YOriginDest, INT WidthDest, INT HeightDest, HDC hDCSrc, INT XOriginSrc, INT YOriginSrc, INT WidthSrc, INT HeightSrc, DWORD dwRop4, IN DWORD dwBackColor, HDC hDCMask, INT XOriginMask, INT YOriginMask)
Definition: bitblt.c:536
#define CAPTUREBLT
Definition: wingdi.h:1357

◆ NtGdiTransparentBlt()

BOOL APIENTRY NtGdiTransparentBlt ( HDC  hdcDst,
INT  xDst,
INT  yDst,
INT  cxDst,
INT  cyDst,
HDC  hdcSrc,
INT  xSrc,
INT  ySrc,
INT  cxSrc,
INT  cySrc,
COLORREF  TransColor 
)

Definition at line 200 of file bitblt.c.

212 {
213  PDC DCDest, DCSrc;
214  HDC ahDC[2];
215  PGDIOBJ apObj[2];
216  RECTL rcDest, rcSrc;
217  SURFACE *BitmapDest, *BitmapSrc = NULL;
218  ULONG TransparentColor = 0;
219  BOOL Ret = FALSE;
220  EXLATEOBJ exlo;
221 
222  if ((hdcDst == NULL) || (hdcSrc == NULL))
223  {
225  return FALSE;
226  }
227 
228  TRACE("Locking DCs\n");
229  ahDC[0] = hdcDst;
230  ahDC[1] = hdcSrc ;
232  {
233  WARN("Invalid dc handle (dest=0x%p, src=0x%p) passed to NtGdiAlphaBlend\n", hdcDst, hdcSrc);
235  return FALSE;
236  }
237  DCDest = apObj[0];
238  DCSrc = apObj[1];
239 
240  if (DCDest->dctype == DC_TYPE_INFO || DCDest->dctype == DCTYPE_INFO)
241  {
242  GDIOBJ_vUnlockObject(&DCSrc->BaseObject);
243  GDIOBJ_vUnlockObject(&DCDest->BaseObject);
244  /* Yes, Windows really returns TRUE in this case */
245  return TRUE;
246  }
247 
248  rcDest.left = xDst;
249  rcDest.top = yDst;
250  rcDest.right = rcDest.left + cxDst;
251  rcDest.bottom = rcDest.top + cyDst;
252  IntLPtoDP(DCDest, (LPPOINT)&rcDest, 2);
253 
254  rcDest.left += DCDest->ptlDCOrig.x;
255  rcDest.top += DCDest->ptlDCOrig.y;
256  rcDest.right += DCDest->ptlDCOrig.x;
257  rcDest.bottom += DCDest->ptlDCOrig.y;
258 
259  rcSrc.left = xSrc;
260  rcSrc.top = ySrc;
261  rcSrc.right = rcSrc.left + cxSrc;
262  rcSrc.bottom = rcSrc.top + cySrc;
263  IntLPtoDP(DCSrc, (LPPOINT)&rcSrc, 2);
264 
265  rcSrc.left += DCSrc->ptlDCOrig.x;
266  rcSrc.top += DCSrc->ptlDCOrig.y;
267  rcSrc.right += DCSrc->ptlDCOrig.x;
268  rcSrc.bottom += DCSrc->ptlDCOrig.y;
269 
270  if (DCDest->fs & (DC_ACCUM_APP|DC_ACCUM_WMGR))
271  {
272  IntUpdateBoundsRect(DCDest, &rcDest);
273  }
274 
275  /* Prepare for blit */
276  DC_vPrepareDCsForBlit(DCDest, &rcDest, DCSrc, &rcSrc);
277 
278  BitmapDest = DCDest->dclevel.pSurface;
279  if (!BitmapDest)
280  {
281  goto done;
282  }
283 
284  BitmapSrc = DCSrc->dclevel.pSurface;
285  if (!BitmapSrc)
286  {
287  goto done;
288  }
289 
290  /* Translate Transparent (RGB) Color to the source palette */
291  EXLATEOBJ_vInitialize(&exlo, &gpalRGB, BitmapSrc->ppal, 0, 0, 0);
292  TransparentColor = XLATEOBJ_iXlate(&exlo.xlo, (ULONG)TransColor);
293  EXLATEOBJ_vCleanup(&exlo);
294 
295  EXLATEOBJ_vInitXlateFromDCs(&exlo, DCSrc, DCDest);
296 
297  Ret = IntEngTransparentBlt(&BitmapDest->SurfObj, &BitmapSrc->SurfObj,
298  (CLIPOBJ *)&DCDest->co, &exlo.xlo, &rcDest, &rcSrc,
299  TransparentColor, 0);
300 
301  EXLATEOBJ_vCleanup(&exlo);
302 
303 done:
304  DC_vFinishBlit(DCDest, DCSrc);
305  GDIOBJ_vUnlockObject(&DCDest->BaseObject);
306  GDIOBJ_vUnlockObject(&DCSrc->BaseObject);
307 
308  return Ret;
309 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:91
#define HDC
Definition: msvc.h:22
#define TRUE
Definition: types.h:120
BOOL FASTCALL IntEngTransparentBlt(SURFOBJ *Dest, SURFOBJ *Source, CLIPOBJ *Clip, XLATEOBJ *ColorTranslation, PRECTL DestRect, PRECTL SourceRect, ULONG iTransColor, ULONG Reserved)
Definition: transblt.c:207
#define WARN(fmt,...)
Definition: debug.h:111
#define ERROR_INVALID_HANDLE
Definition: compat.h:88
struct _PALETTE *const ppal
Definition: surface.h:11
long bottom
Definition: polytest.cpp:53
static HDC hdcSrc
Definition: xlate.c:32
XLATEOBJ xlo
Definition: xlateobj.h:21
long right
Definition: polytest.cpp:53
VOID NTAPI EXLATEOBJ_vInitXlateFromDCs(_Out_ EXLATEOBJ *pexlo, _In_ PDC pdcSrc, _In_ PDC pdcDst)
Definition: xlateobj.c:611
VOID NTAPI EXLATEOBJ_vInitialize(_Out_ PEXLATEOBJ pexlo, _In_opt_ PALETTE *ppalSrc, _In_opt_ PALETTE *ppalDst, _In_ COLORREF crSrcBackColor, _In_ COLORREF crDstBackColor, _In_ COLORREF crDstForeColor)
Definition: xlateobj.c:358
long top
Definition: polytest.cpp:53
SURFOBJ SurfObj
Definition: surface.h:8
smooth NULL
Definition: ftsmooth.c:416
VOID NTAPI EXLATEOBJ_vCleanup(_Inout_ PEXLATEOBJ pexlo)
Definition: xlateobj.c:649
BOOL NTAPI GDIOBJ_bLockMultipleObjects(IN ULONG ulCount, IN HGDIOBJ *ahObj, OUT PGDIOBJ *apObj, IN UCHAR objt)
Definition: gdiobj.c:1026
long left
Definition: polytest.cpp:53
#define TRACE(s)
Definition: solgame.cpp:4
Definition: polytest.cpp:40
unsigned int BOOL
Definition: ntddk_ex.h:94
VOID NTAPI GDIOBJ_vUnlockObject(POBJ pobj)
Definition: gdiobj.c:875
#define IntLPtoDP(pdc, ppt, count)
Definition: coord.h:7
Definition: dc.h:43
static HDC hdcDst
Definition: xlate.c:32
#define DC_TYPE_INFO
Definition: ntgdihdl.h:125
VOID FASTCALL DC_vPrepareDCsForBlit(PDC pdcDest, const RECT *rcDest, PDC pdcSrc, const RECT *rcSrc)
Definition: dclife.c:497
VOID FASTCALL DC_vFinishBlit(PDC pdc1, PDC pdc2)
Definition: dclife.c:606
VOID FASTCALL IntUpdateBoundsRect(PDC, PRECTL)
Definition: dcutil.c:685
unsigned int ULONG
Definition: retypes.h:1
PALETTE gpalRGB
Definition: palette.c:17
ENGAPI ULONG APIENTRY XLATEOBJ_iXlate(_In_ XLATEOBJ *pxlo, _In_ ULONG iColor)
Definition: xlateobj.c:664
ENGAPI VOID APIENTRY EngSetLastError(_In_ ULONG iError)
Definition: error.c:27

◆ REGION_LPTODP()

static BOOL FASTCALL REGION_LPTODP ( _In_ PDC  pdc,
_Inout_ PREGION  prgnDest,
_In_ PREGION  prgnSrc 
)
static

Definition at line 1028 of file bitblt.c.

Referenced by IntGdiBitBltRgn(), and IntGdiFillRgn().

1032 {
1033  if (IntGdiCombineRgn(prgnDest, prgnSrc, NULL, RGN_COPY) == ERROR)
1034  return FALSE;
1035 
1036  return REGION_bXformRgn(prgnDest, DC_pmxWorldToDevice(pdc));
1037 }
#define ERROR(err)
Definition: vbo_exec_api.c:413
smooth NULL
Definition: ftsmooth.c:416
INT FASTCALL IntGdiCombineRgn(PREGION prgnDest, PREGION prgnSrc1, PREGION prgnSrc2, INT iCombineMode)
Definition: region.c:2466
BOOL FASTCALL REGION_bXformRgn(_Inout_ PREGION prgn, _In_ PMATRIX pmx)
Definition: region.c:2043
#define RGN_COPY
Definition: wingdi.h:355
FORCEINLINE PMATRIX DC_pmxWorldToDevice(PDC pdc)
Definition: coord.h:96