ReactOS  0.4.14-dev-593-g1793dcc
inteng.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _RECT_ENUM
 
struct  tagSPAN
 

Macros

#define ENUM_RECT_LIMIT   32
 
#define ROP2_TO_MIX(Rop2)   (((Rop2) << 8) | (Rop2))
 
#define ROP4_FROM_INDEX(index)   ((index) | ((index) << 8))
 
#define ROP4_USES_DEST(Rop4)   ((((Rop4) & 0xAAAA) >> 1) != ((Rop4) & 0x5555))
 
#define ROP4_USES_SOURCE(Rop4)   ((((Rop4) & 0xCCCC) >> 2) != ((Rop4) & 0x3333))
 
#define ROP4_USES_PATTERN(Rop4)   ((((Rop4) & 0xF0F0) >> 4) != ((Rop4) & 0x0F0F))
 
#define ROP4_USES_MASK(Rop4)   ((((Rop4) & 0xFF00) >> 8) != ((Rop4) & 0x00ff))
 
#define IS_VALID_ROP4(rop)   (((rop) & 0xFFFF0000) == 0)
 
#define ROP4_FGND(Rop4)   ((Rop4) & 0x00FF)
 
#define ROP4_BKGND(Rop4)   (((Rop4) & 0xFF00) >> 8)
 
#define ROP4_NOOP   (R3_OPINDEX_NOOP | (R3_OPINDEX_NOOP << 8))
 
#define ROP4_MASK   (R3_OPINDEX_SRCCOPY | (R3_OPINDEX_NOOP << 8))
 
#define ROP4_MASKPAINT   (R3_OPINDEX_PATCOPY | (R3_OPINDEX_NOOP << 8))
 

Typedefs

typedef ULONG HCLIP
 
typedef struct _RECT_ENUM RECT_ENUM
 
typedef struct tagSPAN SPAN
 
typedef struct tagSPANPSPAN
 

Enumerations

enum  _R3_ROPCODES {
  R3_OPINDEX_NOOP = 0xAA, R3_OPINDEX_BLACKNESS = 0x00, R3_OPINDEX_NOTSRCERASE = 0x11, R3_OPINDEX_NOTSRCCOPY = 0x33,
  R3_OPINDEX_SRCERASE = 0x44, R3_OPINDEX_DSTINVERT = 0x55, R3_OPINDEX_PATINVERT = 0x5A, R3_OPINDEX_SRCINVERT = 0x66,
  R3_OPINDEX_SRCAND = 0x88, R3_OPINDEX_MERGEPAINT = 0xBB, R3_OPINDEX_MERGECOPY = 0xC0, R3_OPINDEX_SRCCOPY = 0xCC,
  R3_OPINDEX_SRCPAINT = 0xEE, R3_OPINDEX_PATCOPY = 0xF0, R3_OPINDEX_PATPAINT = 0xFB, R3_OPINDEX_WHITENESS = 0xFF
}
 

Functions

BOOL APIENTRY IntEngLineTo (SURFOBJ *Surface, CLIPOBJ *Clip, BRUSHOBJ *Brush, LONG x1, LONG y1, LONG x2, LONG y2, RECTL *RectBounds, MIX mix)
 
BOOL APIENTRY IntEngBitBlt (SURFOBJ *DestObj, SURFOBJ *SourceObj, SURFOBJ *Mask, CLIPOBJ *ClipRegion, XLATEOBJ *ColorTranslation, RECTL *DestRect, POINTL *SourcePoint, POINTL *MaskOrigin, BRUSHOBJ *Brush, POINTL *BrushOrigin, ROP4 Rop4)
 
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)
 
BOOL APIENTRY IntEngGradientFill (SURFOBJ *psoDest, CLIPOBJ *pco, XLATEOBJ *pxlo, TRIVERTEX *pVertex, ULONG nVertex, PVOID pMesh, ULONG nMesh, RECTL *prclExtents, POINTL *pptlDitherOrg, ULONG ulMode)
 
BOOL APIENTRY IntEngPolyline (SURFOBJ *DestSurf, CLIPOBJ *Clip, BRUSHOBJ *Brush, CONST LPPOINT pt, LONG dCount, MIX mix)
 
VOID FASTCALL IntEngUpdateClipRegion (XCLIPOBJ *Clip, ULONG count, const RECTL *pRect, const RECTL *rcBounds)
 
VOID FASTCALL IntEngInitClipObj (XCLIPOBJ *Clip)
 
VOID FASTCALL IntEngFreeClipResources (XCLIPOBJ *Clip)
 
BOOL FASTCALL IntEngTransparentBlt (SURFOBJ *Dest, SURFOBJ *Source, CLIPOBJ *Clip, XLATEOBJ *ColorTranslation, PRECTL DestRect, PRECTL SourceRect, ULONG iTransColor, ULONG Reserved)
 
BOOL APIENTRY IntEngPaint (_In_ SURFOBJ *pso, _In_ CLIPOBJ *pco, _In_ BRUSHOBJ *pbo, _In_ POINTL *pptlBrushOrg, _In_ __in_data_source(USER_MODE) MIX mix)
 
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)
 
