ReactOS  r75385
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

#define ENUM_RECT_LIMIT   32

Definition at line 5 of file inteng.h.

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

Definition at line 49 of file inteng.h.

Referenced by BltMask(), DbgDrvBitBlt(), DIB_XXBPP_StretchBlt(), IntEngBitBlt(), and IntEngStretchBlt().

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

Definition at line 40 of file inteng.h.

Referenced by GreExtTextOutW(), IntGdiLineTo(), IntGdiPolygon(), IntGdiPolyline(), and IntRectangle().

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

Definition at line 52 of file inteng.h.

Referenced by BltMask(), and EngBitBlt().

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

Definition at line 51 of file inteng.h.

Referenced by BltMask(), and EngBitBlt().

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

Definition at line 55 of file inteng.h.

Referenced by EngMaskBitBlt(), and NtGdiSetDIBitsToDeviceInternal().

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

Definition at line 56 of file inteng.h.

Referenced by IntEngMaskBlt().

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

Definition at line 54 of file inteng.h.

Referenced by EngBitBlt(), and EngStretchBltROP().

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

Definition at line 44 of file inteng.h.

Referenced by BltMask(), and EngBitBlt().

#define ROP4_USES_MASK (   Rop4)    ((((Rop4) & 0xFF00) >> 8) != ((Rop4) & 0x00ff))
#define ROP4_USES_PATTERN (   Rop4)    ((((Rop4) & 0xF0F0) >> 4) != ((Rop4) & 0x0F0F))
#define ROP4_USES_SOURCE (   Rop4)    ((((Rop4) & 0xCCCC) >> 2) != ((Rop4) & 0x3333))

Typedef Documentation

typedef ULONG HCLIP

Definition at line 3 of file inteng.h.

typedef struct tagSPAN * PSPAN
typedef struct tagSPAN SPAN

Enumeration Type Documentation

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

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.

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

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
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel)?(CompletionRoutine!=NULL):TRUE)
#define HOOK_ALPHABLEND
Definition: winddi.h:1435
#define FALSE
Definition: types.h:117
_In_ SURFOBJ _In_ CLIPOBJ _In_opt_ XLATEOBJ _In_ RECTL _In_ RECTL * prclSrc
Definition: winddi.h:3414
unsigned int BOOL
Definition: ntddk_ex.h:94
#define GDIDEVFUNCS(SurfObj)
Definition: surface.h:99
_In_ SURFOBJ _In_ CLIPOBJ _In_opt_ XLATEOBJ _In_ RECTL * prclDest
Definition: winddi.h:3414
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
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260
_In_ SURFOBJ _In_ CLIPOBJ _In_opt_ XLATEOBJ * pxlo
Definition: winddi.h:3414
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.

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