BOOL APIENTRY IntEngCopyBits (SURFOBJ *psoDest, SURFOBJ *psoSource, CLIPOBJ *pco, XLATEOBJ *pxlo, RECTL *prclDest, POINTL *ptlSource)
 

Macro Definition Documentation

◆ ENUM_RECT_LIMIT

#define ENUM_RECT_LIMIT   32

Definition at line 5 of file inteng.h.

◆ IS_VALID_ROP4

#define IS_VALID_ROP4 (   rop)    (((rop) & 0xFFFF0000) == 0)

Definition at line 49 of file inteng.h.

◆ ROP2_TO_MIX

#define ROP2_TO_MIX (   Rop2)    (((Rop2) << 8) | (Rop2))

Definition at line 40 of file inteng.h.

◆ ROP4_BKGND

#define ROP4_BKGND (   Rop4)    (((Rop4) & 0xFF00) >> 8)

Definition at line 52 of file inteng.h.

◆ ROP4_FGND

#define ROP4_FGND (   Rop4)    ((Rop4) & 0x00FF)

Definition at line 51 of file inteng.h.

◆ ROP4_FROM_INDEX

#define ROP4_FROM_INDEX (   index)    ((index) | ((index) << 8))

Definition at line 42 of file inteng.h.

◆ ROP4_MASK

#define ROP4_MASK   (R3_OPINDEX_SRCCOPY | (R3_OPINDEX_NOOP << 8))

Definition at line 55 of file inteng.h.

◆ ROP4_MASKPAINT

#define ROP4_MASKPAINT   (R3_OPINDEX_PATCOPY | (R3_OPINDEX_NOOP << 8))

Definition at line 56 of file inteng.h.

◆ ROP4_NOOP

#define ROP4_NOOP   (R3_OPINDEX_NOOP | (R3_OPINDEX_NOOP << 8))

Definition at line 54 of file inteng.h.

◆ ROP4_USES_DEST

#define ROP4_USES_DEST (   Rop4)    ((((Rop4) & 0xAAAA) >> 1) != ((Rop4) & 0x5555))

Definition at line 44 of file inteng.h.

◆ ROP4_USES_MASK

#define ROP4_USES_MASK (   Rop4)    ((((Rop4) & 0xFF00) >> 8) != ((Rop4) & 0x00ff))

Definition at line 47 of file inteng.h.

◆ ROP4_USES_PATTERN

#define ROP4_USES_PATTERN (   Rop4)    ((((Rop4) & 0xF0F0) >> 4) != ((Rop4) & 0x0F0F))

Definition at line 46 of file inteng.h.

◆ ROP4_USES_SOURCE

#define ROP4_USES_SOURCE (   Rop4)    ((((Rop4) & 0xCCCC) >> 2) != ((Rop4) & 0x3333))

Definition at line 45 of file inteng.h.

Typedef Documentation

◆ HCLIP

typedef ULONG HCLIP

Definition at line 3 of file inteng.h.

◆ PSPAN

typedef struct tagSPAN * PSPAN

◆ RECT_ENUM

◆ SPAN

typedef struct tagSPAN SPAN

Enumeration Type Documentation

◆ _R3_ROPCODES

Enumerator
R3_OPINDEX_NOOP 
R3_OPINDEX_BLACKNESS 
R3_OPINDEX_NOTSRCERASE 
R3_OPINDEX_NOTSRCCOPY 
R3_OPINDEX_SRCERASE 
R3_OPINDEX_DSTINVERT 
R3_OPINDEX_PATINVERT 
R3_OPINDEX_SRCINVERT 
R3_OPINDEX_SRCAND 
R3_OPINDEX_MERGEPAINT 
R3_OPINDEX_MERGECOPY 
R3_OPINDEX_SRCCOPY 
R3_OPINDEX_SRCPAINT 
R3_OPINDEX_PATCOPY 
R3_OPINDEX_PATPAINT 
R3_OPINDEX_WHITENESS 

Definition at line 20 of file inteng.h.

Function Documentation

◆ IntEngAlphaBlend()

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 at line 196 of file alphablend.c.