616 {
617  SURFACE *psurfTrg;
618  SURFACE *psurfSrc = NULL;
619  BOOL bResult;
620  RECTL rclClipped;
621  RECTL rclSrc;
622  POINTL ptlBrush;
623  PFN_DrvBitBlt pfnBitBlt;
624 
625  ASSERT(psoTrg);
626  psurfTrg = CONTAINING_RECORD(psoTrg, SURFACE, SurfObj);
627 
628  /* FIXME: Should we really allow to pass non-well-ordered rects? */
629  rclClipped = *prclTrg;
630  RECTL_vMakeWellOrdered(&rclClipped);
631 
632  //DPRINT1("Rop4 : 0x%08x\n", Rop4);
633 
634  /* Sanity check */
635  ASSERT(IS_VALID_ROP4(Rop4));
636 
637  if (pco)
638  {
639  /* Clip target rect against the bounds of the clipping region */
640  if (!RECTL_bIntersectRect(&rclClipped, &rclClipped, &pco->rclBounds))
641  {
642  /* Nothing left */
643  return TRUE;
644  }
645 
646  /* Don't pass a clipobj with only a single rect */
647  if (pco->iDComplexity == DC_RECT)
648  pco = NULL;
649  }
650  else
651  pco = (CLIPOBJ *)&gxcoTrivial;
652 
653  if (ROP4_USES_SOURCE(Rop4))
654  {
655  ASSERT(psoSrc);
656  psurfSrc = CONTAINING_RECORD(psoSrc, SURFACE, SurfObj);
657 
658  /* Calculate source rect */
659  rclSrc.left = pptlSrc->x + rclClipped.left - prclTrg->left;
660  rclSrc.top = pptlSrc->y + rclClipped.top - prclTrg->top;
661  rclSrc.right = rclSrc.left + rclClipped.right - rclClipped.left;
662  rclSrc.bottom = rclSrc.top + rclClipped.bottom - rclClipped.top;
663  pptlSrc = (PPOINTL)&rclSrc;
664  }
665  else
666  {
667  psoSrc = NULL;
668  psurfSrc = NULL;
669  }
670 
671  if (pptlBrush)
672  {
673 #ifdef _USE_DIBLIB_
674  ptlBrush.x = pptlBrush->x + rclClipped.left - prclTrg->left;
675  ptlBrush.y = pptlBrush->y + rclClipped.top - prclTrg->top;
676 #else
677  ptlBrush = *pptlBrush;
678 #endif
679  }
680 
681  /* Is the target surface device managed? */
682  if (psurfTrg->flags & HOOK_BITBLT)
683  {
684  /* Is the source a different device managed surface? */
685  if (psoSrc && psoSrc->hdev != psoTrg->hdev && psurfSrc->flags & HOOK_BITBLT)
686  {
687  DPRINT1("Need to copy to standard bitmap format!\n");
688  ASSERT(FALSE);
689  }
690 
691  pfnBitBlt = GDIDEVFUNCS(psoTrg).BitBlt;
692  }
693 
694  /* Is the source surface device managed? */
695  else if (psoSrc && psurfSrc->flags & HOOK_BITBLT)
696  {
697  pfnBitBlt = GDIDEVFUNCS(psoSrc).BitBlt;
698  }
699  else
700  {
701  pfnBitBlt = EngBitBlt;
702  }
703 
704  bResult = pfnBitBlt(psoTrg,
705  psoSrc,
706  psoMask,
707  pco,
708  pxlo,
709  &rclClipped,
710  pptlSrc,
711  pptlMask,
712  pbo,
713  pptlBrush ? &ptlBrush : NULL,
714  Rop4);
715 
716  // FIXME: cleanup temp surface!
717 
718  return bResult;
719 }
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
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel)?(CompletionRoutine!=NULL):TRUE)
long bottom
Definition: polytest.cpp:53
_In_opt_ SURFOBJ _In_opt_ SURFOBJ _In_ CLIPOBJ _In_opt_ XLATEOBJ _In_ RECTL * prclTrg
Definition: winddi.h:3433
VOID FASTCALL RECTL_vMakeWellOrdered(_Inout_ RECTL *prcl)
Definition: rect.c:81
#define IS_VALID_ROP4(rop)
Definition: inteng.h:49
LONG y
Definition: windef.h:343
_In_ SURFOBJ * psoSrc
Definition: winddi.h:3414
long right
Definition: polytest.cpp:53
#define FALSE
Definition: types.h:117
long top
Definition: polytest.cpp:53
smooth NULL
Definition: ftsmooth.c:513
#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
#define DC_RECT
Definition: winddi.h:260
unsigned int BOOL
Definition: ntddk_ex.h:94
#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:99
LONG x
Definition: windef.h:342
_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
BOOL FASTCALL RECTL_bIntersectRect(_Out_ RECTL *prclDst, _In_ const RECTL *prcl1, _In_ const RECTL *prcl2)
Definition: rect.c:55
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260
_In_ SURFOBJ _In_ CLIPOBJ _In_opt_ XLATEOBJ * pxlo
Definition: winddi.h:3414
BOOL APIENTRY IntEngCopyBits ( SURFOBJ psoDest,
SURFOBJ psoSource,
CLIPOBJ pco,
XLATEOBJ pxlo,
RECTL prclDest,
POINTL ptlSource 
)

Definition at line 677 of file bitblt_new.c.

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

684 {
685  return EngCopyBits(psoTrg, psoSrc, pco, pxlo, prclTrg, pptlSrc);
686 }
BOOL APIENTRY EngCopyBits(SURFOBJ *psoTrg, SURFOBJ *psoSrc, CLIPOBJ *pco, XLATEOBJ *pxlo, RECTL *prclTrg, POINTL *pptlSrc)
Definition: bitblt_new.c:636
_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_opt_ SURFOBJ _In_opt_ SURFOBJ _In_ CLIPOBJ _In_opt_ XLATEOBJ _In_ RECTL _In_opt_ POINTL * pptlSrc
Definition: winddi.h:3433
VOID FASTCALL IntEngFreeClipResources ( XCLIPOBJ Clip)

Definition at line 164 of file clip.c.

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

165 {
166  if (Clip->Rects != &Clip->rclBounds)
167  EngFreeMem(Clip->Rects);
168 }
#define EngFreeMem
Definition: polytest.cpp:56
RECTL * Rects
Definition: engobjects.h:62
BOOL APIENTRY IntEngGradientFill ( SURFOBJ psoDest,
CLIPOBJ pco,
XLATEOBJ pxlo,
TRIVERTEX pVertex,
ULONG  nVertex,
PVOID  pMesh,
ULONG  nMesh,
RECTL prclExtents,
POINTL pptlDitherOrg,
ULONG  ulMode 
)
VOID FASTCALL IntEngInitClipObj ( XCLIPOBJ Clip)

Definition at line 158 of file clip.c.

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

159 {
160  Clip->Rects = &Clip->rclBounds;
161 }
RECTL * Rects
Definition: engobjects.h:62
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.

Referenced by IntEngPolyline().

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
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel)?(CompletionRoutine!=NULL):TRUE)
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG x1
Definition: winddi.h:3706
#define DC_TRIVIAL
Definition: winddi.h:259
long bottom
Definition: polytest.cpp:53
long right
Definition: polytest.cpp:53
#define FALSE
Definition: types.h:117
long top
Definition: polytest.cpp:53
smooth NULL
Definition: ftsmooth.c:513
PBRUSH pbrush
Definition: brush.h:84
#define HOOK_LINETO
Definition: winddi.h:1428
long left
Definition: polytest.cpp:53
#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
unsigned char BOOLEAN
_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:99
#define BR_IS_NULL
Definition: brush.h:101
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 CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260
#define HOOK_STROKEPATH
Definition: winddi.h:1425
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.

Referenced by IntGdiFillRgn().

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
_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:99
_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 CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260
#define HOOK_PAINT
Definition: winddi.h:1424
BOOL APIENTRY IntEngPolyline ( SURFOBJ DestSurf,
CLIPOBJ Clip,
BRUSHOBJ Brush,
CONST LPPOINT  pt,
LONG  dCount,
MIX  mix 
)

Definition at line 703 of file lineto.c.

Referenced by IntGdiPolyline().

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
long bottom
Definition: polytest.cpp:53
& rect
Definition: startmenu.cpp:1413
long right
Definition: polytest.cpp:53
GLenum GLclampf GLint i
Definition: glfuncs.h:14
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
#define FALSE
Definition: types.h:117
long LONG
Definition: pedump.c:60
long top
Definition: polytest.cpp:53
long left
Definition: polytest.cpp:53
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
int ret
#define min(a, b)
Definition: monoChain.cc:55
INT INT y
Definition: msvc.h:62
INT x
Definition: msvc.h:62
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 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.

Referenced by NtGdiTransparentBlt().

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
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel)?(CompletionRoutine!=NULL):TRUE)
#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
#define FALSE
Definition: types.h:117
long LONG
Definition: pedump.c:60
long top
Definition: polytest.cpp:53
RECTL rclBounds
Definition: winddi.h:277
long left
Definition: polytest.cpp:53
unsigned int BOOL
Definition: ntddk_ex.h:94
#define GDIDEVFUNCS(SurfObj)
Definition: surface.h:99
ULONG PVOID Reserved
Definition: ntimage.h:533
BYTE iDComplexity
Definition: winddi.h:278
FLONG flags
Definition: surface.h:10
BOOL FASTCALL RECTL_bIntersectRect(_Out_ RECTL *prclDst, _In_ const RECTL *prcl1, _In_ const RECTL *prcl2)
Definition: rect.c:55
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260
VOID FASTCALL IntEngUpdateClipRegion ( XCLIPOBJ Clip,
ULONG  count,
const RECTL pRect,
const RECTL rcBounds 
)

Definition at line 173 of file clip.c.

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

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
#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:513
long left
Definition: polytest.cpp:53
#define DC_RECT
Definition: winddi.h:260
GLuint GLuint GLsizei count
Definition: gl.h:1545
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:255
#define CD_ANY
Definition: winddi.h:1326