204 {
205  BOOL ret = FALSE;
206  SURFACE *psurfDest;
207 
208  ASSERT(psoDest);
209  ASSERT(psoSource);
210  ASSERT(prclDest);
211  ASSERT(prclSrc);
212  //ASSERT(pBlendObj);
213 
214  /* If no clip object is given, use trivial one */
215  if (!pco) pco = (CLIPOBJ *)&gxcoTrivial;
216 
217  /* Check if there is anything to draw */
218  if ((pco->rclBounds.left >= pco->rclBounds.right) ||
219  (pco->rclBounds.top >= pco->rclBounds.bottom))
220  {
221  /* Nothing to do */
222  return TRUE;
223  }
224 
225  psurfDest = CONTAINING_RECORD(psoDest, SURFACE, SurfObj);
226 
227  /* Call the driver's DrvAlphaBlend if available */
228  if (psurfDest->flags & HOOK_ALPHABLEND)
229  {
230  ret = GDIDEVFUNCS(psoDest).AlphaBlend(
231  psoDest, psoSource, pco, pxlo,
233  }
234 
235  if (!ret)
236  {
237  ret = EngAlphaBlend(psoDest, psoSource, pco, pxlo,
239  }
240 
241  return ret;
242 }
#define TRUE
Definition: types.h:120
XCLIPOBJ gxcoTrivial
Definition: bitblt.c:15
#define HOOK_ALPHABLEND
Definition: winddi.h:1435
unsigned int BOOL
Definition: ntddk_ex.h:94
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
_In_ SURFOBJ _In_ CLIPOBJ _In_opt_ XLATEOBJ _In_ RECTL _In_ RECTL * prclSrc
Definition: winddi.h:3414
#define GDIDEVFUNCS(SurfObj)
Definition: surface.h:106
_In_ SURFOBJ _In_ CLIPOBJ _In_opt_ XLATEOBJ _In_ RECTL * prclDest
Definition: winddi.h:3414
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
int ret
_In_ SURFOBJ _In_ CLIPOBJ * pco
Definition: winddi.h:3414
BOOL APIENTRY EngAlphaBlend(_Inout_ SURFOBJ *psoDest, _In_ SURFOBJ *psoSource, _In_opt_ CLIPOBJ *ClipRegion, _In_opt_ XLATEOBJ *ColorTranslation, _In_ RECTL *DestRect, _In_ RECTL *SourceRect, _In_ BLENDOBJ *BlendObj)
Definition: alphablend.c:20
_In_ SURFOBJ _In_ CLIPOBJ _In_opt_ XLATEOBJ _In_ RECTL _In_ RECTL _In_ BLENDOBJ * pBlendObj
Definition: winddi.h:3414
FLONG flags
Definition: surface.h:10
_In_ SURFOBJ _In_ CLIPOBJ _In_opt_ XLATEOBJ * pxlo
Definition: winddi.h:3414

Referenced by IntShowMousePointer(), NtGdiAlphaBlend(), and UserDrawIconEx().

◆ IntEngBitBlt()

BOOL APIENTRY IntEngBitBlt ( SURFOBJ DestObj,
SURFOBJ SourceObj,
SURFOBJ Mask,
CLIPOBJ ClipRegion,
XLATEOBJ ColorTranslation,
RECTL DestRect,
POINTL SourcePoint,
POINTL MaskOrigin,
BRUSHOBJ Brush,
POINTL BrushOrigin,
ROP4  Rop4 
)

Definition at line 604 of file bitblt.c.

616 {
617  SURFACE *psurfTrg;
618  SURFACE *psurfSrc = NULL;
619  BOOL bResult;
620  RECTL rclClipped;
621  RECTL rclSrc;
622  RECTL rclSrcClipped;
623  POINTL ptlBrush;
624  PFN_DrvBitBlt pfnBitBlt;
625 
626  /* Sanity checks */
627  ASSERT(IS_VALID_ROP4(Rop4));
628  ASSERT(psoTrg);
629 
630  psurfTrg = CONTAINING_RECORD(psoTrg, SURFACE, SurfObj);
631 
632  /* Get the target rect and make it well ordered */
633  rclClipped = *prclTrg;
634  RECTL_vMakeWellOrdered(&rclClipped);
635 
636  /* Clip the target rect against the bounds of the target surface */
637  if (!RECTL_bClipRectBySize(&rclClipped, &rclClipped, &psoTrg->sizlBitmap))
638  {
639  /* Nothing left */
640  return TRUE;
641  }
642 
643  if (pco)
644  {
645  /* Clip target rect against the bounds of the clipping region */
646  if (!RECTL_bIntersectRect(&rclClipped, &rclClipped, &pco->rclBounds))
647  {
648  /* Nothing left */
649  return TRUE;
650  }
651 
652  /* Don't pass a clipobj with only a single rect */
653  if (pco->iDComplexity == DC_RECT)
654  pco = NULL;
655  }
656  else
657  pco = (CLIPOBJ *)&gxcoTrivial;
658 
659  if (ROP4_USES_SOURCE(Rop4))
660  {
661  ASSERT(psoSrc);
662  psurfSrc = CONTAINING_RECORD(psoSrc, SURFACE, SurfObj);
663 
664  /* Calculate source rect */
665  rclSrc.left = pptlSrc->x + rclClipped.left - prclTrg->left;
666  rclSrc.top = pptlSrc->y + rclClipped.top - prclTrg->top;
667  rclSrc.right = rclSrc.left + rclClipped.right - rclClipped.left;
668  rclSrc.bottom = rclSrc.top + rclClipped.bottom - rclClipped.top;
669 
670  /* Clip the source rect against the size of the source surface */
671  if (!RECTL_bClipRectBySize(&rclSrcClipped, &rclSrc, &psoSrc->sizlBitmap))
672  {
673  /* Nothing left */
674  return TRUE;
675  }
676 
677  /* Fix up target rect */
678  rclClipped.left += (rclSrcClipped.left - rclSrc.left);
679  rclClipped.top += (rclSrcClipped.top - rclSrc.top);
680  rclClipped.right -= (rclSrc.right - rclSrcClipped.right);
681  rclClipped.bottom -= (rclSrc.bottom - rclSrcClipped.bottom);
682 
683  pptlSrc = (PPOINTL)&rclSrcClipped;
684  }
685  else
686  {
687  psoSrc = NULL;
688  psurfSrc = NULL;
689  }
690 
691  if (pptlBrush)
692  {
693 #ifdef _USE_DIBLIB_
694  ptlBrush.x = pptlBrush->x + rclClipped.left - prclTrg->left;
695  ptlBrush.y = pptlBrush->y + rclClipped.top - prclTrg->top;
696 #else
697  ptlBrush = *pptlBrush;
698 #endif
699  }
700 
701  /* Is the target surface device managed? */
702  if (psurfTrg->flags & HOOK_BITBLT)
703  {
704  /* Is the source a different device managed surface? */
705  if (psoSrc && psoSrc->hdev != psoTrg->hdev && psurfSrc->flags & HOOK_BITBLT)
706  {
707  DPRINT1("Need to copy to standard bitmap format!\n");
708  ASSERT(FALSE);
709  }
710 
711  pfnBitBlt = GDIDEVFUNCS(psoTrg).BitBlt;
712  }
713 
714  /* Is the source surface device managed? */
715  else if (psoSrc && psurfSrc->flags & HOOK_BITBLT)
716  {
717  pfnBitBlt = GDIDEVFUNCS(psoSrc).BitBlt;
718  }
719  else
720  {
721  pfnBitBlt = EngBitBlt;
722  }
723 
724  bResult = pfnBitBlt(psoTrg,
725  psoSrc,
726  psoMask,
727  pco,
728  pxlo,
729  &rclClipped,
730  pptlSrc,
731  pptlMask,
732  pbo,
733  pptlBrush ? &ptlBrush : NULL,
734  Rop4);
735 
736  // FIXME: cleanup temp surface!
737 
738  return bResult;
739 }
BOOL APIENTRY EngBitBlt(_Inout_ SURFOBJ *psoTrg, _In_opt_ SURFOBJ *psoSrc, _In_opt_ SURFOBJ *psoMask, _In_opt_ CLIPOBJ *pco, _In_opt_ XLATEOBJ *pxlo, _In_ RECTL *prclTrg, _In_opt_ POINTL *pptlSrc, _In_opt_ POINTL *pptlMask, _In_opt_ BRUSHOBJ *pbo, _In_opt_ POINTL *pptlBrush, _In_ ROP4 rop4)
Definition: bitblt.c:317
#define TRUE
Definition: types.h:120
struct _POINTL * PPOINTL
XCLIPOBJ gxcoTrivial
Definition: bitblt.c:15
long bottom
Definition: polytest.cpp:53
_In_opt_ SURFOBJ _In_opt_ SURFOBJ _In_ CLIPOBJ _In_opt_ XLATEOBJ _In_ RECTL * prclTrg
Definition: winddi.h:3433
#define IS_VALID_ROP4(rop)
Definition: inteng.h:49
LONG y
Definition: windef.h:330
_In_ SURFOBJ * psoSrc
Definition: winddi.h:3414
long right
Definition: polytest.cpp:53
unsigned int BOOL
Definition: ntddk_ex.h:94
long top
Definition: polytest.cpp:53
FORCEINLINE BOOL RECTL_bClipRectBySize(_Out_ RECTL *prclDst, _In_ const RECTL *prclSrc, _In_ const SIZEL *pszl)
Definition: rect.h:72
smooth NULL
Definition: ftsmooth.c:416
#define ROP4_USES_SOURCE(Rop4)
Definition: inteng.h:45
_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
long left
Definition: polytest.cpp:53
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
#define DC_RECT
Definition: winddi.h:260
#define HOOK_BITBLT
Definition: winddi.h:1420
_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
#define GDIDEVFUNCS(SurfObj)
Definition: surface.h:106
BOOL FASTCALL RECTL_bIntersectRect(_Out_ RECTL *prclDst, _In_ const RECTL *prcl1, _In_ const RECTL *prcl2)
Definition: rect.c:55
LONG x
Definition: windef.h:329
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
_In_ SURFOBJ _In_ CLIPOBJ * pco
Definition: winddi.h:3414
FN_DrvBitBlt * PFN_DrvBitBlt
Definition: winddi.h:3443
_In_opt_ SURFOBJ _In_opt_ SURFOBJ _In_ CLIPOBJ _In_opt_ XLATEOBJ _In_ RECTL _In_opt_ POINTL _In_opt_ POINTL * pptlMask
Definition: winddi.h:3433
_In_opt_ SURFOBJ _In_opt_ SURFOBJ _In_ CLIPOBJ _In_opt_ XLATEOBJ _In_ RECTL _In_opt_ POINTL * pptlSrc
Definition: winddi.h:3433
FLONG flags
Definition: surface.h:10
_In_opt_ SURFOBJ _In_opt_ SURFOBJ * psoMask
Definition: winddi.h:3433
#define DPRINT1
Definition: precomp.h:8
VOID FASTCALL RECTL_vMakeWellOrdered(_Inout_ RECTL *prcl)
Definition: rect.c:81
_In_ SURFOBJ _In_ CLIPOBJ _In_opt_ XLATEOBJ * pxlo
Definition: winddi.h:3414

Referenced by EngCopyBits(), EngPaint(), IntEngMaskBlt(), IntEngStretchBlt(), IntExtTextOutW(), IntFillPolygon(), IntFillRect(), IntGdiBitBltRgn(), IntHideMousePointer(), IntPatBlt(), IntRectangle(), IntShowMousePointer(), NtGdiMaskBlt(), NtGdiSetDIBitsToDeviceInternal(), and UserDrawIconEx().

◆ IntEngCopyBits()

BOOL APIENTRY IntEngCopyBits ( SURFOBJ psoDest,
SURFOBJ psoSource,
CLIPOBJ pco,
XLATEOBJ pxlo,
RECTL prclDest,
POINTL ptlSource 
)

Definition at line 678 of file bitblt_new.c.

685 {
686  return EngCopyBits(psoTrg, psoSrc, pco, pxlo, prclTrg, pptlSrc);
687 }
BOOL APIENTRY EngCopyBits(SURFOBJ *psoTrg, SURFOBJ *psoSrc, CLIPOBJ *pco, XLATEOBJ *pxlo, RECTL *prclTrg, POINTL *pptlSrc)
Definition: bitblt_new.c:637
_In_opt_ SURFOBJ _In_opt_ SURFOBJ _In_ CLIPOBJ _In_opt_ XLATEOBJ _In_ RECTL * prclTrg
Definition: winddi.h:3433
_In_ SURFOBJ * psoSrc
Definition: winddi.h:3414
_In_ SURFOBJ _In_ CLIPOBJ * pco
Definition: winddi.h:3414
_In_opt_ SURFOBJ _In_opt_ SURFOBJ _In_ CLIPOBJ _In_opt_ XLATEOBJ _In_ RECTL _In_opt_ POINTL * pptlSrc
Definition: winddi.h:3433
_In_ SURFOBJ _In_ CLIPOBJ _In_opt_ XLATEOBJ * pxlo
Definition: winddi.h:3414

Referenced by EngSetPointerShape(), GreGetDIBitsInternal(), and IntSetDIBits().

◆ IntEngFreeClipResources()

VOID FASTCALL IntEngFreeClipResources ( XCLIPOBJ Clip)

Definition at line 164 of file clip.c.

165 {
166  if (Clip->Rects != &Clip->rclBounds)
167  EngFreeMem(Clip->Rects);
168 }
#define EngFreeMem
Definition: polytest.cpp:56
RECTL * Rects
Definition: engobjects.h:62

Referenced by DC_vCleanup(), EngDeleteClip(), EngDeleteWnd(), IntGdiBitBltRgn(), and IntGdiFillRgn().

◆ IntEngGradientFill()

BOOL APIENTRY IntEngGradientFill ( SURFOBJ psoDest,
CLIPOBJ pco,
XLATEOBJ pxlo,
TRIVERTEX pVertex,
ULONG  nVertex,
PVOID  pMesh,
ULONG  nMesh,
RECTL prclExtents,
POINTL pptlDitherOrg,
ULONG  ulMode 
)

◆ IntEngInitClipObj()

VOID FASTCALL IntEngInitClipObj ( XCLIPOBJ Clip)

Definition at line 158 of file clip.c.

159 {
160  Clip->Rects = &Clip->rclBounds;
161 }
RECTL * Rects
Definition: engobjects.h:62

Referenced by DC_vInitDc(), EngCreateClip(), EngCreateWnd(), IntGdiBitBltRgn(), and IntGdiFillRgn().

◆ IntEngLineTo()

BOOL APIENTRY IntEngLineTo ( SURFOBJ Surface,
CLIPOBJ Clip,
BRUSHOBJ Brush,
LONG  x1,
LONG  y1,
LONG  x2,
LONG  y2,
RECTL RectBounds,
MIX  mix 
)

Definition at line 621 of file lineto.c.

630 {
631  BOOLEAN ret;
632  SURFACE *psurfDest;
633  PEBRUSHOBJ GdiBrush;
634  RECTL b;
635 
636  ASSERT(psoDest);
637  psurfDest = CONTAINING_RECORD(psoDest, SURFACE, SurfObj);
638  ASSERT(psurfDest);
639 
640  GdiBrush = CONTAINING_RECORD(
641  pbo,
642  EBRUSHOBJ,
643  BrushObject);
644  ASSERT(GdiBrush);
645  ASSERT(GdiBrush->pbrush);
646 
647  if (GdiBrush->pbrush->flAttrs & BR_IS_NULL)
648  return TRUE;
649 
650  /* No success yet */
651  ret = FALSE;
652 
653  /* Clip lines totally outside the clip region. This is not done as an
654  * optimization (there are very few lines drawn outside the region) but
655  * as a workaround for what seems to be a problem in the CL54XX driver */
656  if (NULL == ClipObj || DC_TRIVIAL == ClipObj->iDComplexity)
657  {
658  b.left = 0;
659  b.right = psoDest->sizlBitmap.cx;
660  b.top = 0;
661  b.bottom = psoDest->sizlBitmap.cy;
662  }
663  else
664  {
665  b = ClipObj->rclBounds;
666  }
667  if ((x1 < b.left && x2 < b.left) || (b.right <= x1 && b.right <= x2) ||
668  (y1 < b.top && y2 < b.top) || (b.bottom <= y1 && b.bottom <= y2))
669  {
670  return TRUE;
671  }
672 
673  b.left = min(x1, x2);
674  b.right = max(x1, x2);
675  b.top = min(y1, y2);
676  b.bottom = max(y1, y2);
677  if (b.left == b.right) b.right++;
678  if (b.top == b.bottom) b.bottom++;
679 
680  if (psurfDest->flags & HOOK_LINETO)
681  {
682  /* Call the driver's DrvLineTo */
683  ret = GDIDEVFUNCS(psoDest).LineTo(
684  psoDest, ClipObj, pbo, x1, y1, x2, y2, &b, Mix);
685  }
686 
687 #if 0
688  if (! ret && (psurfDest->flags & HOOK_STROKEPATH))
689  {
690  /* FIXME: Emulate LineTo using drivers DrvStrokePath and set ret on success */
691  }
692 #endif
693 
694  if (! ret)
695  {
696  ret = EngLineTo(psoDest, ClipObj, pbo, x1, y1, x2, y2, RectBounds, Mix);
697  }
698 
699  return ret;
700 }
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG _In_ LONG y1
Definition: winddi.h:3706
#define max(a, b)
Definition: svc.c:63
#define TRUE
Definition: types.h:120
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG x1
Definition: winddi.h:3706
#define DC_TRIVIAL
Definition: winddi.h:259
unsigned char BOOLEAN
smooth NULL
Definition: ftsmooth.c:416
PBRUSH pbrush
Definition: brush.h:84
#define HOOK_LINETO
Definition: winddi.h:1428
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
#define b
Definition: ke_i.h:79
BOOL APIENTRY EngLineTo(_Inout_ SURFOBJ *DestObj, _In_ CLIPOBJ *Clip, _In_ BRUSHOBJ *pbo, _In_ LONG x1, _In_ LONG y1, _In_ LONG x2, _In_ LONG y2, _In_opt_ RECTL *RectBounds, _In_ MIX mix)
Definition: lineto.c:440
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
_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
#define GDIDEVFUNCS(SurfObj)
Definition: surface.h:106
#define BR_IS_NULL
Definition: brush.h:101
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
int ret
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG _In_ LONG _In_ LONG _In_ LONG y2
Definition: winddi.h:3706
FLONG flags
Definition: surface.h:10
#define min(a, b)
Definition: monoChain.cc:55
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG _In_ LONG _In_ LONG x2
Definition: winddi.h:3706
#define HOOK_STROKEPATH
Definition: winddi.h:1425

Referenced by IntEngPolyline().

◆ IntEngPaint()

BOOL APIENTRY IntEngPaint ( _In_ SURFOBJ pso,
_In_ CLIPOBJ pco,
_In_ BRUSHOBJ pbo,
_In_ POINTL pptlBrushOrg,
_In_ __in_data_source(USER_MODE) MIX  mix 
)

Definition at line 85 of file paint.c.

91 {
92  SURFACE *psurf = CONTAINING_RECORD(pso, SURFACE, SurfObj);
93 
94  /* Is the surface's Paint function hooked? */
95  if ((pso->iType != STYPE_BITMAP) && (psurf->flags & HOOK_PAINT))
96  {
97  /* Call the driver's DrvPaint */
98  return GDIDEVFUNCS(pso).Paint(pso, pco, pbo, pptlBrushOrg, mix);
99  }
100 
101  return EngPaint(pso, pco, pbo, pptlBrushOrg, mix);
102 }
#define STYPE_BITMAP
Definition: winddi.h:1175
_In_ PATHOBJ _In_ CLIPOBJ _In_ BRUSHOBJ _In_ POINTL * pptlBrushOrg
Definition: winddi.h:3591
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
_In_ HANDLE _In_ SURFOBJ * pso
Definition: winddi.h:3664
_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
#define GDIDEVFUNCS(SurfObj)
Definition: surface.h:106
_In_ SURFOBJ _In_ CLIPOBJ * pco
Definition: winddi.h:3414
BOOL APIENTRY EngPaint(_In_ SURFOBJ *pso, _In_ CLIPOBJ *pco, _In_ BRUSHOBJ *pbo, _In_ POINTL *pptlBrushOrg, _In_ __in_data_source(USER_MODE) MIX mix)
Definition: paint.c:54
FLONG flags
Definition: surface.h:10
_In_ PATHOBJ _In_ CLIPOBJ _In_ BRUSHOBJ _In_ POINTL _In_ MIX mix
Definition: winddi.h:3591
#define HOOK_PAINT
Definition: winddi.h:1424

Referenced by IntGdiFillRgn().

◆ IntEngPolyline()

BOOL APIENTRY IntEngPolyline ( SURFOBJ DestSurf,
CLIPOBJ Clip,
BRUSHOBJ Brush,
CONST LPPOINT  pt,
LONG  dCount,
MIX  mix 
)

Definition at line 703 of file lineto.c.

709 {
710  LONG i;
711  RECTL rect;
712  BOOL ret = FALSE;
713 
714  // Draw the Polyline with a call to IntEngLineTo for each segment.
715  for (i = 1; i < dCount; i++)
716  {
717  rect.left = min(pt[i-1].x, pt[i].x);
718  rect.top = min(pt[i-1].y, pt[i].y);
719  rect.right = max(pt[i-1].x, pt[i].x);
720  rect.bottom = max(pt[i-1].y, pt[i].y);
721  ret = IntEngLineTo(psoDest,
722  Clip,
723  pbo,
724  pt[i-1].x,
725  pt[i-1].y,
726  pt[i].x,
727  pt[i].y,
728  &rect,
729  Mix);
730  if (!ret)
731  {
732  break;
733  }
734  }
735 
736  return ret;
737 }
#define max(a, b)
Definition: svc.c:63
#define pt(x, y)
Definition: drawing.c:79
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
& rect
Definition: startmenu.cpp:1413
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
BOOL APIENTRY IntEngLineTo(SURFOBJ *psoDest, CLIPOBJ *ClipObj, BRUSHOBJ *pbo, LONG x1, LONG y1, LONG x2, LONG y2, RECTL *RectBounds, MIX Mix)
Definition: lineto.c:621
unsigned int BOOL
Definition: ntddk_ex.h:94
long LONG
Definition: pedump.c:60
_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
int ret
#define min(a, b)
Definition: monoChain.cc:55
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548

Referenced by IntGdiPolyline().

◆ IntEngStretchBlt()

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 
)

◆ IntEngTransparentBlt()

BOOL FASTCALL IntEngTransparentBlt ( SURFOBJ Dest,
SURFOBJ Source,
CLIPOBJ Clip,
XLATEOBJ ColorTranslation,
PRECTL  DestRect,
PRECTL  SourceRect,
ULONG  iTransColor,
ULONG  Reserved 
)

Definition at line 207 of file transblt.c.

216 {
217  BOOL Ret;
218  RECTL OutputRect, InputClippedRect;
219  SURFACE *psurfDest;
220  SURFACE *psurfSource;
221  RECTL InputRect;
222  LONG InputClWidth, InputClHeight, InputWidth, InputHeight;
223 
224  ASSERT(psoDest);
225  ASSERT(psoSource);
226  ASSERT(DestRect);
227 
228  psurfDest = CONTAINING_RECORD(psoDest, SURFACE, SurfObj);
229  psurfSource = CONTAINING_RECORD(psoSource, SURFACE, SurfObj);
230 
231  ASSERT(psurfDest);
232  ASSERT(psurfSource);
233 
234  /* If no clip object is given, use trivial one */
235  if (!Clip) Clip = (CLIPOBJ *)&gxcoTrivial;
236 
237  InputClippedRect = *DestRect;
238  if (InputClippedRect.right < InputClippedRect.left)
239  {
240  InputClippedRect.left = DestRect->right;
241  InputClippedRect.right = DestRect->left;
242  }
243  if (InputClippedRect.bottom < InputClippedRect.top)
244  {
245  InputClippedRect.top = DestRect->bottom;
246  InputClippedRect.bottom = DestRect->top;
247  }
248 
249  InputRect = *SourceRect;
250  /* Clip against the bounds of the clipping region so we won't try to write
251  * outside the surface */
252  if (Clip->iDComplexity != DC_TRIVIAL)
253  {
254  if (!RECTL_bIntersectRect(&OutputRect, &InputClippedRect, &Clip->rclBounds))
255  {
256  return TRUE;
257  }
258  /* Update source rect */
259  InputClWidth = InputClippedRect.right - InputClippedRect.left;
260  InputClHeight = InputClippedRect.bottom - InputClippedRect.top;
261  InputWidth = InputRect.right - InputRect.left;
262  InputHeight = InputRect.bottom - InputRect.top;
263 
264  InputRect.left += (InputWidth * (OutputRect.left - InputClippedRect.left)) / InputClWidth;
265  InputRect.right -= (InputWidth * (InputClippedRect.right - OutputRect.right)) / InputClWidth;
266  InputRect.top += (InputHeight * (OutputRect.top - InputClippedRect.top)) / InputClHeight;
267  InputRect.bottom -= (InputHeight * (InputClippedRect.bottom - OutputRect.bottom)) / InputClHeight;
268  }
269  else
270  {
271  OutputRect = InputClippedRect;
272  }
273 
274  if (psurfDest->flags & HOOK_TRANSPARENTBLT)
275  {
276  Ret = GDIDEVFUNCS(psoDest).TransparentBlt(psoDest,
277  psoSource,
278  Clip,
279  ColorTranslation,
280  &OutputRect,
281  &InputRect,
282  iTransColor,
283  Reserved);
284  }
285  else
286  Ret = FALSE;
287 
288  if (!Ret)
289  {
290  Ret = EngTransparentBlt(psoDest,
291  psoSource,
292  Clip,
293  ColorTranslation,
294  &OutputRect,
295  &InputRect,
296  iTransColor,
297  Reserved);
298  }
299 
300  return Ret;
301 }
BOOL APIENTRY EngTransparentBlt(SURFOBJ *psoDest, SURFOBJ *psoSource, CLIPOBJ *Clip, XLATEOBJ *ColorTranslation, PRECTL DestRect, PRECTL SourceRect, ULONG iTransColor, ULONG Reserved)
Definition: transblt.c:16
#define TRUE
Definition: types.h:120
XCLIPOBJ gxcoTrivial
Definition: bitblt.c:15
#define HOOK_TRANSPARENTBLT
Definition: winddi.h:1434
#define DC_TRIVIAL
Definition: winddi.h:259
long bottom
Definition: polytest.cpp:53
_In_ SURFOBJ _In_ CLIPOBJ _In_opt_ XLATEOBJ _In_ RECTL _In_ RECTL _In_ ULONG iTransColor
Definition: winddi.h:4190
long right
Definition: polytest.cpp:53
unsigned int BOOL
Definition: ntddk_ex.h:94
long LONG
Definition: pedump.c:60
long top
Definition: polytest.cpp:53
RECTL rclBounds
Definition: winddi.h:277
_Reserved_ PVOID Reserved
Definition: winddi.h:3974
long left
Definition: polytest.cpp:53
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
#define GDIDEVFUNCS(SurfObj)
Definition: surface.h:106
BOOL FASTCALL RECTL_bIntersectRect(_Out_ RECTL *prclDst, _In_ const RECTL *prcl1, _In_ const RECTL *prcl2)
Definition: rect.c:55
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
BYTE iDComplexity
Definition: winddi.h:278
FLONG flags
Definition: surface.h:10

Referenced by NtGdiTransparentBlt().

◆ IntEngUpdateClipRegion()

VOID FASTCALL IntEngUpdateClipRegion ( XCLIPOBJ Clip,
ULONG  count,
const RECTL pRect,
const RECTL rcBounds 
)

Definition at line 173 of file clip.c.

178 {
179  if(count > 1)
180  {
181  RECTL* NewRects = EngAllocMem(0, FIELD_OFFSET(ENUMRECTS, arcl[count]), GDITAG_CLIPOBJ);
182 
183  if(NewRects != NULL)
184  {
185  Clip->RectCount = count;
186  Clip->iDirection = CD_ANY;
187  RtlCopyMemory(NewRects, pRect, count * sizeof(RECTL));
188 
189  Clip->iDComplexity = DC_COMPLEX;
190  Clip->iFComplexity = ((Clip->RectCount <= 4) ? FC_RECT4 : FC_COMPLEX);
191  Clip->iMode = TC_RECTANGLES;
192  Clip->rclBounds = *rcBounds;
193 
194  if (Clip->Rects != &Clip->rclBounds)
195  EngFreeMem(Clip->Rects);
196  Clip->Rects = NewRects;
197  }
198  }
199  else
200  {
201  Clip->iDirection = CD_ANY;
202 
203  Clip->iDComplexity = (((rcBounds->top == rcBounds->bottom) &&
204  (rcBounds->left == rcBounds->right))
205  ? DC_TRIVIAL : DC_RECT);
206 
207  Clip->iFComplexity = FC_RECT;
208  Clip->iMode = TC_RECTANGLES;
209  Clip->rclBounds = *rcBounds;
210  Clip->RectCount = 1;
211  if (Clip->Rects != &Clip->rclBounds)
212  EngFreeMem(Clip->Rects);
213  Clip->Rects = &Clip->rclBounds;
214  }
215 }
#define FC_RECT4
Definition: winddi.h:265
NTSYSAPI VOID NTAPI RtlCopyMemory(VOID UNALIGNED *Destination, CONST VOID UNALIGNED *Source, ULONG Length)
ULONG iDirection
Definition: engobjects.h:68
#define EngFreeMem
Definition: polytest.cpp:56
#define TC_RECTANGLES
Definition: winddi.h:269
GLuint GLuint GLsizei count
Definition: gl.h:1545
#define DC_TRIVIAL
Definition: winddi.h:259
long bottom
Definition: polytest.cpp:53
#define FC_COMPLEX
Definition: winddi.h:266
long right
Definition: polytest.cpp:53
long top
Definition: polytest.cpp:53
smooth NULL
Definition: ftsmooth.c:416
long left
Definition: polytest.cpp:53
#define DC_RECT
Definition: winddi.h:260
void * EngAllocMem(int zero, unsigned long size, int tag=0)
Definition: polytest.cpp:70
#define DC_COMPLEX
Definition: winddi.h:261
DWORD RectCount
Definition: engobjects.h:75
#define FC_RECT
Definition: winddi.h:264
#define GDITAG_CLIPOBJ
Definition: tags.h:77
RECTL * Rects
Definition: engobjects.h:62
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:254
#define CD_ANY
Definition: winddi.h:1326

Referenced by CLIPPING_UpdateGCRegion(), EngLineTo(), IntEngWndUpdateClipObj(), IntGdiBitBltRgn(), and IntGdiFillRgn().