ReactOS  r76032
dib.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _BLTINFO
 
struct  DIB_FUNCTIONS
 

Macros

#define ROP4_BLACKNESS   ((((0x00000042) >> 8) & 0xff00) | (((0x00000042) >> 16) & 0x00ff))
 
#define ROP4_NOTSRCERASE   ((((0x001100A6) >> 8) & 0xff00) | (((0x001100A6) >> 16) & 0x00ff))
 
#define ROP4_NOTSRCCOPY   ((((0x00330008) >> 8) & 0xff00) | (((0x00330008) >> 16) & 0x00ff))
 
#define ROP4_SRCERASE   ((((0x00440328) >> 8) & 0xff00) | (((0x00440328) >> 16) & 0x00ff))
 
#define ROP4_DSTINVERT   ((((0x00550009) >> 8) & 0xff00) | (((0x00550009) >> 16) & 0x00ff))
 
#define ROP4_PATINVERT   ((((0x005A0049) >> 8) & 0xff00) | (((0x005A0049) >> 16) & 0x00ff))
 
#define ROP4_SRCINVERT   ((((0x00660046) >> 8) & 0xff00) | (((0x00660046) >> 16) & 0x00ff))
 
#define ROP4_SRCAND   ((((0x008800C6) >> 8) & 0xff00) | (((0x008800C6) >> 16) & 0x00ff))
 
#define ROP4_MERGEPAINT   ((((0x00BB0226) >> 8) & 0xff00) | (((0x00BB0226) >> 16) & 0x00ff))
 
#define ROP4_MERGECOPY   ((((0x00C000CA) >> 8) & 0xff00) | (((0x00C000CA) >> 16) & 0x00ff))
 
#define ROP4_SRCCOPY   ((((0x00CC0020) >> 8) & 0xff00) | (((0x00CC0020) >> 16) & 0x00ff))
 
#define ROP4_SRCPAINT   ((((0x00EE0086) >> 8) & 0xff00) | (((0x00EE0086) >> 16) & 0x00ff))
 
#define ROP4_PATCOPY   ((((0x00F00021) >> 8) & 0xff00) | (((0x00F00021) >> 16) & 0x00ff))
 
#define ROP4_PATPAINT   ((((0x00FB0A09) >> 8) & 0xff00) | (((0x00FB0A09) >> 16) & 0x00ff))
 
#define ROP4_WHITENESS   ((((0x00FF0062) >> 8) & 0xff00) | (((0x00FF0062) >> 16) & 0x00ff))
 
#define MASK1BPP(x)   (1<<(7-((x)&7)))
 
#define DIB_GetSource(SourceSurf, sx, sy, ColorTranslation)
 
#define DIB_GetSourceIndex(SourceSurf, sx, sy)
 

Typedefs

typedef struct _BLTINFO BLTINFO
 
typedef struct _BLTINFOPBLTINFO
 
typedef VOID(* PFN_DIB_PutPixel )(SURFOBJ *, LONG, LONG, ULONG)
 
typedef ULONG(* PFN_DIB_GetPixel )(SURFOBJ *, LONG, LONG)
 
typedef VOID(* PFN_DIB_HLine )(SURFOBJ *, LONG, LONG, LONG, ULONG)
 
typedef VOID(* PFN_DIB_VLine )(SURFOBJ *, LONG, LONG, LONG, ULONG)
 
typedef BOOLEAN(* PFN_DIB_BitBlt )(PBLTINFO)
 
typedef BOOLEAN(* PFN_DIB_StretchBlt )(SURFOBJ *, SURFOBJ *, SURFOBJ *, SURFOBJ *, RECTL *, RECTL *, POINTL *, BRUSHOBJ *, POINTL *, XLATEOBJ *, ROP4)
 
typedef BOOLEAN(* PFN_DIB_TransparentBlt )(SURFOBJ *, SURFOBJ *, RECTL *, RECTL *, XLATEOBJ *, ULONG)
 
typedef BOOLEAN(* PFN_DIB_ColorFill )(SURFOBJ *, RECTL *, ULONG)
 
typedef BOOLEAN(* PFN_DIB_AlphaBlend )(SURFOBJ *, SURFOBJ *, RECTL *, RECTL *, CLIPOBJ *, XLATEOBJ *, BLENDOBJ *)
 

Functions

VOID Dummy_PutPixel (SURFOBJ *, LONG, LONG, ULONG)
 
ULONG Dummy_GetPixel (SURFOBJ *, LONG, LONG)
 
VOID Dummy_HLine (SURFOBJ *, LONG, LONG, LONG, ULONG)
 
VOID Dummy_VLine (SURFOBJ *, LONG, LONG, LONG, ULONG)
 
BOOLEAN Dummy_BitBlt (PBLTINFO)
 
BOOLEAN Dummy_StretchBlt (SURFOBJ *, SURFOBJ *, SURFOBJ *, SURFOBJ *, RECTL *, RECTL *, POINTL *, BRUSHOBJ *, POINTL *, XLATEOBJ *, ROP4)
 
BOOLEAN Dummy_TransparentBlt (SURFOBJ *, SURFOBJ *, RECTL *, RECTL *, XLATEOBJ *, ULONG)
 
BOOLEAN Dummy_ColorFill (SURFOBJ *, RECTL *, ULONG)
 
BOOLEAN Dummy_AlphaBlend (SURFOBJ *, SURFOBJ *, RECTL *, RECTL *, CLIPOBJ *, XLATEOBJ *, BLENDOBJ *)
 
VOID DIB_1BPP_PutPixel (SURFOBJ *, LONG, LONG, ULONG)
 
ULONG DIB_1BPP_GetPixel (SURFOBJ *, LONG, LONG)
 
VOID DIB_1BPP_HLine (SURFOBJ *, LONG, LONG, LONG, ULONG)
 
VOID DIB_1BPP_VLine (SURFOBJ *, LONG, LONG, LONG, ULONG)
 
BOOLEAN DIB_1BPP_BitBlt (PBLTINFO)
 
BOOLEAN DIB_1BPP_BitBltSrcCopy (PBLTINFO)
 
BOOLEAN DIB_1BPP_TransparentBlt (SURFOBJ *, SURFOBJ *, RECTL *, RECTL *, XLATEOBJ *, ULONG)
 
BOOLEAN DIB_1BPP_ColorFill (SURFOBJ *, RECTL *, ULONG)
 
VOID DIB_4BPP_PutPixel (SURFOBJ *, LONG, LONG, ULONG)
 
ULONG DIB_4BPP_GetPixel (SURFOBJ *, LONG, LONG)
 
VOID DIB_4BPP_HLine (SURFOBJ *, LONG, LONG, LONG, ULONG)
 
VOID DIB_4BPP_VLine (SURFOBJ *, LONG, LONG, LONG, ULONG)
 
BOOLEAN DIB_4BPP_BitBlt (PBLTINFO)
 
BOOLEAN DIB_4BPP_BitBltSrcCopy (PBLTINFO)
 
BOOLEAN DIB_4BPP_TransparentBlt (SURFOBJ *, SURFOBJ *, RECTL *, RECTL *, XLATEOBJ *, ULONG)
 
BOOLEAN DIB_4BPP_ColorFill (SURFOBJ *, RECTL *, ULONG)
 
VOID DIB_8BPP_PutPixel (SURFOBJ *, LONG, LONG, ULONG)
 
ULONG DIB_8BPP_GetPixel (SURFOBJ *, LONG, LONG)
 
VOID DIB_8BPP_HLine (SURFOBJ *, LONG, LONG, LONG, ULONG)
 
VOID DIB_8BPP_VLine (SURFOBJ *, LONG, LONG, LONG, ULONG)
 
BOOLEAN DIB_8BPP_BitBlt (PBLTINFO)
 
BOOLEAN DIB_8BPP_BitBltSrcCopy (PBLTINFO)
 
BOOLEAN DIB_8BPP_TransparentBlt (SURFOBJ *, SURFOBJ *, RECTL *, RECTL *, XLATEOBJ *, ULONG)
 
BOOLEAN DIB_8BPP_ColorFill (SURFOBJ *, RECTL *, ULONG)
 
VOID DIB_16BPP_PutPixel (SURFOBJ *, LONG, LONG, ULONG)
 
ULONG DIB_16BPP_GetPixel (SURFOBJ *, LONG, LONG)
 
VOID DIB_16BPP_HLine (SURFOBJ *, LONG, LONG, LONG, ULONG)
 
VOID DIB_16BPP_VLine (SURFOBJ *, LONG, LONG, LONG, ULONG)
 
BOOLEAN DIB_16BPP_BitBlt (PBLTINFO)
 
BOOLEAN DIB_16BPP_BitBltSrcCopy (PBLTINFO)
 
BOOLEAN DIB_16BPP_TransparentBlt (SURFOBJ *, SURFOBJ *, RECTL *, RECTL *, XLATEOBJ *, ULONG)
 
BOOLEAN DIB_16BPP_ColorFill (SURFOBJ *, RECTL *, ULONG)
 
BOOLEAN DIB_16BPP_AlphaBlend (SURFOBJ *, SURFOBJ *, RECTL *, RECTL *, CLIPOBJ *, XLATEOBJ *, BLENDOBJ *)
 
VOID DIB_24BPP_PutPixel (SURFOBJ *, LONG, LONG, ULONG)
 
ULONG DIB_24BPP_GetPixel (SURFOBJ *, LONG, LONG)
 
VOID DIB_24BPP_HLine (SURFOBJ *, LONG, LONG, LONG, ULONG)
 
VOID DIB_24BPP_VLine (SURFOBJ *, LONG, LONG, LONG, ULONG)
 
BOOLEAN DIB_24BPP_BitBlt (PBLTINFO)
 
BOOLEAN DIB_24BPP_BitBltSrcCopy (PBLTINFO)
 
BOOLEAN DIB_24BPP_TransparentBlt (SURFOBJ *, SURFOBJ *, RECTL *, RECTL *, XLATEOBJ *, ULONG)
 
BOOLEAN DIB_24BPP_ColorFill (SURFOBJ *, RECTL *, ULONG)
 
BOOLEAN DIB_24BPP_AlphaBlend (SURFOBJ *, SURFOBJ *, RECTL *, RECTL *, CLIPOBJ *, XLATEOBJ *, BLENDOBJ *)
 
VOID DIB_32BPP_PutPixel (SURFOBJ *, LONG, LONG, ULONG)
 
ULONG DIB_32BPP_GetPixel (SURFOBJ *, LONG, LONG)
 
VOID DIB_32BPP_HLine (SURFOBJ *, LONG, LONG, LONG, ULONG)
 
VOID DIB_32BPP_VLine (SURFOBJ *, LONG, LONG, LONG, ULONG)
 
BOOLEAN DIB_32BPP_BitBlt (PBLTINFO)
 
BOOLEAN DIB_32BPP_BitBltSrcCopy (PBLTINFO)
 
BOOLEAN DIB_32BPP_TransparentBlt (SURFOBJ *, SURFOBJ *, RECTL *, RECTL *, XLATEOBJ *, ULONG)
 
BOOLEAN DIB_32BPP_ColorFill (SURFOBJ *, RECTL *, ULONG)
 
BOOLEAN DIB_32BPP_AlphaBlend (SURFOBJ *, SURFOBJ *, RECTL *, RECTL *, CLIPOBJ *, XLATEOBJ *, BLENDOBJ *)
 
BOOLEAN DIB_XXBPP_StretchBlt (SURFOBJ *, SURFOBJ *, SURFOBJ *, SURFOBJ *, RECTL *, RECTL *, POINTL *, BRUSHOBJ *, POINTL *, XLATEOBJ *, ROP4)
 
BOOLEAN DIB_XXBPP_FloodFillSolid (SURFOBJ *, BRUSHOBJ *, RECTL *, POINTL *, ULONG, UINT)
 
BOOLEAN DIB_XXBPP_AlphaBlend (SURFOBJ *, SURFOBJ *, RECTL *, RECTL *, CLIPOBJ *, XLATEOBJ *, BLENDOBJ *)
 
ULONG DIB_DoRop (ULONG Rop, ULONG Dest, ULONG Source, ULONG Pattern)
 

Variables

DIB_FUNCTIONS DibFunctionsForBitmapFormat []
 
unsigned char notmask [2]
 
unsigned char altnotmask [2]
 

Macro Definition Documentation

#define DIB_GetSource (   SourceSurf,
  sx,
  sy,
  ColorTranslation 
)
Value:
XLATEOBJ_iXlate(ColorTranslation, \
DibFunctionsForBitmapFormat[SourceSurf->iBitmapFormat]. \
DIB_GetPixel(SourceSurf, sx, sy))
DIB_FUNCTIONS DibFunctionsForBitmapFormat[]
Definition: dib.c:20
ENGAPI ULONG APIENTRY XLATEOBJ_iXlate(_In_ XLATEOBJ *pxlo, _In_ ULONG iColor)
Definition: xlateobj.c:664

Definition at line 136 of file dib.h.

Referenced by AlphaBltMask(), DIB_16BPP_AlphaBlend(), DIB_1BPP_BitBlt(), DIB_24BPP_AlphaBlend(), DIB_24BPP_BitBlt(), DIB_32BPP_AlphaBlend(), DIB_4BPP_BitBlt(), and DIB_XXBPP_AlphaBlend().

#define DIB_GetSourceIndex (   SourceSurf,
  sx,
  sy 
)
Value:
DibFunctionsForBitmapFormat[SourceSurf->iBitmapFormat]. \
DIB_GetPixel(SourceSurf, sx, sy)
DIB_FUNCTIONS DibFunctionsForBitmapFormat[]
Definition: dib.c:20

Definition at line 141 of file dib.h.

Referenced by DIB_16BPP_TransparentBlt(), DIB_1BPP_BitBlt(), DIB_24BPP_BitBlt(), DIB_24BPP_TransparentBlt(), DIB_32BPP_TransparentBlt(), DIB_4BPP_BitBlt(), and DIB_8BPP_TransparentBlt().

#define MASK1BPP (   x)    (1<<(7-((x)&7)))

Definition at line 132 of file dib.h.

Referenced by DIB_1BPP_GetPixel(), and DIB_1BPP_PutPixel().

#define ROP4_BLACKNESS   ((((0x00000042) >> 8) & 0xff00) | (((0x00000042) >> 16) & 0x00ff))

Definition at line 3 of file dib.h.

#define ROP4_DSTINVERT   ((((0x00550009) >> 8) & 0xff00) | (((0x00550009) >> 16) & 0x00ff))

Definition at line 7 of file dib.h.

Referenced by NtGdiInvertRgn().

#define ROP4_MERGECOPY   ((((0x00C000CA) >> 8) & 0xff00) | (((0x00C000CA) >> 16) & 0x00ff))

Definition at line 12 of file dib.h.

#define ROP4_MERGEPAINT   ((((0x00BB0226) >> 8) & 0xff00) | (((0x00BB0226) >> 16) & 0x00ff))

Definition at line 11 of file dib.h.

#define ROP4_NOTSRCCOPY   ((((0x00330008) >> 8) & 0xff00) | (((0x00330008) >> 16) & 0x00ff))

Definition at line 5 of file dib.h.

#define ROP4_NOTSRCERASE   ((((0x001100A6) >> 8) & 0xff00) | (((0x001100A6) >> 16) & 0x00ff))

Definition at line 4 of file dib.h.

#define ROP4_PATCOPY   ((((0x00F00021) >> 8) & 0xff00) | (((0x00F00021) >> 16) & 0x00ff))

Definition at line 15 of file dib.h.

Referenced by UserDrawIconEx().

#define ROP4_PATINVERT   ((((0x005A0049) >> 8) & 0xff00) | (((0x005A0049) >> 16) & 0x00ff))

Definition at line 8 of file dib.h.

#define ROP4_PATPAINT   ((((0x00FB0A09) >> 8) & 0xff00) | (((0x00FB0A09) >> 16) & 0x00ff))

Definition at line 16 of file dib.h.

#define ROP4_SRCAND   ((((0x008800C6) >> 8) & 0xff00) | (((0x008800C6) >> 16) & 0x00ff))

Definition at line 10 of file dib.h.

Referenced by IntShowMousePointer(), and UserDrawIconEx().

#define ROP4_SRCCOPY   ((((0x00CC0020) >> 8) & 0xff00) | (((0x00CC0020) >> 16) & 0x00ff))

Definition at line 13 of file dib.h.

Referenced by EngCopyBits(), and UserDrawIconEx().

#define ROP4_SRCERASE   ((((0x00440328) >> 8) & 0xff00) | (((0x00440328) >> 16) & 0x00ff))

Definition at line 6 of file dib.h.

#define ROP4_SRCINVERT   ((((0x00660046) >> 8) & 0xff00) | (((0x00660046) >> 16) & 0x00ff))

Definition at line 9 of file dib.h.

Referenced by IntShowMousePointer(), and UserDrawIconEx().

#define ROP4_SRCPAINT   ((((0x00EE0086) >> 8) & 0xff00) | (((0x00EE0086) >> 16) & 0x00ff))

Definition at line 14 of file dib.h.

#define ROP4_WHITENESS   ((((0x00FF0062) >> 8) & 0xff00) | (((0x00FF0062) >> 16) & 0x00ff))

Definition at line 17 of file dib.h.

Typedef Documentation

typedef BOOLEAN(* PFN_DIB_AlphaBlend)(SURFOBJ *, SURFOBJ *, RECTL *, RECTL *, CLIPOBJ *, XLATEOBJ *, BLENDOBJ *)

Definition at line 41 of file dib.h.

typedef BOOLEAN(* PFN_DIB_BitBlt)(PBLTINFO)

Definition at line 37 of file dib.h.

typedef BOOLEAN(* PFN_DIB_ColorFill)(SURFOBJ *, RECTL *, ULONG)

Definition at line 40 of file dib.h.

typedef ULONG(* PFN_DIB_GetPixel)(SURFOBJ *, LONG, LONG)

Definition at line 34 of file dib.h.

typedef VOID(* PFN_DIB_HLine)(SURFOBJ *, LONG, LONG, LONG, ULONG)

Definition at line 35 of file dib.h.

typedef VOID(* PFN_DIB_PutPixel)(SURFOBJ *, LONG, LONG, ULONG)

Definition at line 33 of file dib.h.

typedef BOOLEAN(* PFN_DIB_StretchBlt)(SURFOBJ *, SURFOBJ *, SURFOBJ *, SURFOBJ *, RECTL *, RECTL *, POINTL *, BRUSHOBJ *, POINTL *, XLATEOBJ *, ROP4)

Definition at line 38 of file dib.h.

typedef BOOLEAN(* PFN_DIB_TransparentBlt)(SURFOBJ *, SURFOBJ *, RECTL *, RECTL *, XLATEOBJ *, ULONG)

Definition at line 39 of file dib.h.

typedef VOID(* PFN_DIB_VLine)(SURFOBJ *, LONG, LONG, LONG, ULONG)

Definition at line 36 of file dib.h.

Function Documentation

BOOLEAN DIB_16BPP_AlphaBlend ( SURFOBJ ,
SURFOBJ ,
RECTL ,
RECTL ,
CLIPOBJ ,
XLATEOBJ ,
BLENDOBJ  
)

Definition at line 576 of file dib16bpp.c.

579 {
580  INT DstX, DstY, SrcX, SrcY;
582  NICEPIXEL32 SrcPixel32;
583  UCHAR Alpha;
584  EXLATEOBJ* pexlo;
585  EXLATEOBJ exloSrcRGB;
586 
587  DPRINT("DIB_16BPP_AlphaBlend: srcRect: (%d,%d)-(%d,%d), dstRect: (%d,%d)-(%d,%d)\n",
588  SourceRect->left, SourceRect->top, SourceRect->right, SourceRect->bottom,
589  DestRect->left, DestRect->top, DestRect->right, DestRect->bottom);
590 
591  BlendFunc = BlendObj->BlendFunction;
592  if (BlendFunc.BlendOp != AC_SRC_OVER)
593  {
594  DPRINT1("BlendOp != AC_SRC_OVER\n");
595  return FALSE;
596  }
597  if (BlendFunc.BlendFlags != 0)
598  {
599  DPRINT1("BlendFlags != 0\n");
600  return FALSE;
601  }
602  if ((BlendFunc.AlphaFormat & ~AC_SRC_ALPHA) != 0)
603  {
604  DPRINT1("Unsupported AlphaFormat (0x%x)\n", BlendFunc.AlphaFormat);
605  return FALSE;
606  }
607  if ((BlendFunc.AlphaFormat & AC_SRC_ALPHA) != 0 &&
608  (BitsPerFormat(Source->iBitmapFormat) != 32))
609  {
610  DPRINT1("Source bitmap must be 32bpp when AC_SRC_ALPHA is set\n");
611  return FALSE;
612  }
613 
614  if (!ColorTranslation)
615  {
616  DPRINT1("ColorTranslation must not be NULL!\n");
617  return FALSE;
618  }
619 
620  pexlo = CONTAINING_RECORD(ColorTranslation, EXLATEOBJ, xlo);
621  EXLATEOBJ_vInitialize(&exloSrcRGB, pexlo->ppalSrc, &gpalRGB, 0, 0, 0);
622 
623  if (pexlo->ppalDst->flFlags & PAL_RGB16_555)
624  {
625  NICEPIXEL16_555 DstPixel16;
626 
627  SrcY = SourceRect->top;
628  DstY = DestRect->top;
629  while ( DstY < DestRect->bottom )
630  {
631  SrcX = SourceRect->left;
632  DstX = DestRect->left;
633  while(DstX < DestRect->right)
634  {
635  SrcPixel32.ul = DIB_GetSource(Source, SrcX, SrcY, &exloSrcRGB.xlo);
636  SrcPixel32.col.red = (SrcPixel32.col.red * BlendFunc.SourceConstantAlpha) / 255;
637  SrcPixel32.col.green = (SrcPixel32.col.green * BlendFunc.SourceConstantAlpha) / 255;
638  SrcPixel32.col.blue = (SrcPixel32.col.blue * BlendFunc.SourceConstantAlpha) / 255;
639 
640  Alpha = ((BlendFunc.AlphaFormat & AC_SRC_ALPHA) != 0) ?
641  (SrcPixel32.col.alpha * BlendFunc.SourceConstantAlpha) / 255 :
642  BlendFunc.SourceConstantAlpha;
643 
644  Alpha >>= 3;
645 
646  DstPixel16.us = DIB_16BPP_GetPixel(Dest, DstX, DstY) & 0xFFFF;
647  /* Perform bit loss */
648  SrcPixel32.col.red >>= 3;
649  SrcPixel32.col.green >>= 3;
650  SrcPixel32.col.blue >>= 3;
651 
652  /* Do the blend in the right bit depth */
653  DstPixel16.col.red = Clamp5((DstPixel16.col.red * (31 - Alpha)) / 31 + SrcPixel32.col.red);
654  DstPixel16.col.green = Clamp5((DstPixel16.col.green * (31 - Alpha)) / 31 + SrcPixel32.col.green);
655  DstPixel16.col.blue = Clamp5((DstPixel16.col.blue * (31 - Alpha)) / 31 + SrcPixel32.col.blue);
656 
657  DIB_16BPP_PutPixel(Dest, DstX, DstY, DstPixel16.us);
658 
659  DstX++;
660  SrcX = SourceRect->left + ((DstX-DestRect->left)*(SourceRect->right - SourceRect->left))
661  /(DestRect->right-DestRect->left);
662  }
663  DstY++;
664  SrcY = SourceRect->top + ((DstY-DestRect->top)*(SourceRect->bottom - SourceRect->top))
665  /(DestRect->bottom-DestRect->top);
666  }
667  }
668  else
669  {
670  NICEPIXEL16_565 DstPixel16;
671  UCHAR Alpha6, Alpha5;
672 
673  SrcY = SourceRect->top;
674  DstY = DestRect->top;
675  while ( DstY < DestRect->bottom )
676  {
677  SrcX = SourceRect->left;
678  DstX = DestRect->left;
679  while(DstX < DestRect->right)
680  {
681  SrcPixel32.ul = DIB_GetSource(Source, SrcX, SrcY, &exloSrcRGB.xlo);
682  SrcPixel32.col.red = (SrcPixel32.col.red * BlendFunc.SourceConstantAlpha) / 255;
683  SrcPixel32.col.green = (SrcPixel32.col.green * BlendFunc.SourceConstantAlpha) / 255;
684  SrcPixel32.col.blue = (SrcPixel32.col.blue * BlendFunc.SourceConstantAlpha) / 255;
685 
686  Alpha = ((BlendFunc.AlphaFormat & AC_SRC_ALPHA) != 0) ?
687  (SrcPixel32.col.alpha * BlendFunc.SourceConstantAlpha) / 255 :
688  BlendFunc.SourceConstantAlpha;
689 
690  Alpha6 = Alpha >> 2;
691  Alpha5 = Alpha >> 3;
692 
693  DstPixel16.us = DIB_16BPP_GetPixel(Dest, DstX, DstY) & 0xFFFF;
694  /* Perform bit loss */
695  SrcPixel32.col.red >>= 3;
696  SrcPixel32.col.green >>= 2;
697  SrcPixel32.col.blue >>= 3;
698 
699  /* Do the blend in the right bit depth */
700  DstPixel16.col.red = Clamp5((DstPixel16.col.red * (31 - Alpha5)) / 31 + SrcPixel32.col.red);
701  DstPixel16.col.green = Clamp6((DstPixel16.col.green * (63 - Alpha6)) / 63 + SrcPixel32.col.green);
702  DstPixel16.col.blue = Clamp5((DstPixel16.col.blue * (31 - Alpha5)) / 31 + SrcPixel32.col.blue);
703 
704  DIB_16BPP_PutPixel(Dest, DstX, DstY, DstPixel16.us);
705 
706  DstX++;
707  SrcX = SourceRect->left + ((DstX-DestRect->left)*(SourceRect->right - SourceRect->left))
708  /(DestRect->right-DestRect->left);
709  }
710  DstY++;
711  SrcY = SourceRect->top + ((DstY-DestRect->top)*(SourceRect->bottom - SourceRect->top))
712  /(DestRect->bottom-DestRect->top);
713  }
714  }
715 
716  EXLATEOBJ_vCleanup(&exloSrcRGB);
717 
718  return TRUE;
719 }
#define TRUE
Definition: types.h:120
#define BitsPerFormat(Format)
Definition: surface.h:102
static __inline UCHAR Clamp5(ULONG val)
Definition: dib16bpp.c:570
#define AC_SRC_ALPHA
Definition: alphablend.c:9
struct NICEPIXEL16_565::@3881 col
int32_t INT
Definition: typedefs.h:56
BYTE BlendOp
Definition: wingdi.h:2736
struct NICEPIXEL16_555::@3882 col
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
#define DIB_GetSource(SourceSurf, sx, sy, ColorTranslation)
Definition: dib.h:136
#define FALSE
Definition: types.h:117
void DPRINT(...)
Definition: polytest.cpp:61
GLint GLint bottom
Definition: glext.h:7726
VOID NTAPI EXLATEOBJ_vCleanup(_Inout_ PEXLATEOBJ pexlo)
Definition: xlateobj.c:649
BYTE SourceConstantAlpha
Definition: wingdi.h:2738
VOID DIB_16BPP_PutPixel(SURFOBJ *SurfObj, LONG x, LONG y, ULONG c)
Definition: dib16bpp.c:17
GLdouble GLdouble right
Definition: glext.h:10859
unsigned char UCHAR
Definition: xmlstorage.h:181
BYTE BlendFlags
Definition: wingdi.h:2737
#define AC_SRC_OVER
Definition: wingdi.h:1350
FLONG flFlags
Definition: palette.h:40
ULONG DIB_16BPP_GetPixel(SURFOBJ *SurfObj, LONG x, LONG y)
Definition: dib16bpp.c:26
static __inline UCHAR Clamp6(ULONG val)
Definition: dib16bpp.c:564
#define DPRINT1
Definition: precomp.h:8
struct NICEPIXEL32::@3879 col
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:259
PALETTE gpalRGB
Definition: palette.c:17
PPALETTE ppalSrc
Definition: xlateobj.h:25
BYTE AlphaFormat
Definition: wingdi.h:2739
BLENDFUNCTION BlendFunc
Definition: general.c:30
ULONG ul
Definition: alphablend.c:16
PPALETTE ppalDst
Definition: xlateobj.h:26
BOOLEAN DIB_16BPP_BitBlt ( PBLTINFO  )
BOOLEAN DIB_16BPP_BitBltSrcCopy ( PBLTINFO  )

Definition at line 140 of file dib16bpp.c.

141 {
142  LONG i, j, sx, sy, xColor, f1;
143  PBYTE SourceBits, DestBits, SourceLine, DestLine;
144  PBYTE SourceBits_4BPP, SourceLine_4BPP;
145  DestBits = (PBYTE)BltInfo->DestSurface->pvScan0 + (BltInfo->DestRect.top * BltInfo->DestSurface->lDelta) + 2 * BltInfo->DestRect.left;
146 
147  switch(BltInfo->SourceSurface->iBitmapFormat)
148  {
149  case BMF_1BPP:
150  sx = BltInfo->SourcePoint.x;
151  sy = BltInfo->SourcePoint.y;
152  for (j=BltInfo->DestRect.top; j<BltInfo->DestRect.bottom; j++)
153  {
154  sx = BltInfo->SourcePoint.x;
155  for (i=BltInfo->DestRect.left; i<BltInfo->DestRect.right; i++)
156  {
157  if(DIB_1BPP_GetPixel(BltInfo->SourceSurface, sx, sy) == 0)
158  {
159  DIB_16BPP_PutPixel(BltInfo->DestSurface, i, j,
160  XLATEOBJ_iXlate(BltInfo->XlateSourceToDest, 0));
161  }
162  else
163  {
164  DIB_16BPP_PutPixel(BltInfo->DestSurface, i, j,
165  XLATEOBJ_iXlate(BltInfo->XlateSourceToDest, 1));
166  }
167  sx++;
168  }
169  sy++;
170  }
171  break;
172 
173  case BMF_4BPP:
174  SourceBits_4BPP = (PBYTE)BltInfo->SourceSurface->pvScan0 +
175  (BltInfo->SourcePoint.y * BltInfo->SourceSurface->lDelta) +
176  (BltInfo->SourcePoint.x >> 1);
177 
178  for (j=BltInfo->DestRect.top; j<BltInfo->DestRect.bottom; j++)
179  {
180  SourceLine_4BPP = SourceBits_4BPP;
181  sx = BltInfo->SourcePoint.x;
182  f1 = sx & 1;
183 
184  for (i=BltInfo->DestRect.left; i<BltInfo->DestRect.right; i++)
185  {
186  xColor = XLATEOBJ_iXlate(BltInfo->XlateSourceToDest,
187  (*SourceLine_4BPP & altnotmask[f1]) >> (4 * (1 - f1)));
188  DIB_16BPP_PutPixel(BltInfo->DestSurface, i, j, xColor);
189  if(f1 == 1)
190  {
191  SourceLine_4BPP++;
192  f1 = 0;
193  }
194  else
195  {
196  f1 = 1;
197  }
198  sx++;
199  }
200  SourceBits_4BPP += BltInfo->SourceSurface->lDelta;
201  }
202  break;
203 
204  case BMF_8BPP:
205  SourceLine = (PBYTE)BltInfo->SourceSurface->pvScan0 +
206  (BltInfo->SourcePoint.y * BltInfo->SourceSurface->lDelta) +
207  BltInfo->SourcePoint.x;
208  DestLine = DestBits;
209 
210  for (j = BltInfo->DestRect.top; j < BltInfo->DestRect.bottom; j++)
211  {
212  SourceBits = SourceLine;
213  DestBits = DestLine;
214 
215  for (i = BltInfo->DestRect.left; i < BltInfo->DestRect.right; i++)
216  {
217  *((WORD *)DestBits) = (WORD)XLATEOBJ_iXlate(
218  BltInfo->XlateSourceToDest, *SourceBits);
219  SourceBits += 1;
220  DestBits += 2;
221  }
222 
223  SourceLine += BltInfo->SourceSurface->lDelta;
224  DestLine += BltInfo->DestSurface->lDelta;
225  }
226  break;
227 
228  case BMF_16BPP:
229  if (NULL == BltInfo->XlateSourceToDest || 0 !=
230  (BltInfo->XlateSourceToDest->flXlate & XO_TRIVIAL))
231  {
232  if (BltInfo->DestRect.top < BltInfo->SourcePoint.y)
233  {
234  SourceBits = (PBYTE)BltInfo->SourceSurface->pvScan0 +
235  (BltInfo->SourcePoint.y *
236  BltInfo->SourceSurface->lDelta) + 2 *
237  BltInfo->SourcePoint.x;
238 
239  for (j = BltInfo->DestRect.top; j < BltInfo->DestRect.bottom; j++)
240  {
241  RtlMoveMemory(DestBits, SourceBits,
242  2 * (BltInfo->DestRect.right -
243  BltInfo->DestRect.left));
244 
245  SourceBits += BltInfo->SourceSurface->lDelta;
246  DestBits += BltInfo->DestSurface->lDelta;
247  }
248  }
249  else
250  {
251  SourceBits = (PBYTE)BltInfo->SourceSurface->pvScan0 +
252  ((BltInfo->SourcePoint.y + BltInfo->DestRect.bottom -
253  BltInfo->DestRect.top - 1) *
254  BltInfo->SourceSurface->lDelta) + 2 *
255  BltInfo->SourcePoint.x;
256 
257  DestBits = (PBYTE)BltInfo->DestSurface->pvScan0 +
258  ((BltInfo->DestRect.bottom - 1) *
259  BltInfo->DestSurface->lDelta) + 2 *
260  BltInfo->DestRect.left;
261 
262  for (j = BltInfo->DestRect.bottom - 1;
263  BltInfo->DestRect.top <= j; j--)
264  {
265  RtlMoveMemory(DestBits, SourceBits, 2 *
266  (BltInfo->DestRect.right -
267  BltInfo->DestRect.left));
268 
269  SourceBits -= BltInfo->SourceSurface->lDelta;
270  DestBits -= BltInfo->DestSurface->lDelta;
271  }
272  }
273  }
274  else
275  {
276  if (BltInfo->DestRect.top < BltInfo->SourcePoint.y)
277  {
278  SourceLine = (PBYTE)BltInfo->SourceSurface->pvScan0 +
279  (BltInfo->SourcePoint.y *
280  BltInfo->SourceSurface->lDelta) + 2 *
281  BltInfo->SourcePoint.x;
282 
283  DestLine = DestBits;
284  for (j = BltInfo->DestRect.top; j < BltInfo->DestRect.bottom; j++)
285  {
286  SourceBits = SourceLine;
287  DestBits = DestLine;
288  for (i = BltInfo->DestRect.left; i <
289  BltInfo->DestRect.right; i++)
290  {
291  *((WORD *)DestBits) = (WORD)XLATEOBJ_iXlate(
292  BltInfo->XlateSourceToDest,
293  *((WORD *)SourceBits));
294  SourceBits += 2;
295  DestBits += 2;
296  }
297  SourceLine += BltInfo->SourceSurface->lDelta;
298  DestLine += BltInfo->DestSurface->lDelta;
299  }
300  }
301  else
302  {
303  SourceLine = (PBYTE)BltInfo->SourceSurface->pvScan0 +
304  ((BltInfo->SourcePoint.y +
305  BltInfo->DestRect.bottom -
306  BltInfo->DestRect.top - 1) *
307  BltInfo->SourceSurface->lDelta) + 2 *
308  BltInfo->SourcePoint.x;
309 
310  DestLine = (PBYTE)BltInfo->DestSurface->pvScan0 +
311  ((BltInfo->DestRect.bottom - 1) *
312  BltInfo->DestSurface->lDelta) + 2 *
313  BltInfo->DestRect.left;
314 
315  for (j = BltInfo->DestRect.bottom - 1;
316  BltInfo->DestRect.top <= j; j--)
317  {
318  SourceBits = SourceLine;
319  DestBits = DestLine;
320  for (i = BltInfo->DestRect.left; i <
321  BltInfo->DestRect.right; i++)
322  {
323  *((WORD *)DestBits) = (WORD)XLATEOBJ_iXlate(
324  BltInfo->XlateSourceToDest,
325  *((WORD *)SourceBits));
326  SourceBits += 2;
327  DestBits += 2;
328  }
329  SourceLine -= BltInfo->SourceSurface->lDelta;
330  DestLine -= BltInfo->DestSurface->lDelta;
331  }
332  }
333  }
334  break;
335 
336  case BMF_24BPP:
337  SourceLine = (PBYTE)BltInfo->SourceSurface->pvScan0 +
338  (BltInfo->SourcePoint.y * BltInfo->SourceSurface->lDelta) +
339  3 * BltInfo->SourcePoint.x;
340 
341  DestLine = DestBits;
342 
343  for (j = BltInfo->DestRect.top; j < BltInfo->DestRect.bottom; j++)
344  {
345  SourceBits = SourceLine;
346  DestBits = DestLine;
347 
348  for (i = BltInfo->DestRect.left; i < BltInfo->DestRect.right; i++)
349  {
350  xColor = (*(SourceBits + 2) << 0x10) +
351  (*(SourceBits + 1) << 0x08) + (*(SourceBits));
352 
353  *((WORD *)DestBits) = (WORD)XLATEOBJ_iXlate(
354  BltInfo->XlateSourceToDest, xColor);
355 
356  SourceBits += 3;
357  DestBits += 2;
358  }
359  SourceLine += BltInfo->SourceSurface->lDelta;
360  DestLine += BltInfo->DestSurface->lDelta;
361  }
362  break;
363 
364  case BMF_32BPP:
365  SourceLine = (PBYTE)BltInfo->SourceSurface->pvScan0 +
366  (BltInfo->SourcePoint.y * BltInfo->SourceSurface->lDelta) +
367  4 * BltInfo->SourcePoint.x;
368 
369  DestLine = DestBits;
370 
371  for (j = BltInfo->DestRect.top; j < BltInfo->DestRect.bottom; j++)
372  {
373  SourceBits = SourceLine;
374  DestBits = DestLine;
375 
376  for (i = BltInfo->DestRect.left; i < BltInfo->DestRect.right; i++)
377  {
378  *((WORD *)DestBits) = (WORD)XLATEOBJ_iXlate(
379  BltInfo->XlateSourceToDest,
380  *((PDWORD) SourceBits));
381  SourceBits += 4;
382  DestBits += 2;
383  }
384 
385  SourceLine += BltInfo->SourceSurface->lDelta;
386  DestLine += BltInfo->DestSurface->lDelta;
387  }
388  break;
389 
390  default:
391  DPRINT1("DIB_16BPP_Bitblt: Unhandled Source BPP: %u\n",
392  BitsPerFormat(BltInfo->SourceSurface->iBitmapFormat));
393  return FALSE;
394  }
395 
396  return TRUE;
397 }
#define BMF_24BPP
Definition: winddi.h:359
GLenum GLclampf GLint GLenum GLuint GLenum GLenum GLsizei GLenum const GLvoid GLfloat GLfloat GLfloat GLfloat GLclampd GLint 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 GLboolean GLboolean GLboolean GLint GLenum GLsizei const GLvoid GLenum GLint GLenum GLint GLint GLsizei GLint GLenum GLint GLint GLint GLint GLsizei GLenum GLsizei const GLuint GLboolean GLenum GLenum GLint GLsizei GLenum GLsizei GLenum const GLvoid GLboolean const GLboolean GLenum const GLdouble const GLfloat const GLdouble const GLfloat GLenum GLint GLint GLint GLint GLint GLint j
Definition: glfuncs.h:98
unsigned short WORD
Definition: ntddk_ex.h:93
#define TRUE
Definition: types.h:120
#define BMF_32BPP
Definition: winddi.h:360
unsigned char altnotmask[2]
Definition: dib.c:18
#define BitsPerFormat(Format)
Definition: surface.h:102
Definition: xlate.c:8
#define RtlMoveMemory(Destination, Source, Length)
Definition: typedefs.h:263
GLenum GLclampf GLint i
Definition: glfuncs.h:14
#define FALSE
Definition: types.h:117
long LONG
Definition: pedump.c:60
smooth NULL
Definition: ftsmooth.c:557
#define BMF_16BPP
Definition: winddi.h:358
VOID DIB_16BPP_PutPixel(SURFOBJ *SurfObj, LONG x, LONG y, ULONG c)
Definition: dib16bpp.c:17
ULONG DIB_1BPP_GetPixel(SURFOBJ *, LONG, LONG)
Definition: dib1bpp.c:26
#define XO_TRIVIAL
Definition: winddi.h:1247
#define f1(x, y, z)
Definition: sha1.c:30
Definition: xlate.c:9
Definition: xlate.c:10
DWORD * PDWORD
Definition: pedump.c:68
#define DPRINT1
Definition: precomp.h:8
ENGAPI ULONG APIENTRY XLATEOBJ_iXlate(_In_ XLATEOBJ *pxlo, _In_ ULONG iColor)
Definition: xlateobj.c:664
BYTE * PBYTE
Definition: pedump.c:66
BOOLEAN DIB_16BPP_ColorFill ( SURFOBJ ,
RECTL ,
ULONG   
)

Definition at line 401 of file dib16bpp.c.

402 {
403  LONG DestY;
404 
405 #if defined(_M_IX86) && !defined(_MSC_VER)
406  /* This is about 10% faster than the generic C code below */
407  ULONG delta = DestSurface->lDelta;
408  ULONG width = (DestRect->right - DestRect->left) ;
409  PULONG pos = (PULONG) ((PBYTE)DestSurface->pvScan0 + DestRect->top * delta + (DestRect->left<<1));
410  color = (color&0xffff); /* If the color value is "abcd", put "abcdabcd" into color */
411  color += (color<<16);
412 
413  for (DestY = DestRect->top; DestY< DestRect->bottom; DestY++)
414  {
415  __asm__ __volatile__ (
416  "cld\n\t"
417  "mov %1,%%ebx\n\t"
418  "mov %2,%%edi\n\t"
419  "test $0x03, %%edi\n\t" /* Align to fullword boundary */
420  "jz 1f\n\t"
421  "stosw\n\t"
422  "dec %%ebx\n\t"
423  "jz 2f\n"
424  "1:\n\t"
425  "mov %%ebx,%%ecx\n\t" /* Setup count of fullwords to fill */
426  "shr $1,%%ecx\n\t"
427  "rep stosl\n\t" /* The actual fill */
428  "test $0x01, %%ebx\n\t" /* One left to do at the right side? */
429  "jz 2f\n\t"
430  "stosw\n"
431  "2:"
432  :
433  : "a" (color), "r" (width), "m" (pos)
434  : "%ecx", "%ebx", "%edi");
435  pos =(PULONG)((ULONG_PTR)pos + delta);
436  }
437 #else /* _M_IX86 */
438 
439  for (DestY = DestRect->top; DestY< DestRect->bottom; DestY++)
440  {
441  DIB_16BPP_HLine (DestSurface, DestRect->left, DestRect->right, DestY, color);
442  }
443 #endif
444  return TRUE;
445 }
#define TRUE
Definition: types.h:120
__asm__("\t.globl GetPhys\n""GetPhys:\t\n""mflr 0\n\t""stwu 0,-16(1)\n\t""mfmsr 5\n\t""andi. 6,5,0xffef\n\t""mtmsr 6\n\t""isync\n\t""sync\n\t""lwz 3,0(3)\n\t""mtmsr 5\n\t""isync\n\t""sync\n\t""lwz 0,0(1)\n\t""addi 1,1,16\n\t""mtlr 0\n\t""blr")
uint32_t ULONG_PTR
Definition: typedefs.h:63
VOID DIB_16BPP_HLine(SURFOBJ *SurfObj, LONG x1, LONG x2, LONG y, ULONG c)
Definition: dib16bpp.c:34
long LONG
Definition: pedump.c:60
GLuint color
Definition: glext.h:6243
GLint GLint bottom
Definition: glext.h:7726
GLint GLint GLsizei width
Definition: gl.h:1546
unsigned int * PULONG
Definition: retypes.h:1
unsigned int ULONG
Definition: retypes.h:1
BYTE * PBYTE
Definition: pedump.c:66
ULONG DIB_16BPP_GetPixel ( SURFOBJ ,
LONG  ,
LONG   
)

Definition at line 26 of file dib16bpp.c.

Referenced by DIB_16BPP_AlphaBlend(), and DIB_1BPP_BitBltSrcCopy().

27 {
28  PBYTE byteaddr = (PBYTE)SurfObj->pvScan0 + y * SurfObj->lDelta;
29  PWORD addr = (PWORD)byteaddr + x;
30  return (ULONG)(*addr);
31 }
WORD * PWORD
Definition: pedump.c:67
GLenum const GLvoid * addr
Definition: glext.h:9621
unsigned int ULONG
Definition: retypes.h:1
INT INT y
Definition: msvc.h:62
BYTE * PBYTE
Definition: pedump.c:66
INT x
Definition: msvc.h:62
VOID DIB_16BPP_HLine ( SURFOBJ ,
LONG  ,
LONG  ,
LONG  ,
ULONG   
)

Definition at line 34 of file dib16bpp.c.

Referenced by DIB_16BPP_ColorFill().

35 {
36  PDWORD addr = (PDWORD)((PWORD)((PBYTE)SurfObj->pvScan0 + y * SurfObj->lDelta) + x1);
37 
38 #if defined(_M_IX86) && !defined(_MSC_VER)
39  /* This is about 10% faster than the generic C code below */
40  LONG Count = x2 - x1;
41 
42  __asm__ __volatile__ (
43  " cld\n"
44  " mov %0, %%eax\n"
45  " shl $16, %%eax\n"
46  " andl $0xffff, %0\n" /* If the pixel value is "abcd", put "abcdabcd" in %eax */
47  " or %0, %%eax\n"
48  " mov %2, %%edi\n"
49  " test $0x03, %%edi\n" /* Align to fullword boundary */
50  " jz 0f\n"
51  " stosw\n"
52  " dec %1\n"
53  " jz 1f\n"
54  "0:\n"
55  " mov %1,%%ecx\n" /* Setup count of fullwords to fill */
56  " shr $1,%%ecx\n"
57  " rep stosl\n" /* The actual fill */
58  " test $0x01, %1\n" /* One left to do at the right side? */
59  " jz 1f\n"
60  " stosw\n"
61  "1:\n"
62  : /* no output */
63  : "r"(c), "r"(Count), "m"(addr)
64  : "%eax", "%ecx", "%edi");
65 #else /* _M_IX86 */
66  LONG cx = x1;
67  DWORD cc;
68 
69  if (0 != (cx & 0x01))
70  {
71  *((PWORD) addr) = (WORD)c;
72  cx++;
73  addr = (PDWORD)((PWORD)(addr) + 1);
74  }
75  cc = ((c & 0xffff) << 16) | (c & 0xffff);
76  while(cx + 1 < x2)
77  {
78  *addr++ = cc;
79  cx += 2;
80  }
81  if (cx < x2)
82  {
83  *((PWORD) addr) = (WORD)c;
84  }
85 #endif /* _M_IX86 */
86 }
unsigned short WORD
Definition: ntddk_ex.h:93
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG x1
Definition: winddi.h:3706
_Inout_ __drv_aliasesMem PSLIST_ENTRY _Inout_ PSLIST_ENTRY _In_ ULONG Count
Definition: exfuncs.h:1015
__asm__("\t.globl GetPhys\n""GetPhys:\t\n""mflr 0\n\t""stwu 0,-16(1)\n\t""mfmsr 5\n\t""andi. 6,5,0xffef\n\t""mtmsr 6\n\t""isync\n\t""sync\n\t""lwz 3,0(3)\n\t""mtmsr 5\n\t""isync\n\t""sync\n\t""lwz 0,0(1)\n\t""addi 1,1,16\n\t""mtlr 0\n\t""blr")
DWORD DWORD
Definition: winlogon.h:75
long LONG
Definition: pedump.c:60
WORD * PWORD
Definition: pedump.c:67
const GLubyte * c
Definition: glext.h:8905
GLenum const GLvoid * addr
Definition: glext.h:9621
uint32_t cc
Definition: isohybrid.c:75
DWORD * PDWORD
Definition: pedump.c:68
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG _In_ LONG _In_ LONG x2
Definition: winddi.h:3706
_Out_opt_ int * cx
Definition: commctrl.h:570
INT INT y
Definition: msvc.h:62
BYTE * PBYTE
Definition: pedump.c:66
VOID DIB_16BPP_PutPixel ( SURFOBJ ,
LONG  ,
LONG  ,
ULONG   
)

Definition at line 17 of file dib16bpp.c.

Referenced by DIB_16BPP_AlphaBlend(), and DIB_16BPP_BitBltSrcCopy().

18 {
19  PBYTE byteaddr = (PBYTE)SurfObj->pvScan0 + y * SurfObj->lDelta;
20  PWORD addr = (PWORD)byteaddr + x;
21 
22  *addr = (WORD)c;
23 }
unsigned short WORD
Definition: ntddk_ex.h:93
WORD * PWORD
Definition: pedump.c:67
const GLubyte * c
Definition: glext.h:8905
GLenum const GLvoid * addr
Definition: glext.h:9621
INT INT y
Definition: msvc.h:62
BYTE * PBYTE
Definition: pedump.c:66
INT x
Definition: msvc.h:62
BOOLEAN DIB_16BPP_TransparentBlt ( SURFOBJ ,
SURFOBJ ,
RECTL ,
RECTL ,
XLATEOBJ ,
ULONG   
)

Definition at line 448 of file dib16bpp.c.

451 {
452  LONG RoundedRight, X, Y, SourceX = 0, SourceY = 0, wd;
453  ULONG *DestBits, Source, Dest;
454 
455  LONG DstHeight;
456  LONG DstWidth;
457  LONG SrcHeight;
458  LONG SrcWidth;
459 
460  DstHeight = DestRect->bottom - DestRect->top;
461  DstWidth = DestRect->right - DestRect->left;
462  SrcHeight = SourceRect->bottom - SourceRect->top;
463  SrcWidth = SourceRect->right - SourceRect->left;
464 
465  RoundedRight = DestRect->right - ((DestRect->right - DestRect->left) & 0x1);
466  DestBits = (ULONG*)((PBYTE)DestSurf->pvScan0 +
467  (DestRect->left << 1) +
468  DestRect->top * DestSurf->lDelta);
469  wd = DestSurf->lDelta - ((DestRect->right - DestRect->left) << 1);
470 
471  for(Y = DestRect->top; Y < DestRect->bottom; Y++)
472  {
473  SourceY = SourceRect->top+(Y - DestRect->top) * SrcHeight / DstHeight;
474  for(X = DestRect->left; X < RoundedRight; X += 2, DestBits++, SourceX += 2)
475  {
476  Dest = *DestBits;
477 
478  SourceX = SourceRect->left+(X - DestRect->left) * SrcWidth / DstWidth;
479  if (SourceX >= 0 && SourceY >= 0 &&
480  SourceSurf->sizlBitmap.cx > SourceX && SourceSurf->sizlBitmap.cy > SourceY)
481  {
482  Source = DIB_GetSourceIndex(SourceSurf, SourceX, SourceY);
483  if(Source != iTransColor)
484  {
485  Dest &= 0xFFFF0000;
486  Dest |= (XLATEOBJ_iXlate(ColorTranslation, Source) & 0xFFFF);
487  }
488  }
489 
490  SourceX = SourceRect->left+(X+1 - DestRect->left) * SrcWidth / DstWidth;
491  if (SourceX >= 0 && SourceY >= 0 &&
492  SourceSurf->sizlBitmap.cx > SourceX && SourceSurf->sizlBitmap.cy > SourceY)
493  {
494  Source = DIB_GetSourceIndex(SourceSurf, SourceX, SourceY);
495  if(Source != iTransColor)
496  {
497  Dest &= 0xFFFF;
498  Dest |= (XLATEOBJ_iXlate(ColorTranslation, Source) << 16);
499  }
500  }
501 
502  *DestBits = Dest;
503  }
504 
506  {
507  SourceX = SourceRect->left+(X - DestRect->left) * SrcWidth / DstWidth;
508  if (SourceX >= 0 && SourceY >= 0 &&
509  SourceSurf->sizlBitmap.cx > SourceX && SourceSurf->sizlBitmap.cy > SourceY)
510  {
511  Source = DIB_GetSourceIndex(SourceSurf, SourceX, SourceY);
512  if(Source != iTransColor)
513  {
514  *((USHORT*)DestBits) = (USHORT)XLATEOBJ_iXlate(ColorTranslation,
515  Source);
516  }
517  }
518 
519  DestBits = (PULONG)((ULONG_PTR)DestBits + 2);
520  }
521 
522  DestBits = (ULONG*)((ULONG_PTR)DestBits + wd);
523  }
524 
525  return TRUE;
526 }
#define TRUE
Definition: types.h:120
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG x1
Definition: winddi.h:3706
VOID * Source
Definition: acefiex.h:744
#define Y(i)
Definition: t_vb_render.c:49
_In_ SURFOBJ _In_ CLIPOBJ _In_opt_ XLATEOBJ _In_ RECTL _In_ RECTL _In_ ULONG iTransColor
Definition: winddi.h:4190
uint32_t ULONG_PTR
Definition: typedefs.h:63
long LONG
Definition: pedump.c:60
#define DIB_GetSourceIndex(SourceSurf, sx, sy)
Definition: dib.h:141
GLint GLint bottom
Definition: glext.h:7726
GLdouble GLdouble right
Definition: glext.h:10859
unsigned short USHORT
Definition: pedump.c:61
unsigned int * PULONG
Definition: retypes.h:1
unsigned int ULONG
Definition: retypes.h:1
ENGAPI ULONG APIENTRY XLATEOBJ_iXlate(_In_ XLATEOBJ *pxlo, _In_ ULONG iColor)
Definition: xlateobj.c:664
BYTE * PBYTE
Definition: pedump.c:66
#define X(b, s)
VOID DIB_16BPP_VLine ( SURFOBJ ,
LONG  ,
LONG  ,
LONG  ,
ULONG   
)

Definition at line 90 of file dib16bpp.c.

91 {
92 #if defined(_M_IX86) && !defined(_MSC_VER)
93  asm volatile(
94  " testl %2, %2" "\n\t"
95  " jle 2f" "\n\t"
96  " movl %2, %%ecx" "\n\t"
97  " shrl $2, %2" "\n\t"
98  " andl $3, %%ecx" "\n\t"
99  " jz 1f" "\n\t"
100  "0:" "\n\t"
101  " movw %%ax, (%0)" "\n\t"
102  " addl %1, %0" "\n\t"
103  " decl %%ecx" "\n\t"
104  " jnz 0b" "\n\t"
105  " testl %2, %2" "\n\t"
106  " jz 2f" "\n\t"
107  "1:" "\n\t"
108  " movw %%ax, (%0)" "\n\t"
109  " addl %1, %0" "\n\t"
110  " movw %%ax, (%0)" "\n\t"
111  " addl %1, %0" "\n\t"
112  " movw %%ax, (%0)" "\n\t"
113  " addl %1, %0" "\n\t"
114  " movw %%ax, (%0)" "\n\t"
115  " addl %1, %0" "\n\t"
116  " decl %2" "\n\t"
117  " jnz 1b" "\n\t"
118  "2:" "\n\t"
119  : /* no output */
120  : "r"((PBYTE)SurfObj->pvScan0 + (y1 * SurfObj->lDelta) + (x * sizeof (WORD))),
121  "r"(SurfObj->lDelta), "r"(y2 - y1), "a"(c)
122  : "cc", "memory", "%ecx");
123 #else
124  PBYTE byteaddr = (PBYTE)(ULONG_PTR)SurfObj->pvScan0 + y1 * SurfObj->lDelta;
125  PWORD addr = (PWORD)byteaddr + x;
126  LONG lDelta = SurfObj->lDelta;
127 
128  byteaddr = (PBYTE)addr;
129  while(y1++ < y2)
130  {
131  *addr = (WORD)c;
132 
133  byteaddr += lDelta;
134  addr = (PWORD)byteaddr;
135  }
136 #endif
137 }
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG _In_ LONG y1
Definition: winddi.h:3706
unsigned short WORD
Definition: ntddk_ex.h:93
uint32_t ULONG_PTR
Definition: typedefs.h:63
long LONG
Definition: pedump.c:60
WORD * PWORD
Definition: pedump.c:67
const GLubyte * c
Definition: glext.h:8905
GLenum const GLvoid * addr
Definition: glext.h:9621
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG _In_ LONG _In_ LONG _In_ LONG y2
Definition: winddi.h:3706
BYTE * PBYTE
Definition: pedump.c:66
INT x
Definition: msvc.h:62
BOOLEAN DIB_1BPP_BitBlt ( PBLTINFO  )

Definition at line 318 of file dib1bpp.c.

319 {
320  LONG DestX, DestY;
321  LONG SourceX, SourceY;
322  LONG PatternY = 0;
323  ULONG Dest, Source = 0, Pattern = 0;
324  ULONG Index;
325  BOOLEAN UsesSource;
326  BOOLEAN UsesPattern;
327  PULONG DestBits;
328  LONG RoundedRight;
329 
330  UsesSource = ROP4_USES_SOURCE(BltInfo->Rop4);
331  UsesPattern = ROP4_USES_PATTERN(BltInfo->Rop4);
332 
333  RoundedRight = BltInfo->DestRect.right -
334  ((BltInfo->DestRect.right - BltInfo->DestRect.left) & 31);
335  SourceY = BltInfo->SourcePoint.y;
336 
337  if (UsesPattern)
338  {
339  if (BltInfo->PatternSurface)
340  {
341  PatternY = (BltInfo->DestRect.top + BltInfo->BrushOrigin.y) %
342  BltInfo->PatternSurface->sizlBitmap.cy;
343  }
344  else
345  {
346  /* FIXME: Shouldn't it be expanded? */
347  if (BltInfo->Brush)
348  Pattern = BltInfo->Brush->iSolidColor;
349  }
350  }
351 
352  for (DestY = BltInfo->DestRect.top; DestY < BltInfo->DestRect.bottom; DestY++)
353  {
354  DestX = BltInfo->DestRect.left;
355  SourceX = BltInfo->SourcePoint.x;
356  DestBits = (PULONG)(
357  (PBYTE)BltInfo->DestSurface->pvScan0 +
358  (BltInfo->DestRect.left >> 3) +
359  DestY * BltInfo->DestSurface->lDelta);
360 
361  if (DestX & 31)
362  {
363 #if 0
364  /* FIXME: This case is completely untested!!! */
365 
366  Dest = *((PBYTE)DestBits);
367  NoBits = 31 - (DestX & 31);
368 
369  if (UsesSource)
370  {
371  Source = 0;
372  /* FIXME: This is incorrect! */
373  for (Index = 31 - NoBits; Index >= 0; Index++)
374  Source |= (DIB_GetSource(SourceSurf, SourceX + Index, SourceY, ColorTranslation) << (31 - Index));
375  }
376 
377  if (BltInfo->PatternSurface)
378  {
379  Pattern = 0;
380  for (k = 31 - NoBits; k >= 0; k++)
381  Pattern |= (DIB_GetSourceIndex(PatternObj, (X + BrushOrigin.x + k) % PatternWidth, PatternY) << (31 - k));
382  }
383 
384  Dest = DIB_DoRop(BltInfo->Rop4, Dest, Source, Pattern);
385  Dest &= ~((1 << (31 - NoBits)) - 1);
386  Dest |= *((PBYTE)DestBits) & ((1 << (31 - NoBits)) - 1);
387 
388  *DestBits = Dest;
389 
390  DestX += NoBits;
391  SourceX += NoBits;
392 #endif
393  }
394 
395  for (; DestX < RoundedRight; DestX += 32, DestBits++, SourceX += 32)
396  {
397  Dest = *DestBits;
398 
399  if (UsesSource)
400  {
401  Source = 0;
402  for (Index = 0; Index < 8; Index++)
403  {
404  Source |= DIB_GetSource(BltInfo->SourceSurface, SourceX + Index, SourceY, BltInfo->XlateSourceToDest) << (7 - Index);
405  Source |= DIB_GetSource(BltInfo->SourceSurface, SourceX + Index + 8, SourceY, BltInfo->XlateSourceToDest) << (8 + (7 - Index));
406  Source |= DIB_GetSource(BltInfo->SourceSurface, SourceX + Index + 16, SourceY, BltInfo->XlateSourceToDest) << (16 + (7 - Index));
407  Source |= DIB_GetSource(BltInfo->SourceSurface, SourceX + Index + 24, SourceY, BltInfo->XlateSourceToDest) << (24 + (7 - Index));
408  }
409  }
410 
411  if (BltInfo->PatternSurface)
412  {
413  Pattern = 0;
414  for (Index = 0; Index < 8; Index++)
415  {
416  Pattern |= DIB_GetSourceIndex(BltInfo->PatternSurface, (DestX + BltInfo->BrushOrigin.x + Index) % BltInfo->PatternSurface->sizlBitmap.cx, PatternY) << (7 - Index);
417  Pattern |= DIB_GetSourceIndex(BltInfo->PatternSurface, (DestX + BltInfo->BrushOrigin.x + Index + 8) % BltInfo->PatternSurface->sizlBitmap.cx, PatternY) << (8 + (7 - Index));
418  Pattern |= DIB_GetSourceIndex(BltInfo->PatternSurface, (DestX + BltInfo->BrushOrigin.x + Index + 16) % BltInfo->PatternSurface->sizlBitmap.cx, PatternY) << (16 + (7 - Index));
419  Pattern |= DIB_GetSourceIndex(BltInfo->PatternSurface, (DestX + BltInfo->BrushOrigin.x + Index + 24) % BltInfo->PatternSurface->sizlBitmap.cx, PatternY) << (24 + (7 - Index));
420  }
421  }
422 
423  *DestBits = DIB_DoRop(BltInfo->Rop4, Dest, Source, Pattern);
424  }
425 
426  if (DestX < BltInfo->DestRect.right)
427  {
428  for (; DestX < BltInfo->DestRect.right; DestX++, SourceX++)
429  {
430  Dest = DIB_1BPP_GetPixel(BltInfo->DestSurface, DestX, DestY);
431 
432  if (UsesSource)
433  {
434  Source = DIB_GetSource(BltInfo->SourceSurface, SourceX, SourceY, BltInfo->XlateSourceToDest);
435  }
436 
437  if (BltInfo->PatternSurface)
438  {
439  Pattern = DIB_GetSourceIndex(BltInfo->PatternSurface, (DestX + BltInfo->BrushOrigin.x) % BltInfo->PatternSurface->sizlBitmap.cx, PatternY);
440  }
441 
442  DIB_1BPP_PutPixel(BltInfo->DestSurface, DestX, DestY, DIB_DoRop(BltInfo->Rop4, Dest, Source, Pattern) & 0xF);
443  }
444  }
445 
446  SourceY++;
447  if (BltInfo->PatternSurface)
448  {
449  PatternY++;
450  PatternY %= BltInfo->PatternSurface->sizlBitmap.cy;
451  }
452  }
453 
454  return TRUE;
455 }
#define TRUE
Definition: types.h:120
_Must_inspect_result_ _In_ ULONG Index
Definition: fltkernel.h:1824
#define DIB_GetSource(SourceSurf, sx, sy, ColorTranslation)
Definition: dib.h:136
long LONG
Definition: pedump.c:60
#define DIB_GetSourceIndex(SourceSurf, sx, sy)
Definition: dib.h:141
#define ROP4_USES_SOURCE(Rop4)
Definition: inteng.h:45
ULONG DIB_DoRop(ULONG Rop, ULONG Dest, ULONG Source, ULONG Pattern)
Definition: dib.c:92
ULONG DIB_1BPP_GetPixel(SURFOBJ *SurfObj, LONG x, LONG y)
Definition: dib1bpp.c:26
unsigned char BOOLEAN
#define ROP4_USES_PATTERN(Rop4)
Definition: inteng.h:46
unsigned int * PULONG
Definition: retypes.h:1
unsigned int ULONG
Definition: retypes.h:1
BYTE * PBYTE
Definition: pedump.c:66
int k
Definition: mpi.c:3369
VOID DIB_1BPP_PutPixel(SURFOBJ *SurfObj, LONG x, LONG y, ULONG c)
Definition: dib1bpp.c:15
BOOLEAN DIB_1BPP_BitBltSrcCopy ( PBLTINFO  )

Definition at line 227 of file dib1bpp.c.

228 {
229  ULONG Color;
230  LONG i, j, sx, sy = BltInfo->SourcePoint.y;
231 
232  switch ( BltInfo->SourceSurface->iBitmapFormat )
233  {
234  case BMF_1BPP:
235  DIB_1BPP_BitBltSrcCopy_From1BPP ( BltInfo->DestSurface, BltInfo->SourceSurface, BltInfo->XlateSourceToDest, &BltInfo->DestRect, &BltInfo->SourcePoint );
236  break;
237 
238  case BMF_4BPP:
239  for (j=BltInfo->DestRect.top; j<BltInfo->DestRect.bottom; j++)
240  {
241  sx = BltInfo->SourcePoint.x;
242  for (i=BltInfo->DestRect.left; i<BltInfo->DestRect.right; i++)
243  {
244  Color = XLATEOBJ_iXlate(BltInfo->XlateSourceToDest, DIB_4BPP_GetPixel(BltInfo->SourceSurface, sx, sy));
245  DIB_1BPP_PutPixel(BltInfo->DestSurface, i, j, Color);
246  sx++;
247  }
248  sy++;
249  }
250  break;
251 
252  case BMF_8BPP:
253  for (j=BltInfo->DestRect.top; j<BltInfo->DestRect.bottom; j++)
254  {
255  sx = BltInfo->SourcePoint.x;
256  for (i=BltInfo->DestRect.left; i<BltInfo->DestRect.right; i++)
257  {
258  Color = XLATEOBJ_iXlate(BltInfo->XlateSourceToDest, DIB_8BPP_GetPixel(BltInfo->SourceSurface, sx, sy));
259  DIB_1BPP_PutPixel(BltInfo->DestSurface, i, j, Color);
260  sx++;
261  }
262  sy++;
263  }
264  break;
265 
266  case BMF_16BPP:
267  for (j=BltInfo->DestRect.top; j<BltInfo->DestRect.bottom; j++)
268  {
269  sx = BltInfo->SourcePoint.x;
270  for (i=BltInfo->DestRect.left; i<BltInfo->DestRect.right; i++)
271  {
272  Color = XLATEOBJ_iXlate(BltInfo->XlateSourceToDest, DIB_16BPP_GetPixel(BltInfo->SourceSurface, sx, sy));
273  DIB_1BPP_PutPixel(BltInfo->DestSurface, i, j, Color);
274  sx++;
275  }
276  sy++;
277  }
278  break;
279 
280  case BMF_24BPP:
281  for (j=BltInfo->DestRect.top; j<BltInfo->DestRect.bottom; j++)
282  {
283  sx = BltInfo->SourcePoint.x;
284  for (i=BltInfo->DestRect.left; i<BltInfo->DestRect.right; i++)
285  {
286  Color = XLATEOBJ_iXlate(BltInfo->XlateSourceToDest, DIB_24BPP_GetPixel(BltInfo->SourceSurface, sx, sy));
287  DIB_1BPP_PutPixel(BltInfo->DestSurface, i, j, Color);
288  sx++;
289  }
290  sy++;
291  }
292  break;
293 
294  case BMF_32BPP:
295  for (j=BltInfo->DestRect.top; j<BltInfo->DestRect.bottom; j++)
296  {
297  sx = BltInfo->SourcePoint.x;
298  for (i=BltInfo->DestRect.left; i<BltInfo->DestRect.right; i++)
299  {
300  Color = XLATEOBJ_iXlate(BltInfo->XlateSourceToDest, DIB_32BPP_GetPixel(BltInfo->SourceSurface, sx, sy));
301  DIB_1BPP_PutPixel(BltInfo->DestSurface, i, j, Color);
302  sx++;
303  }
304  sy++;
305  }
306  break;
307 
308  default:
309  DbgPrint("DIB_1BPP_BitBlt: Unhandled Source BPP: %u\n", BitsPerFormat(BltInfo->SourceSurface->iBitmapFormat));
310  return FALSE;
311  }
312 
313  return TRUE;
314 }
#define BMF_24BPP
Definition: winddi.h:359
GLenum GLclampf GLint GLenum GLuint GLenum GLenum GLsizei GLenum const GLvoid GLfloat GLfloat GLfloat GLfloat GLclampd GLint 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 GLboolean GLboolean GLboolean GLint GLenum GLsizei const GLvoid GLenum GLint GLenum GLint GLint GLsizei GLint GLenum GLint GLint GLint GLint GLsizei GLenum GLsizei const GLuint GLboolean GLenum GLenum GLint GLsizei GLenum GLsizei GLenum const GLvoid GLboolean const GLboolean GLenum const GLdouble const GLfloat const GLdouble const GLfloat GLenum GLint GLint GLint GLint GLint GLint j
Definition: glfuncs.h:98
#define TRUE
Definition: types.h:120
#define BMF_32BPP
Definition: winddi.h:360
#define DbgPrint
Definition: loader.c:26
ULONG DIB_16BPP_GetPixel(SURFOBJ *, LONG, LONG)
Definition: dib16bpp.c:26
#define BitsPerFormat(Format)
Definition: surface.h:102
ULONG DIB_24BPP_GetPixel(SURFOBJ *, LONG, LONG)
Definition: dib24bpp.c:25
ULONG DIB_32BPP_GetPixel(SURFOBJ *, LONG, LONG)
Definition: dib32bpp.c:26
Definition: xlate.c:8
ULONG DIB_4BPP_GetPixel(SURFOBJ *, LONG, LONG)
Definition: dib4bpp.c:23
struct Color Color
GLenum GLclampf GLint i
Definition: glfuncs.h:14
static void DIB_1BPP_BitBltSrcCopy_From1BPP(SURFOBJ *DestSurf, SURFOBJ *SourceSurf, XLATEOBJ *pxlo, PRECTL DestRect, POINTL *SourcePoint)
Definition: dib1bpp.c:55
#define FALSE
Definition: types.h:117
long LONG
Definition: pedump.c:60
#define BMF_16BPP
Definition: winddi.h:358
ULONG DIB_8BPP_GetPixel(SURFOBJ *, LONG, LONG)
Definition: dib8bpp.c:25
Definition: xlate.c:9
Definition: xlate.c:10
unsigned int ULONG
Definition: retypes.h:1
ENGAPI ULONG APIENTRY XLATEOBJ_iXlate(_In_ XLATEOBJ *pxlo, _In_ ULONG iColor)
Definition: xlateobj.c:664
VOID DIB_1BPP_PutPixel(SURFOBJ *SurfObj, LONG x, LONG y, ULONG c)
Definition: dib1bpp.c:15
BOOLEAN DIB_1BPP_ColorFill ( SURFOBJ ,
RECTL ,
ULONG   
)

Definition at line 459 of file dib1bpp.c.

460 {
461  LONG DestY;
462 
463  for (DestY = DestRect->top; DestY< DestRect->bottom; DestY++)
464  {
465  DIB_1BPP_HLine(DestSurface, DestRect->left, DestRect->right, DestY, color);
466  }
467  return TRUE;
468 }
#define TRUE
Definition: types.h:120
VOID DIB_1BPP_HLine(SURFOBJ *SurfObj, LONG x1, LONG x2, LONG y, ULONG c)
Definition: dib1bpp.c:34
long LONG
Definition: pedump.c:60
GLuint color
Definition: glext.h:6243
GLint GLint bottom
Definition: glext.h:7726
ULONG DIB_1BPP_GetPixel ( SURFOBJ ,
LONG  ,
LONG   
)

Definition at line 26 of file dib1bpp.c.

Referenced by DIB_16BPP_BitBltSrcCopy(), DIB_1BPP_BitBlt(), DIB_24BPP_BitBltSrcCopy(), DIB_32BPP_BitBltSrcCopy(), DIB_4BPP_BitBltSrcCopy(), and DIB_8BPP_BitBltSrcCopy().

27 {
28  PBYTE addr = (PBYTE)SurfObj->pvScan0 + y * SurfObj->lDelta + (x >> 3);
29 
30  return (*addr & MASK1BPP(x) ? 1 : 0);
31 }
#define MASK1BPP(x)
Definition: dib.h:132
GLenum const GLvoid * addr
Definition: glext.h:9621
INT INT y
Definition: msvc.h:62
BYTE * PBYTE
Definition: pedump.c:66
INT x
Definition: msvc.h:62
VOID DIB_1BPP_HLine ( SURFOBJ ,
LONG  ,
LONG  ,
LONG  ,
ULONG   
)

Definition at line 34 of file dib1bpp.c.

Referenced by DIB_1BPP_ColorFill(), and IntGdiCreateMaskFromRLE().

35 {
36  while(x1 < x2)
37  {
38  DIB_1BPP_PutPixel(SurfObj, x1, y, c);
39  x1++;
40  }
41 }
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG x1
Definition: winddi.h:3706
const GLubyte * c
Definition: glext.h:8905
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG _In_ LONG _In_ LONG x2
Definition: winddi.h:3706
INT INT y
Definition: msvc.h:62
VOID DIB_1BPP_PutPixel(SURFOBJ *SurfObj, LONG x, LONG y, ULONG c)
Definition: dib1bpp.c:15
VOID DIB_1BPP_PutPixel ( SURFOBJ ,
LONG  ,
LONG  ,
ULONG   
)

Definition at line 15 of file dib1bpp.c.

Referenced by DIB_1BPP_BitBlt(), DIB_1BPP_BitBltSrcCopy(), DIB_1BPP_HLine(), and DIB_1BPP_VLine().

16 {
17  PBYTE addr = (PBYTE)SurfObj->pvScan0 + y * SurfObj->lDelta + (x >> 3);
18 
19  if (0 == (c & 0x01))
20  *addr &= ~MASK1BPP(x);
21  else
22  *addr |= MASK1BPP(x);
23 }
#define MASK1BPP(x)
Definition: dib.h:132
const GLubyte * c
Definition: glext.h:8905
GLenum const GLvoid * addr
Definition: glext.h:9621
INT INT y
Definition: msvc.h:62
BYTE * PBYTE
Definition: pedump.c:66
INT x
Definition: msvc.h:62
BOOLEAN DIB_1BPP_TransparentBlt ( SURFOBJ ,
SURFOBJ ,
RECTL ,
RECTL ,
XLATEOBJ ,
ULONG   
)

Definition at line 472 of file dib1bpp.c.

475 {
476  return FALSE;
477 }
#define FALSE
Definition: types.h:117
VOID DIB_1BPP_VLine ( SURFOBJ ,
LONG  ,
LONG  ,
LONG  ,
ULONG   
)

Definition at line 44 of file dib1bpp.c.

45 {
46  while(y1 < y2)
47  {
48  DIB_1BPP_PutPixel(SurfObj, x, y1, c);
49  y1++;
50  }
51 }
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG _In_ LONG y1
Definition: winddi.h:3706
const GLubyte * c
Definition: glext.h:8905
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG _In_ LONG _In_ LONG _In_ LONG y2
Definition: winddi.h:3706
VOID DIB_1BPP_PutPixel(SURFOBJ *SurfObj, LONG x, LONG y, ULONG c)
Definition: dib1bpp.c:15
INT x
Definition: msvc.h:62
BOOLEAN DIB_24BPP_AlphaBlend ( SURFOBJ ,
SURFOBJ ,
RECTL ,
RECTL ,
CLIPOBJ ,
XLATEOBJ ,
BLENDOBJ  
)

Definition at line 464 of file dib24bpp.c.

467 {
468  INT Rows, Cols, SrcX, SrcY;
469  register PUCHAR Dst;
471  register NICEPIXEL32 DstPixel, SrcPixel;
472  UCHAR Alpha;
473  //UCHAR SrcBpp;
474 
475  DPRINT("DIB_24BPP_AlphaBlend: srcRect: (%d,%d)-(%d,%d), dstRect: (%d,%d)-(%d,%d)\n",
476  SourceRect->left, SourceRect->top, SourceRect->right, SourceRect->bottom,
477  DestRect->left, DestRect->top, DestRect->right, DestRect->bottom);
478 
479  BlendFunc = BlendObj->BlendFunction;
480  if (BlendFunc.BlendOp != AC_SRC_OVER)
481  {
482  DPRINT1("BlendOp != AC_SRC_OVER\n");
483  return FALSE;
484  }
485  if (BlendFunc.BlendFlags != 0)
486  {
487  DPRINT1("BlendFlags != 0\n");
488  return FALSE;
489  }
490  if ((BlendFunc.AlphaFormat & ~AC_SRC_ALPHA) != 0)
491  {
492  DPRINT1("Unsupported AlphaFormat (0x%x)\n", BlendFunc.AlphaFormat);
493  return FALSE;
494  }
495  if ((BlendFunc.AlphaFormat & AC_SRC_ALPHA) != 0 &&
496  BitsPerFormat(Source->iBitmapFormat) != 32)
497  {
498  DPRINT1("Source bitmap must be 32bpp when AC_SRC_ALPHA is set\n");
499  return FALSE;
500  }
501 
502  Dst = (PUCHAR)((ULONG_PTR)Dest->pvScan0 + (DestRect->top * Dest->lDelta) +
503  (DestRect->left * 3));
504  //SrcBpp = BitsPerFormat(Source->iBitmapFormat);
505 
506  Rows = 0;
507  SrcY = SourceRect->top;
508  while (++Rows <= DestRect->bottom - DestRect->top)
509  {
510  Cols = 0;
511  SrcX = SourceRect->left;
512  while (++Cols <= DestRect->right - DestRect->left)
513  {
514  SrcPixel.ul = DIB_GetSource(Source, SrcX, SrcY, ColorTranslation);
515  SrcPixel.col.red = (SrcPixel.col.red * BlendFunc.SourceConstantAlpha) / 255;
516  SrcPixel.col.green = (SrcPixel.col.green * BlendFunc.SourceConstantAlpha) / 255;
517  SrcPixel.col.blue = (SrcPixel.col.blue * BlendFunc.SourceConstantAlpha) / 255;
518  if (!(BlendFunc.AlphaFormat & AC_SRC_ALPHA))
519  {
520  Alpha = BlendFunc.SourceConstantAlpha ;
521  }
522  else
523  {
524  Alpha = (SrcPixel.col.alpha * BlendFunc.SourceConstantAlpha) / 255;
525  }
526 
527  DstPixel.col.red = Clamp8((*Dst * (255 - Alpha)) / 255 + SrcPixel.col.red) ;
528  DstPixel.col.green = Clamp8((*(Dst+1) * (255 - Alpha) / 255 + SrcPixel.col.green)) ;
529  DstPixel.col.blue = Clamp8((*(Dst+2) * (255 - Alpha)) / 255 + SrcPixel.col.blue) ;
530  *Dst++ = DstPixel.col.red;
531  *Dst++ = DstPixel.col.green;
532  *Dst++ = DstPixel.col.blue;
533  SrcX = SourceRect->left + (Cols*(SourceRect->right - SourceRect->left))/(DestRect->right - DestRect->left);
534  }
535  Dst = (PUCHAR)((ULONG_PTR)Dest->pvScan0 + ((DestRect->top + Rows) * Dest->lDelta) +
536  (DestRect->left*3));
537  SrcY = SourceRect->top + (Rows*(SourceRect->bottom - SourceRect->top))/(DestRect->bottom - DestRect->top);
538  }
539 
540  return TRUE;
541 }
#define TRUE
Definition: types.h:120
UINTN UINTN UINTN * Rows
Definition: acefiex.h:213
#define BitsPerFormat(Format)
Definition: surface.h:102
unsigned char * PUCHAR
Definition: retypes.h:3
#define AC_SRC_ALPHA
Definition: alphablend.c:9
int32_t INT
Definition: typedefs.h:56
BYTE BlendOp
Definition: wingdi.h:2736
uint32_t ULONG_PTR
Definition: typedefs.h:63
#define DIB_GetSource(SourceSurf, sx, sy, ColorTranslation)
Definition: dib.h:136
#define FALSE
Definition: types.h:117
void DPRINT(...)
Definition: polytest.cpp:61
GLint GLint bottom
Definition: glext.h:7726
BYTE SourceConstantAlpha
Definition: wingdi.h:2738
GLdouble GLdouble right
Definition: glext.h:10859
unsigned char UCHAR
Definition: xmlstorage.h:181
BYTE BlendFlags
Definition: wingdi.h:2737
#define AC_SRC_OVER
Definition: wingdi.h:1350
#define Dst
Definition: mesh.h:153
#define DPRINT1
Definition: precomp.h:8
struct NICEPIXEL32::@3879 col
static __inline UCHAR Clamp8(ULONG val)
Definition: dib24bpp.c:458
BYTE AlphaFormat
Definition: wingdi.h:2739
BLENDFUNCTION BlendFunc
Definition: general.c:30
ULONG ul
Definition: alphablend.c:16
BOOLEAN DIB_24BPP_BitBlt ( PBLTINFO  )

Definition at line 229 of file dib24bpp.c.

230 {
231  LONG DestX, DestY;
232  LONG SourceX, SourceY;
233  LONG PatternY = 0;
234  ULONG Dest, Source = 0, Pattern = 0;
235  BOOL UsesSource;
236  BOOL UsesPattern;
237  PBYTE DestBits;
238 
239  UsesSource = ROP4_USES_SOURCE(BltInfo->Rop4);
240  UsesPattern = ROP4_USES_PATTERN(BltInfo->Rop4);
241 
242  SourceY = BltInfo->SourcePoint.y;
243  DestBits = (PBYTE)(
244  (PBYTE)BltInfo->DestSurface->pvScan0 +
245  (BltInfo->DestRect.left << 1) + BltInfo->DestRect.left +
246  BltInfo->DestRect.top * BltInfo->DestSurface->lDelta);
247 
248  if (UsesPattern)
249  {
250  if (BltInfo->PatternSurface)
251  {
252  PatternY = (BltInfo->DestRect.top - BltInfo->BrushOrigin.y) %
253  BltInfo->PatternSurface->sizlBitmap.cy;
254  }
255  else
256  {
257  if (BltInfo->Brush)
258  Pattern = BltInfo->Brush->iSolidColor;
259  }
260  }
261 
262  for (DestY = BltInfo->DestRect.top; DestY < BltInfo->DestRect.bottom; DestY++)
263  {
264  SourceX = BltInfo->SourcePoint.x;
265 
266  for (DestX = BltInfo->DestRect.left; DestX < BltInfo->DestRect.right; DestX++, DestBits += 3, SourceX++)
267  {
268  Dest = *((PUSHORT)DestBits) + (*(DestBits + 2) << 16);
269 
270  if (UsesSource)
271  {
272  Source = DIB_GetSource(BltInfo->SourceSurface, SourceX, SourceY, BltInfo->XlateSourceToDest);
273  }
274 
275  if (BltInfo->PatternSurface)
276  {
277  Pattern = DIB_GetSourceIndex(BltInfo->PatternSurface, (DestX - BltInfo->BrushOrigin.x) % BltInfo->PatternSurface->sizlBitmap.cx, PatternY);
278  }
279 
280  Dest = DIB_DoRop(BltInfo->Rop4, Dest, Source, Pattern) & 0xFFFFFF;
281  *(PUSHORT)(DestBits) = Dest & 0xFFFF;
282  *(DestBits + 2) = (BYTE)(Dest >> 16);
283  }
284 
285  SourceY++;
286  if (BltInfo->PatternSurface)
287  {
288  PatternY++;
289  PatternY %= BltInfo->PatternSurface->sizlBitmap.cy;
290  }
291  DestBits -= (BltInfo->DestRect.right - BltInfo->DestRect.left) * 3;
292  DestBits += BltInfo->DestSurface->lDelta;
293  }
294 
295  return TRUE;
296 }
#define TRUE
Definition: types.h:120
#define DIB_GetSource(SourceSurf, sx, sy, ColorTranslation)
Definition: dib.h:136
long LONG
Definition: pedump.c:60
#define DIB_GetSourceIndex(SourceSurf, sx, sy)
Definition: dib.h:141
#define ROP4_USES_SOURCE(Rop4)
Definition: inteng.h:45
ULONG DIB_DoRop(ULONG Rop, ULONG Dest, ULONG Source, ULONG Pattern)
Definition: dib.c:92
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned short * PUSHORT
Definition: retypes.h:2
unsigned char BYTE
Definition: ntddk_ex.h:96
#define ROP4_USES_PATTERN(Rop4)
Definition: inteng.h:46
unsigned int ULONG
Definition: retypes.h:1
BYTE * PBYTE
Definition: pedump.c:66
BOOLEAN DIB_24BPP_BitBltSrcCopy ( PBLTINFO  )

Definition at line 50 of file dib24bpp.c.

51 {
52  LONG i, j, sx, sy, xColor, f1;
53  PBYTE SourceBits, DestBits, SourceLine, DestLine;
54  PBYTE SourceBits_4BPP, SourceLine_4BPP;
55  PWORD SourceBits_16BPP, SourceLine_16BPP;
56 
57  DestBits = (PBYTE)BltInfo->DestSurface->pvScan0 + (BltInfo->DestRect.top * BltInfo->DestSurface->lDelta) + BltInfo->DestRect.left * 3;
58 
59  switch(BltInfo->SourceSurface->iBitmapFormat)
60  {
61  case BMF_1BPP:
62  sx = BltInfo->SourcePoint.x;
63  sy = BltInfo->SourcePoint.y;
64 
65  for (j=BltInfo->DestRect.top; j<BltInfo->DestRect.bottom; j++)
66  {
67  sx = BltInfo->SourcePoint.x;
68  for (i=BltInfo->DestRect.left; i<BltInfo->DestRect.right; i++)
69  {
70  if(DIB_1BPP_GetPixel(BltInfo->SourceSurface, sx, sy) == 0)
71  {
72  DIB_24BPP_PutPixel(BltInfo->DestSurface, i, j, XLATEOBJ_iXlate(BltInfo->XlateSourceToDest, 0));
73  } else {
74  DIB_24BPP_PutPixel(BltInfo->DestSurface, i, j, XLATEOBJ_iXlate(BltInfo->XlateSourceToDest, 1));
75  }
76  sx++;
77  }
78  sy++;
79  }
80  break;
81 
82  case BMF_4BPP:
83  SourceBits_4BPP = (PBYTE)BltInfo->SourceSurface->pvScan0 + (BltInfo->SourcePoint.y * BltInfo->SourceSurface->lDelta) + (BltInfo->SourcePoint.x >> 1);
84 
85  for (j=BltInfo->DestRect.top; j<BltInfo->DestRect.bottom; j++)
86  {
87  SourceLine_4BPP = SourceBits_4BPP;
88  DestLine = DestBits;
89  sx = BltInfo->SourcePoint.x;
90  f1 = sx & 1;
91 
92  for (i=BltInfo->DestRect.left; i<BltInfo->DestRect.right; i++)
93  {
94  xColor = XLATEOBJ_iXlate(BltInfo->XlateSourceToDest,
95  (*SourceLine_4BPP & altnotmask[f1]) >> (4 * (1 - f1)));
96  *DestLine++ = xColor & 0xff;
97  *(PWORD)DestLine = (WORD)(xColor >> 8);
98  DestLine += 2;
99  if(f1 == 1) { SourceLine_4BPP++; f1 = 0; } else { f1 = 1; }
100  sx++;
101  }
102 
103  SourceBits_4BPP += BltInfo->SourceSurface->lDelta;
104  DestBits += BltInfo->DestSurface->lDelta;
105  }
106  break;
107 
108  case BMF_8BPP:
109  SourceLine = (PBYTE)BltInfo->SourceSurface->pvScan0 + (BltInfo->SourcePoint.y * BltInfo->SourceSurface->lDelta) + BltInfo->SourcePoint.x;
110  DestLine = DestBits;
111 
112  for (j = BltInfo->DestRect.top; j < BltInfo->DestRect.bottom; j++)
113  {
114  SourceBits = SourceLine;
115  DestBits = DestLine;
116 
117  for (i = BltInfo->DestRect.left; i < BltInfo->DestRect.right; i++)
118  {
119  xColor = XLATEOBJ_iXlate(BltInfo->XlateSourceToDest, *SourceBits);
120  *DestBits = xColor & 0xff;
121  *(PWORD)(DestBits + 1) = (WORD)(xColor >> 8);
122  SourceBits += 1;
123  DestBits += 3;
124  }
125 
126  SourceLine += BltInfo->SourceSurface->lDelta;
127  DestLine += BltInfo->DestSurface->lDelta;
128  }
129  break;
130 
131  case BMF_16BPP:
132  SourceBits_16BPP = (PWORD)((PBYTE)BltInfo->SourceSurface->pvScan0 + (BltInfo->SourcePoint.y * BltInfo->SourceSurface->lDelta) + 2 * BltInfo->SourcePoint.x);
133 
134  for (j=BltInfo->DestRect.top; j<BltInfo->DestRect.bottom; j++)
135  {
136  SourceLine_16BPP = SourceBits_16BPP;
137  DestLine = DestBits;
138 
139  for (i=BltInfo->DestRect.left; i<BltInfo->DestRect.right; i++)
140  {
141  xColor = XLATEOBJ_iXlate(BltInfo->XlateSourceToDest, *SourceLine_16BPP);
142  *DestLine++ = xColor & 0xff;
143  *(PWORD)DestLine = (WORD)(xColor >> 8);
144  DestLine += 2;
145  SourceLine_16BPP++;
146  }
147 
148  SourceBits_16BPP = (PWORD)((PBYTE)SourceBits_16BPP + BltInfo->SourceSurface->lDelta);
149  DestBits += BltInfo->DestSurface->lDelta;
150  }
151  break;
152 
153  case BMF_24BPP:
154  if (NULL == BltInfo->XlateSourceToDest || 0 != (BltInfo->XlateSourceToDest->flXlate & XO_TRIVIAL))
155  {
156  if (BltInfo->DestRect.top < BltInfo->SourcePoint.y)
157  {
158  SourceBits = (PBYTE)BltInfo->SourceSurface->pvScan0 + (BltInfo->SourcePoint.y * BltInfo->SourceSurface->lDelta) + 3 * BltInfo->SourcePoint.x;
159  for (j = BltInfo->DestRect.top; j < BltInfo->DestRect.bottom; j++)
160  {
161  RtlMoveMemory(DestBits, SourceBits, 3 * (BltInfo->DestRect.right - BltInfo->DestRect.left));
162  SourceBits += BltInfo->SourceSurface->lDelta;
163  DestBits += BltInfo->DestSurface->lDelta;
164  }
165  }
166  else
167  {
168  SourceBits = (PBYTE)BltInfo->SourceSurface->pvScan0 + ((BltInfo->SourcePoint.y + BltInfo->DestRect.bottom - BltInfo->DestRect.top - 1) * BltInfo->SourceSurface->lDelta) + 3 * BltInfo->SourcePoint.x;
169  DestBits = (PBYTE)BltInfo->DestSurface->pvScan0 + ((BltInfo->DestRect.bottom - 1) * BltInfo->DestSurface->lDelta) + 3 * BltInfo->DestRect.left;
170  for (j = BltInfo->DestRect.bottom - 1; BltInfo->DestRect.top <= j; j--)
171  {
172  RtlMoveMemory(DestBits, SourceBits, 3 * (BltInfo->DestRect.right - BltInfo->DestRect.left));
173  SourceBits -= BltInfo->SourceSurface->lDelta;
174  DestBits -= BltInfo->DestSurface->lDelta;
175  }
176  }
177  }
178  else
179  {
180  sx = BltInfo->SourcePoint.x;
181  sy = BltInfo->SourcePoint.y;
182 
183  for (j=BltInfo->DestRect.top; j<BltInfo->DestRect.bottom; j++)
184  {
185  sx = BltInfo->SourcePoint.x;
186  for (i=BltInfo->DestRect.left; i<BltInfo->DestRect.right; i++)
187  {
188  DWORD pixel = DIB_24BPP_GetPixel(BltInfo->SourceSurface, sx, sy);
189  DIB_24BPP_PutPixel(BltInfo->DestSurface, i, j, XLATEOBJ_iXlate(BltInfo->XlateSourceToDest, pixel));
190  sx++;
191  }
192  sy++;
193  }
194  }
195  break;
196 
197  case BMF_32BPP:
198  SourceLine = (PBYTE)BltInfo->SourceSurface->pvScan0 + (BltInfo->SourcePoint.y * BltInfo->SourceSurface->lDelta) + 4 * BltInfo->SourcePoint.x;
199  DestLine = DestBits;
200 
201  for (j = BltInfo->DestRect.top; j < BltInfo->DestRect.bottom; j++)
202  {
203  SourceBits = SourceLine;
204  DestBits = DestLine;
205 
206  for (i = BltInfo->DestRect.left; i < BltInfo->DestRect.right; i++)
207  {
208  xColor = XLATEOBJ_iXlate(BltInfo->XlateSourceToDest, *((PDWORD) SourceBits));
209  *DestBits = xColor & 0xff;
210  *(PWORD)(DestBits + 1) = (WORD)(xColor >> 8);
211  SourceBits += 4;
212  DestBits += 3;
213  }
214 
215  SourceLine += BltInfo->SourceSurface->lDelta;
216  DestLine += BltInfo->DestSurface->lDelta;
217  }
218  break;
219 
220  default:
221  DbgPrint("DIB_24BPP_Bitblt: Unhandled Source BPP: %u\n", BitsPerFormat(BltInfo->SourceSurface->iBitmapFormat));
222  return FALSE;
223  }
224 
225  return TRUE;
226 }
#define BMF_24BPP
Definition: winddi.h:359
GLenum GLclampf GLint GLenum GLuint GLenum GLenum GLsizei GLenum const GLvoid GLfloat GLfloat GLfloat GLfloat GLclampd GLint 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 GLboolean GLboolean GLboolean GLint GLenum GLsizei const GLvoid GLenum GLint GLenum GLint GLint GLsizei GLint GLenum GLint GLint GLint GLint GLsizei GLenum GLsizei const GLuint GLboolean GLenum GLenum GLint GLsizei GLenum GLsizei GLenum const GLvoid GLboolean const GLboolean GLenum const GLdouble const GLfloat const GLdouble const GLfloat GLenum GLint GLint GLint GLint GLint GLint j
Definition: glfuncs.h:98
unsigned short WORD
Definition: ntddk_ex.h:93
#define TRUE
Definition: types.h:120
#define BMF_32BPP
Definition: winddi.h:360
#define DbgPrint
Definition: loader.c:26
unsigned char altnotmask[2]
Definition: dib.c:18
#define BitsPerFormat(Format)
Definition: surface.h:102
DWORD DWORD
Definition: winlogon.h:75
Definition: xlate.c:8
#define RtlMoveMemory(Destination, Source, Length)
Definition: typedefs.h:263
GLenum GLclampf GLint i
Definition: glfuncs.h:14
#define FALSE
Definition: types.h:117
long LONG
Definition: pedump.c:60
VOID DIB_24BPP_PutPixel(SURFOBJ *SurfObj, LONG x, LONG y, ULONG c)
Definition: dib24bpp.c:17
smooth NULL
Definition: ftsmooth.c:557
#define BMF_16BPP
Definition: winddi.h:358
WORD * PWORD
Definition: pedump.c:67
ULONG DIB_24BPP_GetPixel(SURFOBJ *SurfObj, LONG x, LONG y)
Definition: dib24bpp.c:25
ULONG DIB_1BPP_GetPixel(SURFOBJ *, LONG, LONG)
Definition: dib1bpp.c:26
#define XO_TRIVIAL
Definition: winddi.h:1247
#define f1(x, y, z)
Definition: sha1.c:30
Definition: xlate.c:9
Definition: xlate.c:10
DWORD * PDWORD
Definition: pedump.c:68
ENGAPI ULONG APIENTRY XLATEOBJ_iXlate(_In_ XLATEOBJ *pxlo, _In_ ULONG iColor)
Definition: xlateobj.c:664
BYTE * PBYTE
Definition: pedump.c:66
BOOLEAN DIB_24BPP_ColorFill ( SURFOBJ ,
RECTL ,
ULONG   
)

Definition at line 300 of file dib24bpp.c.

301 {
302  LONG DestY;
303 
304 #if defined(_M_IX86) && !defined(_MSC_VER)
305  PBYTE xaddr = (PBYTE)DestSurface->pvScan0 + DestRect->top * DestSurface->lDelta + (DestRect->left << 1) + DestRect->left;
306  PBYTE addr;
307  ULONG Count;
308  ULONG xCount=DestRect->right - DestRect->left;
309 
310  for (DestY = DestRect->top; DestY< DestRect->bottom; DestY++)
311  {
312  Count = xCount;
313  addr = xaddr;
314  xaddr = (PBYTE)((ULONG_PTR)addr + DestSurface->lDelta);
315 
316  if (Count < 8)
317  {
318  /* For small fills, don't bother doing anything fancy */
319  while (Count--)
320  {
321  *(PUSHORT)(addr) = color;
322  addr += 2;
323  *(addr) = color >> 16;
324  addr += 1;
325  }
326  }
327  else
328  {
329  /* Align to 4-byte address */
330  while (0 != ((ULONG_PTR) addr & 0x3))
331  {
332  *(PUSHORT)(addr) = color;
333  addr += 2;
334  *(addr) = color >> 16;
335  addr += 1;
336  Count--;
337  }
338  /* If the color we need to fill with is 0ABC, then the final mem pattern
339  * (note little-endianness) would be:
340  *
341  * |C.B.A|C.B.A|C.B.A|C.B.A| <- pixel borders
342  * |C.B.A.C|B.A.C.B|A.C.B.A| <- ULONG borders
343  *
344  * So, taking endianness into account again, we need to fill with these
345  * ULONGs: CABC BCAB ABCA */
346 
347  /* This is about 30% faster than the generic C code below */
348  __asm__ __volatile__ (
349  "movl %1, %%ecx\n\t"
350  "andl $0xffffff, %%ecx\n\t" /* 0ABC */
351  "movl %%ecx, %%ebx\n\t" /* Construct BCAB in ebx */
352  "shrl $8, %%ebx\n\t"
353  "movl %%ecx, %%eax\n\t"
354  "shll $16, %%eax\n\t"
355  "orl %%eax, %%ebx\n\t"
356  "movl %%ecx, %%edx\n\t" /* Construct ABCA in edx */
357  "shll $8, %%edx\n\t"
358  "movl %%ecx, %%eax\n\t"
359  "shrl $16, %%eax\n\t"
360  "orl %%eax, %%edx\n\t"
361  "movl %%ecx, %%eax\n\t" /* Construct CABC in eax */
362  "shll $24, %%eax\n\t"
363  "orl %%ecx, %%eax\n\t"
364  "movl %2, %%ecx\n\t" /* Load count */
365  "shr $2, %%ecx\n\t"
366  "movl %3, %%edi\n" /* Load dest */
367  "1:\n\t"
368  "movl %%eax, (%%edi)\n\t" /* Store 4 pixels, 12 bytes */
369  "movl %%ebx, 4(%%edi)\n\t"
370  "movl %%edx, 8(%%edi)\n\t"
371  "addl $12, %%edi\n\t"
372  "dec %%ecx\n\t"
373  "jnz 1b\n\t"
374  "movl %%edi, %0"
375  : "=m"(addr)
376  : "m"(color), "m"(Count), "m"(addr)
377  : "%eax", "%ebx", "%ecx", "%edx", "%edi");
378  Count = Count & 0x03;
379  while (0 != Count--)
380  {
381  *(PUSHORT)(addr) = color;
382  addr += 2;
383  *(addr) = color >> 16;
384  addr += 1;
385  }
386  }
387  }
388 #else
389 
390  for (DestY = DestRect->top; DestY< DestRect->bottom; DestY++)
391  {
392  DIB_24BPP_HLine(DestSurface, DestRect->left, DestRect->right, DestY, color);
393  }
394 #endif
395  return TRUE;
396 }
#define TRUE
Definition: types.h:120
VOID DIB_24BPP_HLine(SURFOBJ *, LONG, LONG, LONG, ULONG)
Definition: dib24bppc.c:16
_Inout_ __drv_aliasesMem PSLIST_ENTRY _Inout_ PSLIST_ENTRY _In_ ULONG Count
Definition: exfuncs.h:1015
__asm__("\t.globl GetPhys\n""GetPhys:\t\n""mflr 0\n\t""stwu 0,-16(1)\n\t""mfmsr 5\n\t""andi. 6,5,0xffef\n\t""mtmsr 6\n\t""isync\n\t""sync\n\t""lwz 3,0(3)\n\t""mtmsr 5\n\t""isync\n\t""sync\n\t""lwz 0,0(1)\n\t""addi 1,1,16\n\t""mtlr 0\n\t""blr")
uint32_t ULONG_PTR
Definition: typedefs.h:63
long LONG
Definition: pedump.c:60
GLuint color
Definition: glext.h:6243
GLint GLint bottom
Definition: glext.h:7726
unsigned short * PUSHORT
Definition: retypes.h:2
GLenum const GLvoid * addr
Definition: glext.h:9621
unsigned int ULONG
Definition: retypes.h:1
BYTE * PBYTE
Definition: pedump.c:66
ULONG DIB_24BPP_GetPixel ( SURFOBJ ,
LONG  ,
LONG   
)

Definition at line 25 of file dib24bpp.c.

Referenced by DIB_1BPP_BitBltSrcCopy(), and DIB_24BPP_BitBltSrcCopy().

26 {
27  PBYTE addr = (PBYTE)SurfObj->pvScan0 + y * SurfObj->lDelta + (x << 1) + x;
28  return *(PUSHORT)(addr) + (*(addr + 2) << 16);
29 }
unsigned short * PUSHORT
Definition: retypes.h:2
GLenum const GLvoid * addr
Definition: glext.h:9621
INT INT y
Definition: msvc.h:62
BYTE * PBYTE
Definition: pedump.c:66
INT x
Definition: msvc.h:62
VOID DIB_24BPP_HLine ( SURFOBJ ,
LONG  ,
LONG  ,
LONG  ,
ULONG   
)

Definition at line 16 of file dib24bppc.c.

Referenced by DIB_24BPP_ColorFill().

17 {
18  PBYTE addr = (PBYTE)SurfObj->pvScan0 + y * SurfObj->lDelta + (x1 << 1) + x1;
19  ULONG Count = x2 - x1;
20 
21  if (Count < 8)
22  {
23  /* For small fills, don't bother doing anything fancy */
24  while (Count--)
25  {
26  *(PUSHORT)(addr) = c;
27  addr += 2;
28  *(addr) = c >> 16;
29  addr += 1;
30  }
31  }
32  else
33  {
34  ULONG Fill[3];
35  ULONG MultiCount;
36 
37  /* Align to 4-byte address */
38  while (0 != ((ULONG_PTR) addr & 0x3))
39  {
40  *(PUSHORT)(addr) = c;
41  addr += 2;
42  *(addr) = c >> 16;
43  addr += 1;
44  Count--;
45  }
46  /* If the color we need to fill with is 0ABC, then the final mem pattern
47  * (note little-endianness) would be:
48  *
49  * |C.B.A|C.B.A|C.B.A|C.B.A| <- pixel borders
50  * |C.B.A.C|B.A.C.B|A.C.B.A| <- ULONG borders
51  *
52  * So, taking endianness into account again, we need to fill with these
53  * ULONGs: CABC BCAB ABCA */
54 
55  c = c & 0xffffff; /* 0ABC */
56  Fill[0] = c | (c << 24); /* CABC */
57  Fill[1] = (c >> 8) | (c << 16); /* BCAB */
58  Fill[2] = (c << 8) | (c >> 16); /* ABCA */
59  MultiCount = Count / 4;
60  do
61  {
62  *(PULONG)addr = Fill[0];
63  addr += 4;
64  *(PULONG)addr = Fill[1];
65  addr += 4;
66  *(PULONG)addr = Fill[2];
67  addr += 4;
68  }
69  while (0 != --MultiCount);
70 
71  Count = Count & 0x03;
72  while (0 != Count--)
73  {
74  *(PUSHORT)(addr) = c;
75  addr += 2;
76  *(addr) = c >> 16;
77  addr += 1;
78  }
79  }
80 }
void Fill(HDC hdc, LONG x, LONG y, COLORREF color)
Definition: drawing.cpp:109
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG x1
Definition: winddi.h:3706
_Inout_ __drv_aliasesMem PSLIST_ENTRY _Inout_ PSLIST_ENTRY _In_ ULONG Count
Definition: exfuncs.h:1015
uint32_t ULONG_PTR
Definition: typedefs.h:63
const GLubyte * c
Definition: glext.h:8905
unsigned short * PUSHORT
Definition: retypes.h:2
GLenum const GLvoid * addr
Definition: glext.h:9621
unsigned int * PULONG
Definition: retypes.h:1
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG _In_ LONG _In_ LONG x2
Definition: winddi.h:3706
#define c
Definition: ke_i.h:80
unsigned int ULONG
Definition: retypes.h:1
INT INT y
Definition: msvc.h:62
BYTE * PBYTE
Definition: pedump.c:66
VOID DIB_24BPP_PutPixel ( SURFOBJ ,
LONG  ,
LONG  ,
ULONG   
)

Definition at line 17 of file dib24bpp.c.

Referenced by DIB_24BPP_BitBltSrcCopy().

18 {
19  PBYTE addr = (PBYTE)SurfObj->pvScan0 + (y * SurfObj->lDelta) + (x << 1) + x;
20  *(PUSHORT)(addr) = c & 0xFFFF;
21  *(addr + 2) = (c >> 16) & 0xFF;
22 }
const GLubyte * c
Definition: glext.h:8905
unsigned short * PUSHORT
Definition: retypes.h:2
GLenum const GLvoid * addr
Definition: glext.h:9621
INT INT y
Definition: msvc.h:62
BYTE * PBYTE
Definition: pedump.c:66
INT x
Definition: msvc.h:62
BOOLEAN DIB_24BPP_TransparentBlt ( SURFOBJ ,
SURFOBJ ,
RECTL ,
RECTL ,
XLATEOBJ ,
ULONG   
)

Definition at line 399 of file dib24bpp.c.

402 {
403  LONG X, Y, SourceX, SourceY = 0, wd;
404  ULONG Source = 0, Dest;
405  BYTE *DestBits;
406 
407  LONG DstHeight;
408  LONG DstWidth;
409  LONG SrcHeight;
410  LONG SrcWidth;
411 
412  DstHeight = DestRect->bottom - DestRect->top;
413  DstWidth = DestRect->right - DestRect->left;
414  SrcHeight = SourceRect->bottom - SourceRect->top;
415  SrcWidth = SourceRect->right - SourceRect->left;
416 
417  DestBits = (BYTE*)((PBYTE)DestSurf->pvScan0 +
418  (DestRect->left * 3) +
419  DestRect->top * DestSurf->lDelta);
420  wd = DestSurf->lDelta - ((DestRect->right - DestRect->left) * 3);
421 
422  for(Y = DestRect->top; Y < DestRect->bottom; Y++)
423  {
424  SourceY = SourceRect->top+(Y - DestRect->top) * SrcHeight / DstHeight;
425  for(X = DestRect->left; X < DestRect->right; X++, DestBits += 3)
426  {
427  SourceX = SourceRect->left+(X - DestRect->left) * SrcWidth / DstWidth;
428  if (SourceX >= 0 && SourceY >= 0 &&
429  SourceSurf->sizlBitmap.cx > SourceX && SourceSurf->sizlBitmap.cy > SourceY)
430  {
431  Source = DIB_GetSourceIndex(SourceSurf, SourceX, SourceY);
432  if(Source != iTransColor)
433  {
434  Dest = XLATEOBJ_iXlate(ColorTranslation, Source) & 0xFFFFFF;
435  *(PUSHORT)(DestBits) = Dest & 0xFFFF;
436  *(DestBits + 2) = (BYTE)(Dest >> 16);
437  }
438  }
439  }
440 
441  DestBits = (BYTE*)((ULONG_PTR)DestBits + wd);
442  }
443 
444  return TRUE;
445 }
#define TRUE
Definition: types.h:120
#define Y(i)
Definition: t_vb_render.c:49
_In_ SURFOBJ _In_ CLIPOBJ _In_opt_ XLATEOBJ _In_ RECTL _In_ RECTL _In_ ULONG iTransColor
Definition: winddi.h:4190
uint32_t ULONG_PTR
Definition: typedefs.h:63
long LONG
Definition: pedump.c:60
#define DIB_GetSourceIndex(SourceSurf, sx, sy)
Definition: dib.h:141
GLint GLint bottom
Definition: glext.h:7726
unsigned short * PUSHORT
Definition: retypes.h:2
GLdouble GLdouble right
Definition: glext.h:10859
unsigned char BYTE
Definition: ntddk_ex.h:96
unsigned int ULONG
Definition: retypes.h:1
ENGAPI ULONG APIENTRY XLATEOBJ_iXlate(_In_ XLATEOBJ *pxlo, _In_ ULONG iColor)
Definition: xlateobj.c:664
BYTE * PBYTE
Definition: pedump.c:66
#define X(b, s)
VOID DIB_24BPP_VLine ( SURFOBJ ,
LONG  ,
LONG  ,
LONG  ,
ULONG   
)

Definition at line 34 of file dib24bpp.c.

35 {
36  PBYTE addr = (PBYTE)SurfObj->pvScan0 + y1 * SurfObj->lDelta + (x << 1) + x;
37  LONG lDelta = SurfObj->lDelta;
38 
39  c &= 0xFFFFFF;
40  while(y1++ < y2)
41  {
42  *(PUSHORT)(addr) = c & 0xFFFF;
43  *(addr + 2) = (BYTE)(c >> 16);
44 
45  addr += lDelta;
46  }
47 }
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG _In_ LONG y1
Definition: winddi.h:3706
long LONG
Definition: pedump.c:60
const GLubyte * c
Definition: glext.h:8905
unsigned short * PUSHORT
Definition: retypes.h:2
GLenum const GLvoid * addr
Definition: glext.h:9621
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG _In_ LONG _In_ LONG _In_ LONG y2
Definition: winddi.h:3706
unsigned char BYTE
Definition: ntddk_ex.h:96
BYTE * PBYTE
Definition: pedump.c:66
INT x
Definition: msvc.h:62
BOOLEAN DIB_32BPP_AlphaBlend ( SURFOBJ ,
SURFOBJ ,
RECTL ,
RECTL ,
CLIPOBJ ,
XLATEOBJ ,
BLENDOBJ  
)

Definition at line 345 of file dib32bpp.c.

348 {
349  INT Rows, Cols, SrcX, SrcY;
350  register PULONG Dst;
352  register NICEPIXEL32 DstPixel, SrcPixel;
353  UCHAR Alpha, SrcBpp;
354 
355  DPRINT("DIB_32BPP_AlphaBlend: srcRect: (%d,%d)-(%d,%d), dstRect: (%d,%d)-(%d,%d)\n",
356  SourceRect->left, SourceRect->top, SourceRect->right, SourceRect->bottom,
357  DestRect->left, DestRect->top, DestRect->right, DestRect->bottom);
358 
359  BlendFunc = BlendObj->BlendFunction;
360  if (BlendFunc.BlendOp != AC_SRC_OVER)
361  {
362  DPRINT1("BlendOp != AC_SRC_OVER\n");
363  return FALSE;
364  }
365  if (BlendFunc.BlendFlags != 0)
366  {
367  DPRINT1("BlendFlags != 0\n");
368  return FALSE;
369  }
370  if ((BlendFunc.AlphaFormat & ~AC_SRC_ALPHA) != 0)
371  {
372  DPRINT1("Unsupported AlphaFormat (0x%x)\n", BlendFunc.AlphaFormat);
373  return FALSE;
374  }
375  if ((BlendFunc.AlphaFormat & AC_SRC_ALPHA) != 0 &&
376  BitsPerFormat(Source->iBitmapFormat) != 32)
377  {
378  DPRINT1("Source bitmap must be 32bpp when AC_SRC_ALPHA is set\n");
379  return FALSE;
380  }
381 
382  Dst = (PULONG)((ULONG_PTR)Dest->pvScan0 + (DestRect->top * Dest->lDelta) +
383  (DestRect->left << 2));
384  SrcBpp = BitsPerFormat(Source->iBitmapFormat);
385 
386  Rows = 0;
387  SrcY = SourceRect->top;
388  while (++Rows <= DestRect->bottom - DestRect->top)
389  {
390  Cols = 0;
391  SrcX = SourceRect->left;
392  while (++Cols <= DestRect->right - DestRect->left)
393  {
394  SrcPixel.ul = DIB_GetSource(Source, SrcX, SrcY, ColorTranslation);
395  SrcPixel.col.red = (SrcPixel.col.red * BlendFunc.SourceConstantAlpha) / 255;
396  SrcPixel.col.green = (SrcPixel.col.green * BlendFunc.SourceConstantAlpha) / 255;
397  SrcPixel.col.blue = (SrcPixel.col.blue * BlendFunc.SourceConstantAlpha) / 255;
398  SrcPixel.col.alpha = (32 == SrcBpp) ?
399  (SrcPixel.col.alpha * BlendFunc.SourceConstantAlpha) / 255 :
400  BlendFunc.SourceConstantAlpha ;
401 
402  Alpha = ((BlendFunc.AlphaFormat & AC_SRC_ALPHA) != 0) ?
403  SrcPixel.col.alpha : BlendFunc.SourceConstantAlpha ;
404 
405  DstPixel.ul = *Dst;
406  DstPixel.col.red = Clamp8((DstPixel.col.red * (255 - Alpha)) / 255 + SrcPixel.col.red) ;
407  DstPixel.col.green = Clamp8((DstPixel.col.green * (255 - Alpha)) / 255 + SrcPixel.col.green) ;
408  DstPixel.col.blue = Clamp8((DstPixel.col.blue * (255 - Alpha)) / 255 + SrcPixel.col.blue) ;
409  DstPixel.col.alpha = Clamp8((DstPixel.col.alpha * (255 - Alpha)) / 255 + SrcPixel.col.alpha) ;
410  *Dst++ = DstPixel.ul;
411  SrcX = SourceRect->left + (Cols*(SourceRect->right - SourceRect->left))/(DestRect->right - DestRect->left);
412  }
413  Dst = (PULONG)((ULONG_PTR)Dest->pvScan0 + ((DestRect->top + Rows) * Dest->lDelta) +
414  (DestRect->left << 2));
415  SrcY = SourceRect->top + (Rows*(SourceRect->bottom - SourceRect->top))/(DestRect->bottom - DestRect->top);
416  }
417 
418  return TRUE;
419 }
#define TRUE
Definition: types.h:120
UINTN UINTN UINTN * Rows
Definition: acefiex.h:213
#define BitsPerFormat(Format)
Definition: surface.h:102
#define AC_SRC_ALPHA
Definition: alphablend.c:9
int32_t INT
Definition: typedefs.h:56
BYTE BlendOp
Definition: wingdi.h:2736
uint32_t ULONG_PTR
Definition: typedefs.h:63
#define DIB_GetSource(SourceSurf, sx, sy, ColorTranslation)
Definition: dib.h:136
#define FALSE
Definition: types.h:117
void DPRINT(...)
Definition: polytest.cpp:61
GLint GLint bottom
Definition: glext.h:7726
BYTE SourceConstantAlpha
Definition: wingdi.h:2738
GLdouble GLdouble right
Definition: glext.h:10859
unsigned char UCHAR
Definition: xmlstorage.h:181
static __inline UCHAR Clamp8(ULONG val)
Definition: dib32bpp.c:339
BYTE BlendFlags
Definition: wingdi.h:2737
#define AC_SRC_OVER
Definition: wingdi.h:1350
#define Dst
Definition: mesh.h:153
unsigned int * PULONG
Definition: retypes.h:1
#define DPRINT1
Definition: precomp.h:8
struct NICEPIXEL32::@3879 col
BYTE AlphaFormat
Definition: wingdi.h:2739
BLENDFUNCTION BlendFunc
Definition: general.c:30
ULONG ul
Definition: alphablend.c:16
BOOLEAN DIB_32BPP_BitBlt ( PBLTINFO  )
BOOLEAN DIB_32BPP_BitBltSrcCopy ( PBLTINFO  )

Definition at line 50 of file dib32bpp.c.

51 {
52  LONG i, j, sx, sy, xColor, f1;
53  PBYTE SourceBits, DestBits, SourceLine, DestLine;
54  PBYTE SourceBits_4BPP, SourceLine_4BPP;
55  PDWORD Source32, Dest32;
56 
57  DestBits = (PBYTE)BltInfo->DestSurface->pvScan0
58  + (BltInfo->DestRect.top * BltInfo->DestSurface->lDelta)
59  + 4 * BltInfo->DestRect.left;
60 
61  switch (BltInfo->SourceSurface->iBitmapFormat)
62  {
63  case BMF_1BPP:
64 
65  sx = BltInfo->SourcePoint.x;
66  sy = BltInfo->SourcePoint.y;
67 
68  for (j=BltInfo->DestRect.top; j<BltInfo->DestRect.bottom; j++)
69  {
70  sx = BltInfo->SourcePoint.x;
71  for (i=BltInfo->DestRect.left; i<BltInfo->DestRect.right; i++)
72  {
73  if (DIB_1BPP_GetPixel(BltInfo->SourceSurface, sx, sy) == 0)
74  {
75  DIB_32BPP_PutPixel(BltInfo->DestSurface, i, j, XLATEOBJ_iXlate(BltInfo->XlateSourceToDest, 0));
76  } else {
77  DIB_32BPP_PutPixel(BltInfo->DestSurface, i, j, XLATEOBJ_iXlate(BltInfo->XlateSourceToDest, 1));
78  }
79  sx++;
80  }
81  sy++;
82  }
83  break;
84 
85  case BMF_4BPP:
86  SourceBits_4BPP = (PBYTE)BltInfo->SourceSurface->pvScan0
87  + (BltInfo->SourcePoint.y * BltInfo->SourceSurface->lDelta)
88  + (BltInfo->SourcePoint.x >> 1);
89 
90  for (j=BltInfo->DestRect.top; j<BltInfo->DestRect.bottom; j++)
91  {
92  SourceLine_4BPP = SourceBits_4BPP;
93  sx = BltInfo->SourcePoint.x;
94  f1 = sx & 1;
95 
96  for (i=BltInfo->DestRect.left; i<BltInfo->DestRect.right; i++)
97  {
98  xColor = XLATEOBJ_iXlate(BltInfo->XlateSourceToDest,
99  (*SourceLine_4BPP & altnotmask[f1]) >> (4 * (1 - f1)));
100  DIB_32BPP_PutPixel(BltInfo->DestSurface, i, j, xColor);
101  if (f1 == 1) {
102  SourceLine_4BPP++;
103  f1 = 0;
104  } else {
105  f1 = 1;
106  }
107  sx++;
108  }
109 
110  SourceBits_4BPP += BltInfo->SourceSurface->lDelta;
111  }
112  break;
113 
114  case BMF_8BPP:
115  SourceLine = (PBYTE)BltInfo->SourceSurface->pvScan0 + (BltInfo->SourcePoint.y * BltInfo->SourceSurface->lDelta) + BltInfo->SourcePoint.x;
116  DestLine = DestBits;
117 
118  for (j = BltInfo->DestRect.top; j < BltInfo->DestRect.bottom; j++)
119  {
120  SourceBits = SourceLine;
121  DestBits = DestLine;
122 
123  for (i = BltInfo->DestRect.left; i < BltInfo->DestRect.right; i++)
124  {
125  xColor = *SourceBits;
126  *((PDWORD) DestBits) = (DWORD)XLATEOBJ_iXlate(BltInfo->XlateSourceToDest, xColor);
127  SourceBits += 1;
128  DestBits += 4;
129  }
130 
131  SourceLine += BltInfo->SourceSurface->lDelta;
132  DestLine += BltInfo->DestSurface->lDelta;
133  }
134  break;
135 
136  case BMF_16BPP:
137  SourceLine = (PBYTE)BltInfo->SourceSurface->pvScan0 + (BltInfo->SourcePoint.y * BltInfo->SourceSurface->lDelta) + 2 * BltInfo->SourcePoint.x;
138  DestLine = DestBits;
139 
140  for (j = BltInfo->DestRect.top; j < BltInfo->DestRect.bottom; j++)
141  {
142  SourceBits = SourceLine;
143  DestBits = DestLine;
144 
145  for (i = BltInfo->DestRect.left; i < BltInfo->DestRect.right; i++)
146  {
147  xColor = *((PWORD) SourceBits);
148  *((PDWORD) DestBits) = (DWORD)XLATEOBJ_iXlate(BltInfo->XlateSourceToDest, xColor);
149  SourceBits += 2;
150  DestBits += 4;
151  }
152 
153  SourceLine += BltInfo->SourceSurface->lDelta;
154  DestLine += BltInfo->DestSurface->lDelta;
155  }
156  break;
157 
158  case BMF_24BPP:
159  SourceLine = (PBYTE)BltInfo->SourceSurface->pvScan0
160  + (BltInfo->SourcePoint.y * BltInfo->SourceSurface->lDelta)
161  + 3 * BltInfo->SourcePoint.x;
162  DestLine = DestBits;
163 
164  for (j = BltInfo->DestRect.top; j < BltInfo->DestRect.bottom; j++)
165  {
166  SourceBits = SourceLine;
167  DestBits = DestLine;
168 
169  for (i = BltInfo->DestRect.left; i < BltInfo->DestRect.right; i++)
170  {
171  xColor = (*(SourceBits + 2) << 0x10) +
172  (*(SourceBits + 1) << 0x08) +
173  (*(SourceBits));
174  *((PDWORD)DestBits) = (DWORD)XLATEOBJ_iXlate(BltInfo->XlateSourceToDest, xColor);
175  SourceBits += 3;
176  DestBits += 4;
177  }
178 
179  SourceLine += BltInfo->SourceSurface->lDelta;
180  DestLine += BltInfo->DestSurface->lDelta;
181  }
182  break;
183 
184  case BMF_32BPP:
185  if (NULL == BltInfo->XlateSourceToDest ||
186  0 != (BltInfo->XlateSourceToDest->flXlate & XO_TRIVIAL))
187  {
188  if (BltInfo->DestRect.top < BltInfo->SourcePoint.y)
189  {
190  SourceBits = (PBYTE)BltInfo->SourceSurface->pvScan0 + (BltInfo->SourcePoint.y * BltInfo->SourceSurface->lDelta) + 4 * BltInfo->SourcePoint.x;
191  for (j = BltInfo->DestRect.top; j < BltInfo->DestRect.bottom; j++)
192  {
193  RtlMoveMemory(DestBits, SourceBits, 4 * (BltInfo->DestRect.right - BltInfo->DestRect.left));
194  SourceBits += BltInfo->SourceSurface->lDelta;
195  DestBits += BltInfo->DestSurface->lDelta;
196  }
197  }
198  else
199  {
200  SourceBits = (PBYTE)BltInfo->SourceSurface->pvScan0
201  + ((BltInfo->SourcePoint.y
202  + BltInfo->DestRect.bottom
203  - BltInfo->DestRect.top - 1) * BltInfo->SourceSurface->lDelta)
204  + 4 * BltInfo->SourcePoint.x;
205  DestBits = (PBYTE)BltInfo->DestSurface->pvScan0 + ((BltInfo->DestRect.bottom - 1) * BltInfo->DestSurface->lDelta) + 4 * BltInfo->DestRect.left;
206  for (j = BltInfo->DestRect.bottom - 1; BltInfo->DestRect.top <= j; j--)
207  {
208  RtlMoveMemory(DestBits, SourceBits, 4 * (BltInfo->DestRect.right - BltInfo->DestRect.left));
209  SourceBits -= BltInfo->SourceSurface->lDelta;
210  DestBits -= BltInfo->DestSurface->lDelta;
211  }
212  }
213  }
214  else
215  {
216  if (BltInfo->DestRect.top < BltInfo->SourcePoint.y)
217  {
218  SourceBits = ((PBYTE)BltInfo->SourceSurface->pvScan0 + (BltInfo->SourcePoint.y * BltInfo->SourceSurface->lDelta) + 4 * BltInfo->SourcePoint.x);
219  for (j = BltInfo->DestRect.top; j < BltInfo->DestRect.bottom; j++)
220  {
221  if (BltInfo->DestRect.left < BltInfo->SourcePoint.x)
222  {
223  Dest32 = (DWORD *) DestBits;
224  Source32 = (DWORD *) SourceBits;
225  for (i = BltInfo->DestRect.left; i < BltInfo->DestRect.right; i++)
226  {
227  *Dest32++ = XLATEOBJ_iXlate(BltInfo->XlateSourceToDest, *Source32++);
228  }
229  }
230  else
231  {
232  Dest32 = (DWORD *) DestBits + (BltInfo->DestRect.right - BltInfo->DestRect.left - 1);
233  Source32 = (DWORD *) SourceBits + (BltInfo->DestRect.right - BltInfo->DestRect.left - 1);
234  for (i = BltInfo->DestRect.right - 1; BltInfo->DestRect.left <= i; i--)
235  {
236  *Dest32-- = XLATEOBJ_iXlate(BltInfo->XlateSourceToDest, *Source32--);
237  }
238  }
239  SourceBits += BltInfo->SourceSurface->lDelta;
240  DestBits += BltInfo->DestSurface->lDelta;
241  }
242  }
243  else
244  {
245  SourceBits = (PBYTE)BltInfo->SourceSurface->pvScan0 + ((BltInfo->SourcePoint.y + BltInfo->DestRect.bottom - BltInfo->DestRect.top - 1) * BltInfo->SourceSurface->lDelta) + 4 * BltInfo->SourcePoint.x;
246  DestBits = (PBYTE)BltInfo->DestSurface->pvScan0 + ((BltInfo->DestRect.bottom - 1) * BltInfo->DestSurface->lDelta) + 4 * BltInfo->DestRect.left;
247  for (j = BltInfo->DestRect.bottom - 1; BltInfo->DestRect.top <= j; j--)
248  {
249  if (BltInfo->DestRect.left < BltInfo->SourcePoint.x)
250  {
251  Dest32 = (DWORD *) DestBits;
252  Source32 = (DWORD *) SourceBits;
253  for (i = BltInfo->DestRect.left; i < BltInfo->DestRect.right; i++)
254  {
255  *Dest32++ = XLATEOBJ_iXlate(BltInfo->XlateSourceToDest, *Source32++);
256  }
257  }
258  else
259  {
260  Dest32 = (DWORD *) DestBits + (BltInfo->DestRect.right - BltInfo->DestRect.left - 1);
261  Source32 = (DWORD *) SourceBits + (BltInfo->DestRect.right - BltInfo->DestRect.left - 1);
262  for (i = BltInfo->DestRect.right - 1; BltInfo->DestRect.left <= i; i--)
263  {
264  *Dest32-- = XLATEOBJ_iXlate(BltInfo->XlateSourceToDest, *Source32--);
265  }
266  }
267  SourceBits -= BltInfo->SourceSurface->lDelta;
268  DestBits -= BltInfo->DestSurface->lDelta;
269  }
270  }
271  }
272  break;
273 
274  default:
275  DPRINT1("DIB_32BPP_Bitblt: Unhandled Source BPP: %u\n", BitsPerFormat(BltInfo->SourceSurface->iBitmapFormat));
276  return FALSE;
277  }
278 
279  return TRUE;
280 }
#define BMF_24BPP
Definition: winddi.h:359
GLenum GLclampf GLint GLenum GLuint GLenum GLenum GLsizei GLenum const GLvoid GLfloat GLfloat GLfloat GLfloat GLclampd GLint 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 GLboolean GLboolean GLboolean GLint GLenum GLsizei const GLvoid GLenum GLint GLenum GLint GLint GLsizei GLint GLenum GLint GLint GLint GLint GLsizei GLenum GLsizei const GLuint GLboolean GLenum GLenum GLint GLsizei GLenum GLsizei GLenum const GLvoid GLboolean const GLboolean GLenum const GLdouble const GLfloat const GLdouble const GLfloat GLenum GLint GLint GLint GLint GLint GLint j
Definition: glfuncs.h:98
#define TRUE
Definition: types.h:120
#define BMF_32BPP
Definition: winddi.h:360
unsigned char altnotmask[2]
Definition: dib.c:18
#define BitsPerFormat(Format)
Definition: surface.h:102
#define DWORD
Definition: msvc.h:34
VOID DIB_32BPP_PutPixel(SURFOBJ *SurfObj, LONG x, LONG y, ULONG c)
Definition: dib32bpp.c:17
DWORD DWORD
Definition: winlogon.h:75
Definition: xlate.c:8
#define RtlMoveMemory(Destination, Source, Length)
Definition: typedefs.h:263
GLenum GLclampf GLint i
Definition: glfuncs.h:14
#define FALSE
Definition: types.h:117
long LONG
Definition: pedump.c:60
smooth NULL
Definition: ftsmooth.c:557
#define BMF_16BPP
Definition: winddi.h:358
WORD * PWORD
Definition: pedump.c:67
ULONG DIB_1BPP_GetPixel(SURFOBJ *, LONG, LONG)
Definition: dib1bpp.c:26
#define XO_TRIVIAL
Definition: winddi.h:1247
#define f1(x, y, z)
Definition: sha1.c:30
Definition: xlate.c:9
Definition: xlate.c:10
DWORD * PDWORD
Definition: pedump.c:68
#define DPRINT1
Definition: precomp.h:8
ENGAPI ULONG APIENTRY XLATEOBJ_iXlate(_In_ XLATEOBJ *pxlo, _In_ ULONG iColor)
Definition: xlateobj.c:664
BYTE * PBYTE
Definition: pedump.c:66
BOOLEAN DIB_32BPP_ColorFill ( SURFOBJ ,
RECTL ,
ULONG   
)

Definition at line 31 of file dib32bppc.c.

32 {
33  ULONG DestY;
34 
35  for (DestY = DestRect->top; DestY< DestRect->bottom; DestY++)
36  {
37  DIB_32BPP_HLine (DestSurface, DestRect->left, DestRect->right, DestY, color);
38  }
39 
40  return TRUE;
41 }
#define TRUE
Definition: types.h:120
GLuint color
Definition: glext.h:6243
GLint GLint bottom
Definition: glext.h:7726
VOID DIB_32BPP_HLine(SURFOBJ *SurfObj, LONG x1, LONG x2, LONG y, ULONG c)
Definition: dib32bppc.c:16
unsigned int ULONG
Definition: retypes.h:1
ULONG DIB_32BPP_GetPixel ( SURFOBJ ,
LONG  ,
LONG   
)

Definition at line 26 of file dib32bpp.c.

Referenced by DIB_1BPP_BitBltSrcCopy().

27 {
28  PBYTE byteaddr = (PBYTE)SurfObj->pvScan0 + y * SurfObj->lDelta;
29  PDWORD addr = (PDWORD)byteaddr + x;
30 
31  return (ULONG)(*addr);
32 }
GLenum const GLvoid * addr
Definition: glext.h:9621
DWORD * PDWORD
Definition: pedump.c:68
unsigned int ULONG
Definition: retypes.h:1
INT INT y
Definition: msvc.h:62
BYTE * PBYTE
Definition: pedump.c:66
INT x
Definition: msvc.h:62
VOID DIB_32BPP_HLine ( SURFOBJ ,
LONG  ,
LONG  ,
LONG  ,
ULONG   
)

Definition at line 16 of file dib32bppc.c.

Referenced by DIB_32BPP_ColorFill().

17 {
18  PBYTE byteaddr = (PBYTE)((ULONG_PTR)SurfObj->pvScan0 + y * SurfObj->lDelta);
19  PDWORD addr = (PDWORD)byteaddr + x1;
20  LONG cx = x1;
21 
22  while(cx < x2)
23  {
24  *addr = (DWORD)c;
25  ++addr;
26  ++cx;
27  }
28 }
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG x1
Definition: winddi.h:3706
#define DWORD
Definition: msvc.h:34
uint32_t ULONG_PTR
Definition: typedefs.h:63
long LONG
Definition: pedump.c:60
const GLubyte * c
Definition: glext.h:8905
GLenum const GLvoid * addr
Definition: glext.h:9621
DWORD * PDWORD
Definition: pedump.c:68
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG _In_ LONG _In_ LONG x2
Definition: winddi.h:3706
_Out_opt_ int * cx
Definition: commctrl.h:570
INT INT y
Definition: msvc.h:62
BYTE * PBYTE
Definition: pedump.c:66
VOID DIB_32BPP_PutPixel ( SURFOBJ ,
LONG  ,
LONG  ,
ULONG   
)

Definition at line 17 of file dib32bpp.c.

Referenced by DIB_32BPP_BitBltSrcCopy().

18 {
19  PBYTE byteaddr = (PBYTE)SurfObj->pvScan0 + y * SurfObj->lDelta;
20  PDWORD addr = (PDWORD)byteaddr + x;
21 
22  *addr = c;
23 }
GLenum const GLvoid * addr
Definition: glext.h:9621
DWORD * PDWORD
Definition: pedump.c:68
#define c
Definition: ke_i.h:80
INT INT y
Definition: msvc.h:62
BYTE * PBYTE
Definition: pedump.c:66
INT x
Definition: msvc.h:62
BOOLEAN DIB_32BPP_TransparentBlt ( SURFOBJ ,
SURFOBJ ,
RECTL ,
RECTL ,
XLATEOBJ ,
ULONG   
)

Definition at line 283 of file dib32bpp.c.

286 {
287  LONG X, Y, SourceX, SourceY = 0, wd;
288  ULONG *DestBits, Source = 0;
289 
290  LONG DstHeight;
291  LONG DstWidth;
292  LONG SrcHeight;
293  LONG SrcWidth;
294 
295  DstHeight = DestRect->bottom - DestRect->top;
296  DstWidth = DestRect->right - DestRect->left;
297  SrcHeight = SourceRect->bottom - SourceRect->top;
298  SrcWidth = SourceRect->right - SourceRect->left;
299 
300  DestBits = (ULONG*)((PBYTE)DestSurf->pvScan0 +
301  (DestRect->left << 2) +
302  DestRect->top * DestSurf->lDelta);
303  wd = DestSurf->lDelta - ((DestRect->right - DestRect->left) << 2);
304 
305  for (Y = DestRect->top; Y < DestRect->bottom; Y++)
306  {
307  SourceY = SourceRect->top+(Y - DestRect->top) * SrcHeight / DstHeight;
308  for (X = DestRect->left; X < DestRect->right; X++, DestBits++)
309  {
310  SourceX = SourceRect->left+(X - DestRect->left) * SrcWidth / DstWidth;
311  if (SourceX >= 0 && SourceY >= 0 &&
312  SourceSurf->sizlBitmap.cx > SourceX && SourceSurf->sizlBitmap.cy > SourceY)
313  {
314  Source = DIB_GetSourceIndex(SourceSurf, SourceX, SourceY);
315  if ((0x00FFFFFF & Source) != (0x00FFFFFF & iTransColor))
316  {
317  *DestBits = XLATEOBJ_iXlate(ColorTranslation, Source);
318  }
319  }
320  }
321 
322  DestBits = (ULONG*)((ULONG_PTR)DestBits + wd);
323  }
324 
325  return TRUE;
326 }
#define TRUE
Definition: types.h:120
#define Y(i)
Definition: t_vb_render.c:49
_In_ SURFOBJ _In_ CLIPOBJ _In_opt_ XLATEOBJ _In_ RECTL _In_ RECTL _In_ ULONG iTransColor
Definition: winddi.h:4190
uint32_t ULONG_PTR
Definition: typedefs.h:63
long LONG
Definition: pedump.c:60
#define DIB_GetSourceIndex(SourceSurf, sx, sy)
Definition: dib.h:141
GLint GLint bottom
Definition: glext.h:7726
GLdouble GLdouble right
Definition: glext.h:10859
unsigned int ULONG
Definition: retypes.h:1
ENGAPI ULONG APIENTRY XLATEOBJ_iXlate(_In_ XLATEOBJ *pxlo, _In_ ULONG iColor)
Definition: xlateobj.c:664
BYTE * PBYTE
Definition: pedump.c:66
#define X(b, s)
VOID DIB_32BPP_VLine ( SURFOBJ ,
LONG  ,
LONG  ,
LONG  ,
ULONG   
)

Definition at line 35 of file dib32bpp.c.

36 {
37  PBYTE byteaddr = (PBYTE)SurfObj->pvScan0 + y1 * SurfObj->lDelta;
38  PDWORD addr = (PDWORD)byteaddr + x;
39  LONG lDelta = SurfObj->lDelta >> 2; // >> 2 == / sizeof(DWORD)
40 
41  byteaddr = (PBYTE)addr;
42  while (y1++ < y2)
43  {
44  *addr = (DWORD)c;
45  addr += lDelta;
46  }
47 }
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG _In_ LONG y1
Definition: winddi.h:3706
#define DWORD
Definition: msvc.h:34
long LONG
Definition: pedump.c:60
const GLubyte * c
Definition: glext.h:8905
GLenum const GLvoid * addr
Definition: glext.h:9621
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG _In_ LONG _In_ LONG _In_ LONG y2
Definition: winddi.h:3706
DWORD * PDWORD
Definition: pedump.c:68
BYTE * PBYTE
Definition: pedump.c:66
INT x
Definition: msvc.h:62
BOOLEAN DIB_4BPP_BitBlt ( PBLTINFO  )

Definition at line 222 of file dib4bpp.c.

223 {
224  LONG DestX, DestY;
225  LONG SourceX, SourceY;
226  LONG PatternY = 0;
227  ULONG Dest, Source = 0, Pattern = 0;
228  BOOLEAN UsesSource;
229  BOOLEAN UsesPattern;
230  PULONG DestBits;
231  LONG RoundedRight;
232  static const ULONG ExpandSolidColor[16] =
233  {
234  0x00000000 /* 0 */,
235  0x11111111 /* 1 */,
236  0x22222222 /* 2 */,
237  0x33333333 /* 3 */,
238  0x44444444 /* 4 */,
239  0x55555555 /* 5 */,
240  0x66666666 /* 6 */,
241  0x77777777 /* 7 */,
242  0x88888888 /* 8 */,
243  0x99999999 /* 9 */,
244  0xAAAAAAAA /* 10 */,
245  0xBBBBBBBB /* 11 */,
246  0xCCCCCCCC /* 12 */,
247  0xDDDDDDDD /* 13 */,
248  0xEEEEEEEE /* 14 */,
249  0xFFFFFFFF /* 15 */,
250  };
251 
252  UsesSource = ROP4_USES_SOURCE(BltInfo->Rop4);
253  UsesPattern = ROP4_USES_PATTERN(BltInfo->Rop4);
254 
255  SourceY = BltInfo->SourcePoint.y;
256  RoundedRight = BltInfo->DestRect.right -
257  ((BltInfo->DestRect.right - BltInfo->DestRect.left) & 0x7);
258 
259  if (UsesPattern)
260  {
261  if (BltInfo->PatternSurface)
262  {
263  PatternY = (BltInfo->DestRect.top + BltInfo->BrushOrigin.y) %
264  BltInfo->PatternSurface->sizlBitmap.cy;
265  }
266  else
267  {
268  if (BltInfo->Brush)
269  Pattern = ExpandSolidColor[BltInfo->Brush->iSolidColor];
270  }
271  }
272 
273  for (DestY = BltInfo->DestRect.top; DestY < BltInfo->DestRect.bottom; DestY++)
274  {
275  DestBits = (PULONG)(
276  (PBYTE)BltInfo->DestSurface->pvScan0 +
277  (BltInfo->DestRect.left >> 1) +
278  DestY * BltInfo->DestSurface->lDelta);
279  SourceX = BltInfo->SourcePoint.x;
280  DestX = BltInfo->DestRect.left;
281 
282  if (DestX & 0x1)
283  {
284  Dest = DIB_4BPP_GetPixel(BltInfo->DestSurface, DestX, DestY);
285 
286  if (UsesSource)
287  {
288  Source = DIB_GetSource(BltInfo->SourceSurface, SourceX, SourceY, BltInfo->XlateSourceToDest);
289  }
290 
291  if (BltInfo->PatternSurface)
292  {
293  Pattern = DIB_GetSourceIndex(BltInfo->PatternSurface, (DestX + BltInfo->BrushOrigin.x) % BltInfo->PatternSurface->sizlBitmap.cx, PatternY);
294  }
295 
296  DIB_4BPP_PutPixel(BltInfo->DestSurface, DestX, DestY, DIB_DoRop(BltInfo->Rop4, Dest, Source, Pattern) & 0xF);
297 
298  DestX++;
299  SourceX++;
300  DestBits = (PULONG)((ULONG_PTR)DestBits + 1);
301  }
302 
303  for (; DestX < RoundedRight; DestX += 8, SourceX += 8, DestBits++)
304  {
305  Dest = *DestBits;
306  if (UsesSource)
307  {
308  Source =
309  (DIB_GetSource(BltInfo->SourceSurface, SourceX + 1, SourceY, BltInfo->XlateSourceToDest)) |
310  (DIB_GetSource(BltInfo->SourceSurface, SourceX + 0, SourceY, BltInfo->XlateSourceToDest) << 4) |
311  (DIB_GetSource(BltInfo->SourceSurface, SourceX + 3, SourceY, BltInfo->XlateSourceToDest) << 8) |
312  (DIB_GetSource(BltInfo->SourceSurface, SourceX + 2, SourceY, BltInfo->XlateSourceToDest) << 12) |
313  (DIB_GetSource(BltInfo->SourceSurface, SourceX + 5, SourceY, BltInfo->XlateSourceToDest) << 16) |
314  (DIB_GetSource(BltInfo->SourceSurface, SourceX + 4, SourceY, BltInfo->XlateSourceToDest) << 20) |
315  (DIB_GetSource(BltInfo->SourceSurface, SourceX + 7, SourceY, BltInfo->XlateSourceToDest) << 24) |
316  (DIB_GetSource(BltInfo->SourceSurface, SourceX + 6, SourceY, BltInfo->XlateSourceToDest) << 28);
317  }
318  if (BltInfo->PatternSurface)
319  {
320  Pattern = DIB_GetSourceIndex(BltInfo->PatternSurface, (DestX + BltInfo->BrushOrigin.x + 1) % BltInfo->PatternSurface->sizlBitmap.cx, PatternY);
321  Pattern |= DIB_GetSourceIndex(BltInfo->PatternSurface, (DestX + BltInfo->BrushOrigin.x + 0) % BltInfo->PatternSurface->sizlBitmap.cx, PatternY) << 4;
322  Pattern |= DIB_GetSourceIndex(BltInfo->PatternSurface, (DestX + BltInfo->BrushOrigin.x + 3) % BltInfo->PatternSurface->sizlBitmap.cx, PatternY) << 8;
323  Pattern |= DIB_GetSourceIndex(BltInfo->PatternSurface, (DestX + BltInfo->BrushOrigin.x + 2) % BltInfo->PatternSurface->sizlBitmap.cx, PatternY) << 12;
324  Pattern |= DIB_GetSourceIndex(BltInfo->PatternSurface, (DestX + BltInfo->BrushOrigin.x + 5) % BltInfo->PatternSurface->sizlBitmap.cx, PatternY) << 16;
325  Pattern |= DIB_GetSourceIndex(BltInfo->PatternSurface, (DestX + BltInfo->BrushOrigin.x + 4) % BltInfo->PatternSurface->sizlBitmap.cx, PatternY) << 20;
326  Pattern |= DIB_GetSourceIndex(BltInfo->PatternSurface, (DestX + BltInfo->BrushOrigin.x + 7) % BltInfo->PatternSurface->sizlBitmap.cx, PatternY) << 24;
327  Pattern |= DIB_GetSourceIndex(BltInfo->PatternSurface, (DestX + BltInfo->BrushOrigin.x + 6) % BltInfo->PatternSurface->sizlBitmap.cx, PatternY) << 28;
328  }
329  *DestBits = DIB_DoRop(BltInfo->Rop4, Dest, Source, Pattern);
330  }
331 
332  /* Process the rest of pixel on the line */
333  for (; DestX < BltInfo->DestRect.right; DestX++, SourceX++)
334  {
335  Dest = DIB_4BPP_GetPixel(BltInfo->DestSurface, DestX, DestY);
336  if (UsesSource)
337  {
338  Source = DIB_GetSource(BltInfo->SourceSurface, SourceX, SourceY, BltInfo->XlateSourceToDest);
339  }
340  if (BltInfo->PatternSurface)
341  {
342  Pattern = DIB_GetSourceIndex(BltInfo->PatternSurface, (DestX + BltInfo->BrushOrigin.x) % BltInfo->PatternSurface->sizlBitmap.cx, PatternY);
343  }
344  DIB_4BPP_PutPixel(BltInfo->DestSurface, DestX, DestY, DIB_DoRop(BltInfo->Rop4, Dest, Source, Pattern) & 0xF);
345  }
346 
347  SourceY++;
348  if (BltInfo->PatternSurface)
349  {
350  PatternY++;
351  PatternY %= BltInfo->PatternSurface->sizlBitmap.cy;
352  }
353  }
354 
355  return TRUE;
356 }
#define TRUE
Definition: types.h:120
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG x1
Definition: winddi.h:3706
uint32_t ULONG_PTR
Definition: typedefs.h:63
#define DIB_GetSource(SourceSurf, sx, sy, ColorTranslation)
Definition: dib.h:136
long LONG
Definition: pedump.c:60
VOID DIB_4BPP_PutPixel(SURFOBJ *SurfObj, LONG x, LONG y, ULONG c)
Definition: dib4bpp.c:16
#define DIB_GetSourceIndex(SourceSurf, sx, sy)
Definition: dib.h:141
#define ROP4_USES_SOURCE(Rop4)
Definition: inteng.h:45
ULONG DIB_DoRop(ULONG Rop, ULONG Dest, ULONG Source, ULONG Pattern)
Definition: dib.c:92
unsigned char BOOLEAN
ULONG DIB_4BPP_GetPixel(SURFOBJ *SurfObj, LONG x, LONG y)
Definition: dib4bpp.c:23
#define ROP4_USES_PATTERN(Rop4)
Definition: inteng.h:46
unsigned int * PULONG
Definition: retypes.h:1
unsigned int ULONG
Definition: retypes.h:1
BYTE * PBYTE
Definition: pedump.c:66
BOOLEAN DIB_4BPP_BitBltSrcCopy ( PBLTINFO  )

Definition at line 60 of file dib4bpp.c.

61 {
62  LONG i, j, sx, sy, f2, xColor;
63  PBYTE SourceBits_24BPP, SourceLine_24BPP;
64  PBYTE DestBits, DestLine, SourceBits_8BPP, SourceLine_8BPP;
65  PBYTE SourceBits, SourceLine;
66 
67  DestBits = (PBYTE)BltInfo->DestSurface->pvScan0 +
68  (BltInfo->DestRect.left >> 1) +
69  BltInfo->DestRect.top * BltInfo->DestSurface->lDelta;
70 
71  switch (BltInfo->SourceSurface->iBitmapFormat)
72  {
73  case BMF_1BPP:
74  sx = BltInfo->SourcePoint.x;
75  sy = BltInfo->SourcePoint.y;
76 
77  for (j=BltInfo->DestRect.top; j<BltInfo->DestRect.bottom; j++)
78  {
79  sx = BltInfo->SourcePoint.x;
80  for (i=BltInfo->DestRect.left; i<BltInfo->DestRect.right; i++)
81  {
82  if(DIB_1BPP_GetPixel(BltInfo->SourceSurface, sx, sy) == 0)
83  {
84  DIB_4BPP_PutPixel(BltInfo->DestSurface, i, j, XLATEOBJ_iXlate(BltInfo->XlateSourceToDest, 0));
85  }
86  else
87  {
88  DIB_4BPP_PutPixel(BltInfo->DestSurface, i, j, XLATEOBJ_iXlate(BltInfo->XlateSourceToDest, 1));
89  }
90  sx++;
91  }
92  sy++;
93  }
94  break;
95 
96  case BMF_4BPP:
97  sy = BltInfo->SourcePoint.y;
98 
99  for (j=BltInfo->DestRect.top; j<BltInfo->DestRect.bottom; j++)
100  {
101  sx = BltInfo->SourcePoint.x;
102 
103  for (i=BltInfo->DestRect.left; i<BltInfo->DestRect.right; i++)
104  {
105  if (NULL != BltInfo->XlateSourceToDest)
106  {
107  DIB_4BPP_PutPixel(BltInfo->DestSurface, i, j, XLATEOBJ_iXlate(BltInfo->XlateSourceToDest, DIB_4BPP_GetPixel(BltInfo->SourceSurface, sx, sy)));
108  }
109  else
110  {
111  DIB_4BPP_PutPixel(BltInfo->DestSurface, i, j, DIB_4BPP_GetPixel(BltInfo->SourceSurface, sx, sy));
112  }
113  sx++;
114  }
115  sy++;
116  }
117  break;
118 
119  case BMF_8BPP:
120  SourceBits_8BPP = (PBYTE)BltInfo->SourceSurface->pvScan0 + (BltInfo->SourcePoint.y * BltInfo->SourceSurface->lDelta) + BltInfo->SourcePoint.x;
121 
122  for (j=BltInfo->DestRect.top; j<BltInfo->DestRect.bottom; j++)
123  {
124  SourceLine_8BPP = SourceBits_8BPP;
125  DestLine = DestBits;
126  f2 = BltInfo->DestRect.left & 1;
127 
128  for (i=BltInfo->DestRect.left; i<BltInfo->DestRect.right; i++)
129  {
130  *DestLine = (*DestLine & notmask[f2]) |
131  (BYTE)((XLATEOBJ_iXlate(BltInfo->XlateSourceToDest, *SourceLine_8BPP)) << ((4 * (1 - f2))));
132  if(f2 == 1) { DestLine++; f2 = 0; } else { f2 = 1; }
133  SourceLine_8BPP++;
134  }
135 
136  SourceBits_8BPP += BltInfo->SourceSurface->lDelta;
137  DestBits += BltInfo->DestSurface->lDelta;
138  }
139  break;
140 
141  case BMF_16BPP:
142  SourceLine = (PBYTE)BltInfo->SourceSurface->pvScan0 + (BltInfo->SourcePoint.y * BltInfo->SourceSurface->lDelta) + 2 * BltInfo->SourcePoint.x;
143  DestLine = DestBits;
144 
145  for (j = BltInfo->DestRect.top; j < BltInfo->DestRect.bottom; j++)
146  {
147  SourceBits = SourceLine;
148  DestBits = DestLine;
149  f2 = BltInfo->DestRect.left & 1;
150 
151  for (i = BltInfo->DestRect.left; i < BltInfo->DestRect.right; i++)
152  {
153  xColor = *((PWORD) SourceBits);
154  *DestBits = (*DestBits & notmask[f2]) |
155  (BYTE)((XLATEOBJ_iXlate(BltInfo->XlateSourceToDest, xColor)) << ((4 * (1 - f2))));
156  if(f2 == 1) { DestBits++; f2 = 0; } else { f2 = 1; }
157  SourceBits += 2;
158  }
159 
160  SourceLine += BltInfo->SourceSurface->lDelta;
161  DestLine += BltInfo->DestSurface->lDelta;
162  }
163  break;
164 
165  case BMF_24BPP:
166  SourceBits_24BPP = (PBYTE)BltInfo->SourceSurface->pvScan0 + (BltInfo->SourcePoint.y * BltInfo->SourceSurface->lDelta) + BltInfo->SourcePoint.x * 3;
167 
168  for (j=BltInfo->DestRect.top; j<BltInfo->DestRect.bottom; j++)
169  {
170  SourceLine_24BPP = SourceBits_24BPP;
171  DestLine = DestBits;
172  f2 = BltInfo->DestRect.left & 1;
173 
174  for (i=BltInfo->DestRect.left; i<BltInfo->DestRect.right; i++)
175  {
176  xColor = (*(SourceLine_24BPP + 2) << 0x10) +
177  (*(SourceLine_24BPP + 1) << 0x08) +
178  (*(SourceLine_24BPP));
179  *DestLine = (*DestLine & notmask[f2]) |
180  (BYTE)((XLATEOBJ_iXlate(BltInfo->XlateSourceToDest, xColor)) << ((4 * (1 - f2))));
181  if(f2 == 1) { DestLine++; f2 = 0; } else { f2 = 1; }
182  SourceLine_24BPP+=3;
183  }
184 
185  SourceBits_24BPP += BltInfo->SourceSurface->lDelta;
186  DestBits += BltInfo->DestSurface->lDelta;
187  }
188  break;
189 
190  case BMF_32BPP:
191  SourceLine = (PBYTE)BltInfo->SourceSurface->pvScan0 + (BltInfo->SourcePoint.y * BltInfo->SourceSurface->lDelta) + 4 * BltInfo->SourcePoint.x;
192  DestLine = DestBits;
193 
194  for (j = BltInfo->DestRect.top; j < BltInfo->DestRect.bottom; j++)
195  {
196  SourceBits = SourceLine;
197  DestBits = DestLine;
198  f2 = BltInfo->DestRect.left & 1;
199 
200  for (i = BltInfo->DestRect.left; i < BltInfo->DestRect.right; i++)
201  {
202  xColor = *((PDWORD) SourceBits);
203  *DestBits = (*DestBits & notmask[f2]) |
204  (BYTE)((XLATEOBJ_iXlate(BltInfo->XlateSourceToDest, xColor)) << ((4 * (1 - f2))));
205  if(f2 == 1) { DestBits++; f2 = 0; } else { f2 = 1; }
206  SourceBits += 4;
207  }
208 
209  SourceLine += BltInfo->SourceSurface->lDelta;
210  DestLine += BltInfo->DestSurface->lDelta;
211  }
212  break;
213 
214  default:
215  DbgPrint("DIB_4BPP_Bitblt: Unhandled Source BPP: %u\n", BitsPerFormat(BltInfo->SourceSurface->iBitmapFormat));
216  return FALSE;
217  }
218  return(TRUE);
219 }
#define BMF_24BPP
Definition: winddi.h:359
GLenum GLclampf GLint GLenum GLuint GLenum GLenum GLsizei GLenum const GLvoid GLfloat GLfloat GLfloat GLfloat GLclampd GLint 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 GLboolean GLboolean GLboolean GLint GLenum GLsizei const GLvoid GLenum GLint GLenum GLint GLint GLsizei GLint GLenum GLint GLint GLint GLint GLsizei GLenum GLsizei const GLuint GLboolean GLenum GLenum GLint GLsizei GLenum GLsizei GLenum const GLvoid GLboolean const GLboolean GLenum const GLdouble const GLfloat const GLdouble const GLfloat GLenum GLint GLint GLint GLint GLint GLint j
Definition: glfuncs.h:98
#define TRUE
Definition: types.h:120
#define BMF_32BPP
Definition: winddi.h:360
#define DbgPrint
Definition: loader.c:26
#define BitsPerFormat(Format)
Definition: surface.h:102
Definition: xlate.c:8
GLenum GLclampf GLint i
Definition: glfuncs.h:14
#define FALSE
Definition: types.h:117
long LONG
Definition: pedump.c:60
VOID DIB_4BPP_PutPixel(SURFOBJ *SurfObj, LONG x, LONG y, ULONG c)
Definition: dib4bpp.c:16
smooth NULL
Definition: ftsmooth.c:557
unsigned char notmask[2]
Definition: dib.c:17
#define BMF_16BPP
Definition: winddi.h:358
WORD * PWORD
Definition: pedump.c:67
ULONG DIB_4BPP_GetPixel(SURFOBJ *SurfObj, LONG x, LONG y)
Definition: dib4bpp.c:23
ULONG DIB_1BPP_GetPixel(SURFOBJ *, LONG, LONG)
Definition: dib1bpp.c:26
unsigned char BYTE
Definition: ntddk_ex.h:96
Definition: xlate.c:9
Definition: xlate.c:10
DWORD * PDWORD
Definition: pedump.c:68
ENGAPI ULONG APIENTRY XLATEOBJ_iXlate(_In_ XLATEOBJ *pxlo, _In_ ULONG iColor)
Definition: xlateobj.c:664
int f2(S1 &, S2 &)
BYTE * PBYTE
Definition: pedump.c:66
BOOLEAN DIB_4BPP_ColorFill ( SURFOBJ ,
RECTL ,
ULONG   
)

Definition at line 360 of file dib4bpp.c.

361 {
362  LONG DestY;
363 
364  for (DestY = DestRect->top; DestY < DestRect->bottom; DestY++)
365  {
366  DIB_4BPP_HLine(DestSurface, DestRect->left, DestRect->right, DestY, color);
367  }
368  return TRUE;
369 }
#define TRUE
Definition: types.h:120
VOID DIB_4BPP_HLine(SURFOBJ *SurfObj, LONG x1, LONG x2, LONG y, ULONG c)
Definition: dib4bpp.c:30
long LONG
Definition: pedump.c:60
GLuint color
Definition: glext.h:6243
GLint GLint bottom
Definition: glext.h:7726
ULONG DIB_4BPP_GetPixel ( SURFOBJ ,
LONG  ,
LONG   
)

Definition at line 23 of file dib4bpp.c.

Referenced by DIB_1BPP_BitBltSrcCopy(), DIB_4BPP_BitBlt(), and DIB_4BPP_BitBltSrcCopy().

24 {
25  PBYTE addr = (PBYTE)SurfObj->pvScan0 + (x>>1) + y * SurfObj->lDelta;
26  return (*addr >> ((1-(x&1))<<2)) & 0x0f;
27 }
GLenum const GLvoid * addr
Definition: glext.h:9621
INT INT y
Definition: msvc.h:62
BYTE * PBYTE
Definition: pedump.c:66
INT x
Definition: msvc.h:62
VOID DIB_4BPP_HLine ( SURFOBJ ,
LONG  ,
LONG  ,
LONG  ,
ULONG   
)

Definition at line 30 of file dib4bpp.c.

Referenced by DIB_4BPP_ColorFill().

31 {
32  PBYTE addr = (PBYTE)SurfObj->pvScan0 + (x1>>1) + y * SurfObj->lDelta;
33  LONG cx = x1;
34 
35  while(cx < x2)
36  {
37  *addr = (*addr & notmask[x1&1]) | (BYTE)(c << ((1-(x1&1))<<2));
38  if((++x1 & 1) == 0)
39  ++addr;
40  ++cx;
41  }
42 }
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG x1
Definition: winddi.h:3706
long LONG
Definition: pedump.c:60
unsigned char notmask[2]
Definition: dib.c:17
const GLubyte * c
Definition: glext.h:8905
GLenum const GLvoid * addr
Definition: glext.h:9621
unsigned char BYTE
Definition: ntddk_ex.h:96
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG _In_ LONG _In_ LONG x2
Definition: winddi.h:3706
_Out_opt_ int * cx
Definition: commctrl.h:570
INT INT y
Definition: msvc.h:62
BYTE * PBYTE
Definition: pedump.c:66
VOID DIB_4BPP_PutPixel ( SURFOBJ ,
LONG  ,
LONG  ,
ULONG   
)

Definition at line 16 of file dib4bpp.c.

Referenced by DIB_4BPP_BitBlt(), and DIB_4BPP_BitBltSrcCopy().

17 {
18  PBYTE addr = (PBYTE)SurfObj->pvScan0 + (x>>1) + y * SurfObj->lDelta;
19  *addr = (*addr & notmask[x&1]) | (BYTE)(c << ((1-(x&1))<<2));
20 }
unsigned char notmask[2]
Definition: dib.c:17
const GLubyte * c
Definition: glext.h:8905
GLenum const GLvoid * addr
Definition: glext.h:9621
unsigned char BYTE
Definition: ntddk_ex.h:96
INT INT y
Definition: msvc.h:62
BYTE * PBYTE
Definition: pedump.c:66
INT x
Definition: msvc.h:62
BOOLEAN DIB_4BPP_TransparentBlt ( SURFOBJ ,
SURFOBJ ,
RECTL ,
RECTL ,
XLATEOBJ ,
ULONG   
)

Definition at line 373 of file dib4bpp.c.

376 {
377  return FALSE;
378 }
#define FALSE
Definition: types.h:117
VOID DIB_4BPP_VLine ( SURFOBJ ,
LONG  ,
LONG  ,
LONG  ,
ULONG   
)

Definition at line 45 of file dib4bpp.c.

46 {
47  PBYTE addr = SurfObj->pvScan0;
48  int lDelta = SurfObj->lDelta;
49 
50  addr += (x>>1) + y1 * lDelta;
51  while(y1++ < y2)
52  {
53  *addr = (*addr & notmask[x&1]) | (BYTE)(c << ((1-(x&1))<<2));
54  addr += lDelta;
55  }
56 }
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG _In_ LONG y1
Definition: winddi.h:3706
unsigned char notmask[2]
Definition: dib.c:17
const GLubyte * c
Definition: glext.h:8905
GLenum const GLvoid * addr
Definition: glext.h:9621
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG _In_ LONG _In_ LONG _In_ LONG y2
Definition: winddi.h:3706
unsigned char BYTE
Definition: ntddk_ex.h:96
BYTE * PBYTE
Definition: pedump.c:66
INT x
Definition: msvc.h:62
BOOLEAN DIB_8BPP_BitBlt ( PBLTINFO  )
BOOLEAN DIB_8BPP_BitBltSrcCopy ( PBLTINFO  )

Definition at line 55 of file dib8bpp.c.

56 {
57  LONG i, j, sx, sy, xColor, f1;
58  PBYTE SourceBits, DestBits, SourceLine, DestLine;
59  PBYTE SourceBits_4BPP, SourceLine_4BPP;
60 
61  DestBits = (PBYTE)BltInfo->DestSurface->pvScan0 + (BltInfo->DestRect.top * BltInfo->DestSurface->lDelta) + BltInfo->DestRect.left;
62 
63  switch(BltInfo->SourceSurface->iBitmapFormat)
64  {
65  case BMF_1BPP:
66  sx = BltInfo->SourcePoint.x;
67  sy = BltInfo->SourcePoint.y;
68 
69  for (j=BltInfo->DestRect.top; j<BltInfo->DestRect.bottom; j++)
70  {
71  sx = BltInfo->SourcePoint.x;
72  for (i=BltInfo->DestRect.left; i<BltInfo->DestRect.right; i++)
73  {
74  if(DIB_1BPP_GetPixel(BltInfo->SourceSurface, sx, sy) == 0)
75  {
76  DIB_8BPP_PutPixel(BltInfo->DestSurface, i, j, XLATEOBJ_iXlate(BltInfo->XlateSourceToDest, 0));
77  }
78  else
79  {
80  DIB_8BPP_PutPixel(BltInfo->DestSurface, i, j, XLATEOBJ_iXlate(BltInfo->XlateSourceToDest, 1));
81  }
82  sx++;
83  }
84  sy++;
85  }
86  break;
87 
88  case BMF_4BPP:
89  SourceBits_4BPP = (PBYTE)BltInfo->SourceSurface->pvScan0 + (BltInfo->SourcePoint.y * BltInfo->SourceSurface->lDelta) + (BltInfo->SourcePoint.x >> 1);
90 
91  for (j=BltInfo->DestRect.top; j<BltInfo->DestRect.bottom; j++)
92  {
93  SourceLine_4BPP = SourceBits_4BPP;
94  sx = BltInfo->SourcePoint.x;
95  f1 = sx & 1;
96 
97  for (i=BltInfo->DestRect.left; i<BltInfo->DestRect.right; i++)
98  {
99  xColor = XLATEOBJ_iXlate(BltInfo->XlateSourceToDest,
100  (*SourceLine_4BPP & altnotmask[f1]) >> (4 * (1 - f1)));
101  DIB_8BPP_PutPixel(BltInfo->DestSurface, i, j, xColor);
102  if(f1 == 1) { SourceLine_4BPP++; f1 = 0; } else { f1 = 1; }
103  sx++;
104  }
105 
106  SourceBits_4BPP += BltInfo->SourceSurface->lDelta;
107  }
108  break;
109 
110  case BMF_8BPP:
111  if (NULL == BltInfo->XlateSourceToDest || 0 != (BltInfo->XlateSourceToDest->flXlate & XO_TRIVIAL))
112  {
113  if (BltInfo->DestRect.top < BltInfo->SourcePoint.y)
114  {
115  SourceBits = (PBYTE)BltInfo->SourceSurface->pvScan0 + (BltInfo->SourcePoint.y * BltInfo->SourceSurface->lDelta) + BltInfo->SourcePoint.x;
116  for (j = BltInfo->DestRect.top; j < BltInfo->DestRect.bottom; j++)
117  {
118  RtlMoveMemory(DestBits, SourceBits, BltInfo->DestRect.right - BltInfo->DestRect.left);
119  SourceBits += BltInfo->SourceSurface->lDelta;
120  DestBits += BltInfo->DestSurface->lDelta;
121  }
122  }
123  else
124  {
125  SourceBits = (PBYTE)BltInfo->SourceSurface->pvScan0 + ((BltInfo->SourcePoint.y + BltInfo->DestRect.bottom - BltInfo->DestRect.top - 1) * BltInfo->SourceSurface->lDelta) + BltInfo->SourcePoint.x;
126  DestBits = (PBYTE)BltInfo->DestSurface->pvScan0 + ((BltInfo->DestRect.bottom - 1) * BltInfo->DestSurface->lDelta) + BltInfo->DestRect.left;
127  for (j = BltInfo->DestRect.bottom - 1; BltInfo->DestRect.top <= j; j--)
128  {
129  RtlMoveMemory(DestBits, SourceBits, BltInfo->DestRect.right - BltInfo->DestRect.left);
130  SourceBits -= BltInfo->SourceSurface->lDelta;
131  DestBits -= BltInfo->DestSurface->lDelta;
132  }
133  }
134  }
135  else
136  {
137  if (BltInfo->DestRect.top < BltInfo->SourcePoint.y)
138  {
139  SourceLine = (PBYTE)BltInfo->SourceSurface->pvScan0 + (BltInfo->SourcePoint.y * BltInfo->SourceSurface->lDelta) + BltInfo->SourcePoint.x;
140  DestLine = DestBits;
141  for (j = BltInfo->DestRect.top; j < BltInfo->DestRect.bottom; j++)
142  {
143  SourceBits = SourceLine;
144  DestBits = DestLine;
145  for (i=BltInfo->DestRect.left; i<BltInfo->DestRect.right; i++)
146  {
147  *DestBits++ = (BYTE)XLATEOBJ_iXlate(BltInfo->XlateSourceToDest, *SourceBits++);
148  }
149  SourceLine += BltInfo->SourceSurface->lDelta;
150  DestLine += BltInfo->DestSurface->lDelta;
151  }
152  }
153  else
154  {
155  SourceLine = (PBYTE)BltInfo->SourceSurface->pvScan0 + ((BltInfo->SourcePoint.y + BltInfo->DestRect.bottom - BltInfo->DestRect.top - 1) * BltInfo->SourceSurface->lDelta) + BltInfo->SourcePoint.x;
156  DestLine = (PBYTE)BltInfo->DestSurface->pvScan0 + ((BltInfo->DestRect.bottom - 1) * BltInfo->DestSurface->lDelta) + BltInfo->DestRect.left;
157  for (j = BltInfo->DestRect.bottom - 1; BltInfo->DestRect.top <= j; j--)
158  {
159  SourceBits = SourceLine;
160  DestBits = DestLine;
161  for (i=BltInfo->DestRect.left; i<BltInfo->DestRect.right; i++)
162  {
163  *DestBits++ = (BYTE)XLATEOBJ_iXlate(BltInfo->XlateSourceToDest, *SourceBits++);
164  }
165  SourceLine -= BltInfo->SourceSurface->lDelta;
166  DestLine -= BltInfo->DestSurface->lDelta;
167  }
168  }
169  }
170  break;
171 
172  case BMF_16BPP:
173  SourceLine = (PBYTE)BltInfo->SourceSurface->pvScan0 + (BltInfo->SourcePoint.y * BltInfo->SourceSurface->lDelta) + 2 * BltInfo->SourcePoint.x;
174  DestLine = DestBits;
175 
176  for (j = BltInfo->DestRect.top; j < BltInfo->DestRect.bottom; j++)
177  {
178  SourceBits = SourceLine;
179  DestBits = DestLine;
180 
181  for (i = BltInfo->DestRect.left; i < BltInfo->DestRect.right; i++)
182  {
183  xColor = *((PWORD) SourceBits);
184  *DestBits = (BYTE)XLATEOBJ_iXlate(BltInfo->XlateSourceToDest, xColor);
185  SourceBits += 2;
186  DestBits += 1;
187  }
188 
189  SourceLine += BltInfo->SourceSurface->lDelta;
190  DestLine += BltInfo->DestSurface->lDelta;
191  }
192  break;
193 
194  case BMF_24BPP:
195  SourceLine = (PBYTE)BltInfo->SourceSurface->pvScan0 + (BltInfo->SourcePoint.y * BltInfo->SourceSurface->lDelta) + 3 * BltInfo->SourcePoint.x;
196  DestLine = DestBits;
197 
198  for (j = BltInfo->DestRect.top; j < BltInfo->DestRect.bottom; j++)
199  {
200  SourceBits = SourceLine;
201  DestBits = DestLine;
202 
203  for (i = BltInfo->DestRect.left; i < BltInfo->DestRect.right; i++)
204  {
205  xColor = (*(SourceBits + 2) << 0x10) +
206  (*(SourceBits + 1) << 0x08) +
207  (*(SourceBits));
208  *DestBits = (BYTE)XLATEOBJ_iXlate(BltInfo->XlateSourceToDest, xColor);
209  SourceBits += 3;
210  DestBits += 1;
211  }
212 
213  SourceLine += BltInfo->SourceSurface->lDelta;
214  DestLine += BltInfo->DestSurface->lDelta;
215  }
216  break;
217 
218  case BMF_32BPP:
219  SourceLine = (PBYTE)BltInfo->SourceSurface->pvScan0 + (BltInfo->SourcePoint.y * BltInfo->SourceSurface->lDelta) + 4 * BltInfo->SourcePoint.x;
220  DestLine = DestBits;
221 
222  for (j = BltInfo->DestRect.top; j < BltInfo->DestRect.bottom; j++)
223  {
224  SourceBits = SourceLine;
225  DestBits = DestLine;
226 
227  for (i = BltInfo->DestRect.left; i < BltInfo->DestRect.right; i++)
228  {
229  xColor = *((PDWORD) SourceBits);
230  *DestBits = (BYTE)XLATEOBJ_iXlate(BltInfo->XlateSourceToDest, xColor);
231  SourceBits += 4;
232  DestBits += 1;
233  }
234 
235  SourceLine += BltInfo->SourceSurface->lDelta;
236  DestLine += BltInfo->DestSurface->lDelta;
237  }
238  break;
239 
240  default:
241  DPRINT1("DIB_8BPP_Bitblt: Unhandled Source BPP: %u\n", BitsPerFormat(BltInfo->SourceSurface->iBitmapFormat));
242  return FALSE;
243  }
244 
245  return TRUE;
246 }
#define BMF_24BPP
Definition: winddi.h:359
GLenum GLclampf GLint GLenum GLuint GLenum GLenum GLsizei GLenum const GLvoid GLfloat GLfloat GLfloat GLfloat GLclampd GLint 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 GLboolean GLboolean GLboolean GLint GLenum GLsizei const GLvoid GLenum GLint GLenum GLint GLint GLsizei GLint GLenum GLint GLint GLint GLint GLsizei GLenum GLsizei const GLuint GLboolean GLenum GLenum GLint GLsizei GLenum GLsizei GLenum const GLvoid GLboolean const GLboolean GLenum const GLdouble const GLfloat const GLdouble const GLfloat GLenum GLint GLint GLint GLint GLint GLint j
Definition: glfuncs.h:98
#define TRUE
Definition: types.h:120
VOID DIB_8BPP_PutPixel(SURFOBJ *SurfObj, LONG x, LONG y, ULONG c)
Definition: dib8bpp.c:17
#define BMF_32BPP
Definition: winddi.h:360
unsigned char altnotmask[2]
Definition: dib.c:18
#define BitsPerFormat(Format)
Definition: surface.h:102
Definition: xlate.c:8
#define RtlMoveMemory(Destination, Source, Length)
Definition: typedefs.h:263
GLenum GLclampf GLint i
Definition: glfuncs.h:14
#define FALSE
Definition: types.h:117
long LONG
Definition: pedump.c:60
smooth NULL
Definition: ftsmooth.c:557
#define BMF_16BPP
Definition: winddi.h:358
WORD * PWORD
Definition: pedump.c:67
ULONG DIB_1BPP_GetPixel(SURFOBJ *, LONG, LONG)
Definition: dib1bpp.c:26
#define XO_TRIVIAL
Definition: winddi.h:1247
unsigned char BYTE
Definition: ntddk_ex.h:96
#define f1(x, y, z)
Definition: sha1.c:30
Definition: xlate.c:9
Definition: xlate.c:10
DWORD * PDWORD
Definition: pedump.c:68
#define DPRINT1
Definition: precomp.h:8
ENGAPI ULONG APIENTRY XLATEOBJ_iXlate(_In_ XLATEOBJ *pxlo, _In_ ULONG iColor)
Definition: xlateobj.c:664
BYTE * PBYTE
Definition: pedump.c:66
BOOLEAN DIB_8BPP_ColorFill ( SURFOBJ ,
RECTL ,
ULONG   
)

Definition at line 250 of file dib8bpp.c.

251 {
252  LONG DestY;
253  for (DestY = DestRect->top; DestY< DestRect->bottom; DestY++)
254  {
255  DIB_8BPP_HLine(DestSurface, DestRect->left, DestRect->right, DestY, color);
256  }
257  return TRUE;
258 }
#define TRUE
Definition: types.h:120
VOID DIB_8BPP_HLine(SURFOBJ *SurfObj, LONG x1, LONG x2, LONG y, ULONG c)
Definition: dib8bpp.c:33
long LONG
Definition: pedump.c:60
GLuint color
Definition: glext.h:6243
GLint GLint bottom
Definition: glext.h:7726
ULONG DIB_8BPP_GetPixel ( SURFOBJ ,
LONG  ,
LONG   
)

Definition at line 25 of file dib8bpp.c.

Referenced by DIB_1BPP_BitBltSrcCopy().

26 {
27  PBYTE byteaddr = (PBYTE)SurfObj->pvScan0 + y * SurfObj->lDelta + x;
28 
29  return (ULONG)(*byteaddr);
30 }
return(0)
unsigned int ULONG
Definition: retypes.h:1
INT INT y
Definition: msvc.h:62
BYTE * PBYTE
Definition: pedump.c:66
INT x
Definition: msvc.h:62
VOID DIB_8BPP_HLine ( SURFOBJ ,
LONG  ,
LONG  ,
LONG  ,
ULONG   
)

Definition at line 33 of file dib8bpp.c.

Referenced by DIB_8BPP_ColorFill().

34 {
35  memset((PBYTE)SurfObj->pvScan0 + y * SurfObj->lDelta + x1, (BYTE) c, x2 - x1);
36 }
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG x1
Definition: winddi.h:3706
const GLubyte * c
Definition: glext.h:8905
unsigned char BYTE
Definition: ntddk_ex.h:96
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG _In_ LONG _In_ LONG x2
Definition: winddi.h:3706
INT INT y
Definition: msvc.h:62
#define memset(x, y, z)
Definition: compat.h:39
BYTE * PBYTE
Definition: pedump.c:66
VOID DIB_8BPP_PutPixel ( SURFOBJ ,
LONG  ,
LONG  ,
ULONG   
)

Definition at line 17 of file dib8bpp.c.

Referenced by DIB_8BPP_BitBltSrcCopy().

18 {
19  PBYTE byteaddr = (PBYTE)SurfObj->pvScan0 + y * SurfObj->lDelta + x;
20 
21  *byteaddr = (BYTE)c;
22 }
unsigned char BYTE
Definition: ntddk_ex.h:96
#define c
Definition: ke_i.h:80
INT INT y
Definition: msvc.h:62
BYTE * PBYTE
Definition: pedump.c:66
INT x
Definition: msvc.h:62
BOOLEAN DIB_8BPP_TransparentBlt ( SURFOBJ ,
SURFOBJ ,
RECTL ,
RECTL ,
XLATEOBJ ,
ULONG   
)

Definition at line 262 of file dib8bpp.c.

265 {
266  LONG RoundedRight, X, Y, SourceX = 0, SourceY = 0;
267  ULONG *DestBits, Source, Dest;
268 
269  LONG DstHeight;
270  LONG DstWidth;
271  LONG SrcHeight;
272  LONG SrcWidth;
273 
274  DstHeight = DestRect->bottom - DestRect->top;
275  DstWidth = DestRect->right - DestRect->left;
276  SrcHeight = SourceRect->bottom - SourceRect->top;
277  SrcWidth = SourceRect->right - SourceRect->left;
278 
279  RoundedRight = DestRect->right - ((DestRect->right - DestRect->left) & 0x3);
280  DestBits = (ULONG*)((PBYTE)DestSurf->pvScan0 + DestRect->left +
281  (DestRect->top * DestSurf->lDelta));
282 
283  for(Y = DestRect->top; Y < DestRect->bottom; Y++)
284  {
285  DestBits = (ULONG*)((PBYTE)DestSurf->pvScan0 + DestRect->left +
286  (Y * DestSurf->lDelta));
287  SourceY = SourceRect->top+(Y - DestRect->top) * SrcHeight / DstHeight;
288  for (X = DestRect->left; X < RoundedRight; X += 4, DestBits++)
289  {
290  Dest = *DestBits;
291 
292  SourceX = SourceRect->left+(X - DestRect->left) * SrcWidth / DstWidth;
293  if (SourceX >= 0 && SourceY >= 0 &&
294  SourceSurf->sizlBitmap.cx > SourceX && SourceSurf->sizlBitmap.cy > SourceY)
295  {
296  Source = DIB_GetSourceIndex(SourceSurf, SourceX, SourceY);
297  if(Source != iTransColor)
298  {
299  Dest &= 0xFFFFFF00;
300  Dest |= (XLATEOBJ_iXlate(ColorTranslation, Source) & 0xFF);
301  }
302  }
303 
304  SourceX = SourceRect->left+(X+1 - DestRect->left) * SrcWidth / DstWidth;
305  if (SourceX >= 0 && SourceY >= 0 &&
306  SourceSurf->sizlBitmap.cx > SourceX && SourceSurf->sizlBitmap.cy > SourceY)
307  {
308  Source = DIB_GetSourceIndex(SourceSurf, SourceX, SourceY);
309  if(Source != iTransColor)
310  {
311  Dest &= 0xFFFF00FF;
312  Dest |= ((XLATEOBJ_iXlate(ColorTranslation, Source) << 8) & 0xFF00);
313  }
314  }
315 
316  SourceX = SourceRect->left+(X+2 - DestRect->left) * SrcWidth / DstWidth;
317  if (SourceX >= 0 && SourceY >= 0 &&
318  SourceSurf->sizlBitmap.cx > SourceX && SourceSurf->sizlBitmap.cy > SourceY)
319  {
320  Source = DIB_GetSourceIndex(SourceSurf, SourceX, SourceY);
321  if(Source != iTransColor)
322  {
323  Dest &= 0xFF00FFFF;
324  Dest |= ((XLATEOBJ_iXlate(ColorTranslation, Source) << 16) & 0xFF0000);
325  }
326  }
327 
328  SourceX = SourceRect->left+(X+3 - DestRect->left) * SrcWidth / DstWidth;
329  if (SourceX >= 0 && SourceY >= 0 &&
330  SourceSurf->sizlBitmap.cx > SourceX && SourceSurf->sizlBitmap.cy > SourceY)
331  {
332  Source = DIB_GetSourceIndex(SourceSurf, SourceX, SourceY);
333  if(Source != iTransColor)
334  {
335  Dest &= 0x00FFFFFF;
336  Dest |= ((XLATEOBJ_iXlate(ColorTranslation, Source) << 24) & 0xFF000000);
337  }
338  }
339 
340  *DestBits = Dest;
341  }
342 
344  {
345  for (; X < DestRect->right; X++)
346  {
347  SourceX = SourceRect->left+(X - DestRect->left) * SrcWidth / DstWidth;
348  if (SourceX >= 0 && SourceY >= 0 &&
349  SourceSurf->sizlBitmap.cx > SourceX && SourceSurf->sizlBitmap.cy > SourceY)
350  {
351  Source = DIB_GetSourceIndex(SourceSurf, SourceX, SourceY);
352  if(Source != iTransColor)
353  {
354  *((BYTE*)DestBits) = (BYTE)(XLATEOBJ_iXlate(ColorTranslation, Source) & 0xFF);
355  }
356  }
357  DestBits = (PULONG)((ULONG_PTR)DestBits + 1);
358  }
359  }
360  }
361 
362  return TRUE;
363 }
#define TRUE
Definition: types.h:120
VOID * Source
Definition: acefiex.h:744
#define Y(i)
Definition: t_vb_render.c:49
_In_ SURFOBJ _In_ CLIPOBJ _In_opt_ XLATEOBJ _In_ RECTL _In_ RECTL _In_ ULONG iTransColor
Definition: winddi.h:4190
uint32_t ULONG_PTR
Definition: typedefs.h:63
long LONG
Definition: pedump.c:60
#define DIB_GetSourceIndex(SourceSurf, sx, sy)
Definition: dib.h:141
GLint GLint bottom
Definition: glext.h:7726
GLdouble GLdouble right
Definition: glext.h:10859
unsigned char BYTE
Definition: ntddk_ex.h:96
unsigned int * PULONG
Definition: retypes.h:1
unsigned int ULONG
Definition: retypes.h:1
ENGAPI ULONG APIENTRY XLATEOBJ_iXlate(_In_ XLATEOBJ *pxlo, _In_ ULONG iColor)
Definition: xlateobj.c:664
BYTE * PBYTE
Definition: pedump.c:66
#define X(b, s)
VOID DIB_8BPP_VLine ( SURFOBJ ,
LONG  ,
LONG  ,
LONG  ,
ULONG   
)

Definition at line 39 of file dib8bpp.c.

40 {
41  PBYTE byteaddr = (PBYTE)SurfObj->pvScan0 + y1 * SurfObj->lDelta;
42  PBYTE addr = byteaddr + x;
43  LONG lDelta = SurfObj->lDelta;
44 
45  byteaddr = addr;
46  while(y1++ < y2)
47  {
48  *addr = (BYTE)c;
49 
50  addr += lDelta;
51  }
52 }
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG _In_ LONG y1
Definition: winddi.h:3706
long LONG
Definition: pedump.c:60
const GLubyte * c
Definition: glext.h:8905
GLenum const GLvoid * addr
Definition: glext.h:9621
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG _In_ LONG _In_ LONG _In_ LONG y2
Definition: winddi.h:3706
unsigned char BYTE
Definition: ntddk_ex.h:96
BYTE * PBYTE
Definition: pedump.c:66
INT x
Definition: msvc.h:62
ULONG DIB_DoRop ( ULONG  Rop,
ULONG  Dest,
ULONG  Source,
ULONG  Pattern 
)

Definition at line 92 of file dib.c.

Referenced by BltMask(), DIB_1BPP_BitBlt(), DIB_24BPP_BitBlt(), DIB_4BPP_BitBlt(), and DIB_XXBPP_StretchBlt().

93 {
94  ULONG ResultNibble;
95  ULONG Result = 0;
96  ULONG i;
97 static const ULONG ExpandDest[16] =
98  {
99  0x55555555 /* 0000 */,
100  0x555555AA /* 0001 */,
101  0x5555AA55 /* 0010 */,
102  0x5555AAAA /* 0011 */,
103  0x55AA5555 /* 0100 */,
104  0x55AA55AA /* 0101 */,
105  0x55AAAA55 /* 0110 */,
106  0x55AAAAAA /* 0111 */,
107  0xAA555555 /* 1000 */,
108  0xAA5555AA /* 1001 */,
109  0xAA55AA55 /* 1010 */,
110  0xAA55AAAA /* 1011 */,
111  0xAAAA5555 /* 1100 */,
112  0xAAAA55AA /* 1101 */,
113  0xAAAAAA55 /* 1110 */,
114  0xAAAAAAAA /* 1111 */,
115  };
116  static const ULONG ExpandSource[16] =
117  {
118  0x33333333 /* 0000 */,
119  0x333333CC /* 0001 */,
120  0x3333CC33 /* 0010 */,
121  0x3333CCCC /* 0011 */,
122  0x33CC3333 /* 0100 */,
123  0x33CC33CC /* 0101 */,
124  0x33CCCC33 /* 0110 */,
125  0x33CCCCCC /* 0111 */,
126  0xCC333333 /* 1000 */,
127  0xCC3333CC /* 1001 */,
128  0xCC33CC33 /* 1010 */,
129  0xCC33CCCC /* 1011 */,
130  0xCCCC3333 /* 1100 */,
131  0xCCCC33CC /* 1101 */,
132  0xCCCCCC33 /* 1110 */,
133  0xCCCCCCCC /* 1111 */,
134  };
135  static const ULONG ExpandPattern[16] =
136  {
137  0x0F0F0F0F /* 0000 */,
138  0x0F0F0FF0 /* 0001 */,
139  0x0F0FF00F /* 0010 */,
140  0x0F0FF0F0 /* 0011 */,
141  0x0FF00F0F /* 0100 */,
142  0x0FF00FF0 /* 0101 */,
143  0x0FF0F00F /* 0110 */,
144  0x0FF0F0F0 /* 0111 */,
145  0xF00F0F0F /* 1000 */,
146  0xF00F0FF0 /* 1001 */,
147  0xF00FF00F /* 1010 */,
148  0xF00FF0F0 /* 1011 */,
149  0xF0F00F0F /* 1100 */,
150  0xF0F00FF0 /* 1101 */,
151  0xF0F0F00F /* 1110 */,
152  0xF0F0F0F0 /* 1111 */,
153  };
154 
155  Rop &=0xFF;
156  switch(Rop)
157  {
158 
159  /* Optimized code for the various named rop codes. */
160  case R3_OPINDEX_NOOP: return(Dest);
161  case R3_OPINDEX_BLACKNESS: return(0);
162  case R3_OPINDEX_NOTSRCERASE: return(~(Dest | Source));
163  case R3_OPINDEX_NOTSRCCOPY: return(~Source);
164  case R3_OPINDEX_SRCERASE: return((~Dest) & Source);
165  case R3_OPINDEX_DSTINVERT: return(~Dest);
166  case R3_OPINDEX_PATINVERT: return(Dest ^ Pattern);
167  case R3_OPINDEX_SRCINVERT: return(Dest ^ Source);
168  case R3_OPINDEX_SRCAND: return(Dest & Source);
169  case R3_OPINDEX_MERGEPAINT: return(Dest | (~Source));
170  case R3_OPINDEX_SRCPAINT: return(Dest | Source);
171  case R3_OPINDEX_MERGECOPY: return(Source & Pattern);
172  case R3_OPINDEX_SRCCOPY: return(Source);
173  case R3_OPINDEX_PATCOPY: return(Pattern);
174  case R3_OPINDEX_PATPAINT: return(Dest | (~Source) | Pattern);
175  case R3_OPINDEX_WHITENESS: return(0xFFFFFFFF);
176  }
177 
178  /* Expand the ROP operation to all four bytes */
179  Rop |= (Rop << 24) | (Rop << 16) | (Rop << 8);
180  /* Do the operation on four bits simultaneously. */
181  Result = 0;
182  for (i = 0; i < 8; i++)
183  {
184  ResultNibble = Rop & ExpandDest[Dest & 0xF] & ExpandSource[Source & 0xF] & ExpandPattern[Pattern & 0xF];
185  Result |= (((ResultNibble & 0xFF000000) ? 0x8 : 0x0) | ((ResultNibble & 0x00FF0000) ? 0x4 : 0x0) |
186  ((ResultNibble & 0x0000FF00) ? 0x2 : 0x0) | ((ResultNibble & 0x000000FF) ? 0x1 : 0x0)) << (i * 4);
187  Dest >>= 4;
188  Source >>= 4;
189  Pattern >>= 4;
190  }
191  return(Result);
192 }
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG x1
Definition: winddi.h:3706
_At_(*)(_In_ PWSK_CLIENT Client, _In_opt_ PUNICODE_STRING NodeName, _In_opt_ PUNICODE_STRING ServiceName, _In_opt_ ULONG NameSpace, _In_opt_ GUID *Provider, _In_opt_ PADDRINFOEXW Hints, _Outptr_ PADDRINFOEXW *Result, _In_opt_ PEPROCESS OwningProcess, _In_opt_ PETHREAD OwningThread, _Inout_ PIRP Irp Result)(Mem)) NTSTATUS(WSKAPI *PFN_WSK_GET_ADDRESS_INFO
Definition: wsk.h:426
GLenum GLclampf GLint i
Definition: glfuncs.h:14
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG _In_ LONG _In_ LONG x2
Definition: winddi.h:3706
unsigned int ULONG
Definition: retypes.h:1
BOOLEAN DIB_XXBPP_AlphaBlend ( SURFOBJ ,
SURFOBJ ,
RECTL ,
RECTL ,
CLIPOBJ ,
XLATEOBJ ,
BLENDOBJ  
)

Definition at line 33 of file alphablend.c.

36 {
37  INT DstX, DstY, SrcX, SrcY;
39  register NICEPIXEL32 DstPixel32;
40  register NICEPIXEL32 SrcPixel32;
41  UCHAR Alpha, SrcBpp = BitsPerFormat(Source->iBitmapFormat);
42  EXLATEOBJ* pexlo;
43  EXLATEOBJ exloSrcRGB, exloDstRGB, exloRGBSrc;
44  PFN_DIB_PutPixel pfnDibPutPixel = DibFunctionsForBitmapFormat[Dest->iBitmapFormat].DIB_PutPixel;
45 
46  DPRINT("DIB_16BPP_AlphaBlend: srcRect: (%d,%d)-(%d,%d), dstRect: (%d,%d)-(%d,%d)\n",
47  SourceRect->left, SourceRect->top, SourceRect->right, SourceRect->bottom,
48  DestRect->left, DestRect->top, DestRect->right, DestRect->bottom);
49 
50  BlendFunc = BlendObj->BlendFunction;
51  if (BlendFunc.BlendOp != AC_SRC_OVER)
52  {
53  DPRINT1("BlendOp != AC_SRC_OVER\n");
54  return FALSE;
55  }
56  if (BlendFunc.BlendFlags != 0)
57  {
58  DPRINT1("BlendFlags != 0\n");
59  return FALSE;
60  }
61  if ((BlendFunc.AlphaFormat & ~AC_SRC_ALPHA) != 0)
62  {
63  DPRINT1("Unsupported AlphaFormat (0x%x)\n", BlendFunc.AlphaFormat);
64  return FALSE;
65  }
66  if ((BlendFunc.AlphaFormat & AC_SRC_ALPHA) != 0 &&
67  SrcBpp != 32)
68  {
69  DPRINT1("Source bitmap must be 32bpp when AC_SRC_ALPHA is set\n");
70  return FALSE;
71  }
72 
73  if (!ColorTranslation)
74  {
75  DPRINT1("ColorTranslation must not be NULL!\n");
76  return FALSE;
77  }
78 
79  pexlo = CONTAINING_RECORD(ColorTranslation, EXLATEOBJ, xlo);
80  EXLATEOBJ_vInitialize(&exloSrcRGB, pexlo->ppalSrc, &gpalRGB, 0, 0, 0);
81  EXLATEOBJ_vInitialize(&exloDstRGB, pexlo->ppalDst, &gpalRGB, 0, 0, 0);
82  EXLATEOBJ_vInitialize(&exloRGBSrc, &gpalRGB, pexlo->ppalSrc, 0, 0, 0);
83 
84  SrcY = SourceRect->top;
85  DstY = DestRect->top;
86  while ( DstY < DestRect->bottom )
87  {
88  SrcX = SourceRect->left;
89  DstX = DestRect->left;
90  while(DstX < DestRect->right)
91  {
92  SrcPixel32.ul = DIB_GetSource(Source, SrcX, SrcY, &exloSrcRGB.xlo);
93  SrcPixel32.col.red = (SrcPixel32.col.red * BlendFunc.SourceConstantAlpha) / 255;
94  SrcPixel32.col.green = (SrcPixel32.col.green * BlendFunc.SourceConstantAlpha) / 255;
95  SrcPixel32.col.blue = (SrcPixel32.col.blue * BlendFunc.SourceConstantAlpha) / 255;
96 
97  Alpha = ((BlendFunc.AlphaFormat & AC_SRC_ALPHA) != 0) ?
98  (SrcPixel32.col.alpha * BlendFunc.SourceConstantAlpha) / 255 :
99  BlendFunc.SourceConstantAlpha ;
100 
101  DstPixel32.ul = DIB_GetSource(Dest, DstX, DstY, &exloDstRGB.xlo);
102  DstPixel32.col.red = Clamp8((DstPixel32.col.red * (255 - Alpha)) / 255 + SrcPixel32.col.red) ;
103  DstPixel32.col.green = Clamp8((DstPixel32.col.green * (255 - Alpha)) / 255 + SrcPixel32.col.green) ;
104  DstPixel32.col.blue = Clamp8((DstPixel32.col.blue * (255 - Alpha)) / 255 + SrcPixel32.col.blue) ;
105  DstPixel32.ul = XLATEOBJ_iXlate(&exloRGBSrc.xlo, DstPixel32.ul);
106  pfnDibPutPixel(Dest, DstX, DstY, XLATEOBJ_iXlate(ColorTranslation, DstPixel32.ul));
107 
108  DstX++;
109  SrcX = SourceRect->left + ((DstX-DestRect->left)*(SourceRect->right - SourceRect->left))
110  /(DestRect->right-DestRect->left);
111  }
112  DstY++;
113  SrcY = SourceRect->top + ((DstY-DestRect->top)*(SourceRect->bottom - SourceRect->top))
114  /(DestRect->bottom-DestRect->top);
115  }
116 
117  EXLATEOBJ_vCleanup(&exloDstRGB);
118  EXLATEOBJ_vCleanup(&exloRGBSrc);
119  EXLATEOBJ_vCleanup(&exloSrcRGB);
120 
121  return TRUE;
122 }
#define TRUE
Definition: types.h:120
#define BitsPerFormat(Format)
Definition: surface.h:102
#define AC_SRC_ALPHA
Definition: alphablend.c:9
int32_t INT
Definition: typedefs.h:56
BYTE BlendOp
Definition: wingdi.h:2736
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
#define DIB_GetSource(SourceSurf, sx, sy, ColorTranslation)
Definition: dib.h:136
#define FALSE
Definition: types.h:117
PFN_DIB_PutPixel DIB_PutPixel
Definition: dib.h:45
void DPRINT(...)
Definition: polytest.cpp:61
GLint GLint bottom
Definition: glext.h:7726
VOID NTAPI EXLATEOBJ_vCleanup(_Inout_ PEXLATEOBJ pexlo)
Definition: xlateobj.c:649
VOID(* PFN_DIB_PutPixel)(SURFOBJ *, LONG, LONG, ULONG)
Definition: dib.h:33
BYTE SourceConstantAlpha
Definition: wingdi.h:2738
GLdouble GLdouble right
Definition: glext.h:10859
unsigned char UCHAR
Definition: xmlstorage.h:181
BYTE BlendFlags
Definition: wingdi.h:2737
#define AC_SRC_OVER
Definition: wingdi.h:1350
DIB_FUNCTIONS DibFunctionsForBitmapFormat[]
Definition: dib.c:20
static __inline UCHAR Clamp8(ULONG val)
Definition: alphablend.c:27
#define DPRINT1
Definition: precomp.h:8
struct NICEPIXEL32::@3879 col
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:259
PALETTE gpalRGB
Definition: palette.c:17
ENGAPI ULONG APIENTRY XLATEOBJ_iXlate(_In_ XLATEOBJ *pxlo, _In_ ULONG iColor)
Definition: xlateobj.c:664
PPALETTE ppalSrc
Definition: xlateobj.h:25
BYTE AlphaFormat
Definition: wingdi.h:2739
BLENDFUNCTION BlendFunc
Definition: general.c:30
ULONG ul
Definition: alphablend.c:16
PPALETTE ppalDst
Definition: xlateobj.h:26
BOOLEAN DIB_XXBPP_FloodFillSolid ( SURFOBJ ,
BRUSHOBJ ,
RECTL ,
POINTL ,
ULONG  ,
UINT   
)

Definition at line 86 of file floodfill.c.

Referenced by NtGdiExtFloodFill().

92 {
93  ULONG x, y;
94  ULONG BrushColor;
95  FLOODINFO flood = {0, NULL, NULL};
96 
97  BrushColor = Brush->iSolidColor;
98  x = Origin->x;
99  y = Origin->y;
100 
101  if (FillType == FLOODFILLBORDER)
102  {
103  /* Check if the start pixel has the border color */
104  if (DibFunctionsForBitmapFormat[DstSurf->iBitmapFormat].DIB_GetPixel(DstSurf, x, y) == ConvColor)
105  {
106  return FALSE;
107  }
108 
109  if (initFlood(&flood, DstRect) == FALSE)
110  {
111  return FALSE;
112  }
113  addItemFlood(&flood, x, y, DstSurf, DstRect, ConvColor, FALSE);
114  while (flood.floodLen != 0)
115  {
116  x = flood.floodStart->x;
117  y = flood.floodStart->y;
118  removeItemFlood(&flood);
119 
120  DibFunctionsForBitmapFormat[DstSurf->iBitmapFormat].DIB_PutPixel(DstSurf, x, y, BrushColor);
121  if (flood.floodStart - 4 < flood.floodData)
122  {
123  DPRINT1("Can't finish flooding!\n");
124  finalizeFlood(&flood);
125  return FALSE;
126  }
127  addItemFlood(&flood, x, y + 1, DstSurf, DstRect, ConvColor, FALSE);
128  addItemFlood(&flood, x, y - 1, DstSurf, DstRect, ConvColor, FALSE);
129  addItemFlood(&flood, x + 1, y, DstSurf, DstRect, ConvColor, FALSE);
130  addItemFlood(&flood, x - 1, y, DstSurf, DstRect, ConvColor, FALSE);
131  }
132  finalizeFlood(&flood);
133  }
134  else if (FillType == FLOODFILLSURFACE)
135  {
136  /* Check if the start pixel has the surface color */
137  if (DibFunctionsForBitmapFormat[DstSurf->iBitmapFormat].DIB_GetPixel(DstSurf, x, y) != ConvColor)
138  {
139  return FALSE;
140  }
141 
142  if (initFlood(&flood, DstRect) == FALSE)
143  {
144  return FALSE;
145  }
146  addItemFlood(&flood, x, y, DstSurf, DstRect, ConvColor, TRUE);
147  while (flood.floodLen != 0)
148  {
149  x = flood.floodStart->x;
150  y = flood.floodStart->y;
151  removeItemFlood(&flood);
152 
153  DibFunctionsForBitmapFormat[DstSurf->iBitmapFormat].DIB_PutPixel(DstSurf, x, y, BrushColor);
154  if (flood.floodStart - 4 < flood.floodData)
155  {
156  DPRINT1("Can't finish flooding!\n");
157  finalizeFlood(&flood);
158  return FALSE;
159  }
160  addItemFlood(&flood, x, y + 1, DstSurf, DstRect, ConvColor, TRUE);
161  addItemFlood(&flood, x, y - 1, DstSurf, DstRect, ConvColor, TRUE);
162  addItemFlood(&flood, x + 1, y, DstSurf, DstRect, ConvColor, TRUE);
163  addItemFlood(&flood, x - 1, y, DstSurf, DstRect, ConvColor, TRUE);
164  }
165  finalizeFlood(&flood);
166  }
167  else
168  {
169  DPRINT1("Unsupported FloodFill type!\n");
170  return FALSE;
171  }
172  return TRUE;
173 }
static __inline VOID removeItemFlood(FLOODINFO *info)
Definition: floodfill.c:80
#define TRUE
Definition: types.h:120
static __inline VOID addItemFlood(FLOODINFO *info, ULONG x, ULONG y, SURFOBJ *DstSurf, RECTL *DstRect, ULONG Color, BOOL isSurf)
Definition: floodfill.c:54
ULONG y
Definition: floodfill.c:27
#define FALSE
Definition: types.h:117
PFN_DIB_PutPixel DIB_PutPixel
Definition: dib.h:45
smooth NULL
Definition: ftsmooth.c:557
#define FLOODFILLSURFACE
Definition: wingdi.h:643
static __inline VOID finalizeFlood(FLOODINFO *info)
Definition: floodfill.c:50
PFN_DIB_GetPixel DIB_GetPixel
Definition: dib.h:46
FLOODITEM * floodData
Definition: floodfill.c:34
DIB_FUNCTIONS DibFunctionsForBitmapFormat[]
Definition: dib.c:20
ULONG floodLen
Definition: floodfill.c:32
#define DPRINT1
Definition: precomp.h:8
unsigned int ULONG
Definition: retypes.h:1
static __inline BOOL initFlood(FLOODINFO *info, RECTL *DstRect)
Definition: floodfill.c:37
FLOODITEM * floodStart
Definition: floodfill.c:33
INT INT y
Definition: msvc.h:62
#define FLOODFILLBORDER
Definition: wingdi.h:642
ULONG x
Definition: floodfill.c:26
INT x
Definition: msvc.h:62
BOOLEAN DIB_XXBPP_StretchBlt ( SURFOBJ ,
SURFOBJ ,
SURFOBJ ,
SURFOBJ ,
RECTL ,
RECTL ,
POINTL ,
BRUSHOBJ ,
POINTL ,
XLATEOBJ ,
ROP4   
)

Definition at line 16 of file stretchblt.c.

22 {
23  LONG sx = 0;
24  LONG sy = 0;
25  LONG DesX;
26  LONG DesY;
27 
28  LONG DstHeight;
29  LONG DstWidth;
30  LONG SrcHeight;
31  LONG SrcWidth;
32  LONG MaskCy;
33  LONG SourceCy;
34 
35  ULONG Color;
36  ULONG Dest, Source = 0, Pattern = 0;
37  ULONG xxBPPMask;
38  BOOLEAN CanDraw;
39 
40  PFN_DIB_GetPixel fnSource_GetPixel = NULL;
41  PFN_DIB_GetPixel fnDest_GetPixel = NULL;
42  PFN_DIB_PutPixel fnDest_PutPixel = NULL;
43  PFN_DIB_GetPixel fnPattern_GetPixel = NULL;
44  PFN_DIB_GetPixel fnMask_GetPixel = NULL;
45 
46  LONG PatternX = 0, PatternY = 0;
47 
48  BOOL UsesSource = ROP4_USES_SOURCE(ROP);
49  BOOL UsesPattern = ROP4_USES_PATTERN(ROP);
50 
51  ASSERT(IS_VALID_ROP4(ROP));
52 
53  fnDest_GetPixel = DibFunctionsForBitmapFormat[DestSurf->iBitmapFormat].DIB_GetPixel;
54  fnDest_PutPixel = DibFunctionsForBitmapFormat[DestSurf->iBitmapFormat].DIB_PutPixel;
55 
56  DPRINT("Dest BPP: %u, dstRect: (%d,%d)-(%d,%d)\n",
57  BitsPerFormat(DestSurf->iBitmapFormat), DestRect->left, DestRect->top, DestRect->right, DestRect->bottom);
58 
59  if (UsesSource)
60  {
61  SourceCy = abs(SourceSurf->sizlBitmap.cy);
62  fnSource_GetPixel = DibFunctionsForBitmapFormat[SourceSurf->iBitmapFormat].DIB_GetPixel;
63  DPRINT("Source BPP: %u, srcRect: (%d,%d)-(%d,%d)\n",
64  BitsPerFormat(SourceSurf->iBitmapFormat), SourceRect->left, SourceRect->top, SourceRect->right, SourceRect->bottom);
65  }
66 
67  if (MaskSurf)
68  {
69  fnMask_GetPixel = DibFunctionsForBitmapFormat[MaskSurf->iBitmapFormat].DIB_GetPixel;
70  MaskCy = abs(MaskSurf->sizlBitmap.cy);
71  }
72 
73  DstHeight = DestRect->bottom - DestRect->top;
74  DstWidth = DestRect->right - DestRect->left;
75  SrcHeight = SourceRect->bottom - SourceRect->top;
76  SrcWidth = SourceRect->right - SourceRect->left;
77 
78  /* FIXME: MaskOrigin? */
79 
80  switch(DestSurf->iBitmapFormat)
81  {
82  case BMF_1BPP: xxBPPMask = 0x1; break;
83  case BMF_4BPP: xxBPPMask = 0xF; break;
84  case BMF_8BPP: xxBPPMask = 0xFF; break;
85  case BMF_16BPP: xxBPPMask = 0xFFFF; break;
86  case BMF_24BPP: xxBPPMask = 0xFFFFFF; break;
87  default:
88  xxBPPMask = 0xFFFFFFFF;
89  }
90 
91  if (UsesPattern)
92  {
93  if (PatternSurface)
94  {
95  PatternY = (DestRect->top - BrushOrigin->y) % PatternSurface->sizlBitmap.cy;
96  if (PatternY < 0)
97  {
98  PatternY += PatternSurface->sizlBitmap.cy;
99  }
100  fnPattern_GetPixel = DibFunctionsForBitmapFormat[PatternSurface->iBitmapFormat].DIB_GetPixel;
101  }
102  else
103  {
104  if (Brush)
105  Pattern = Brush->iSolidColor;
106  }
107  }
108 
109 
110  for (DesY = DestRect->top; DesY < DestRect->bottom; DesY++)
111  {
112  if (PatternSurface)
113  {
114  PatternX = (DestRect->left - BrushOrigin->x) % PatternSurface->sizlBitmap.cx;
115  if (PatternX < 0)
116  {
117  PatternX += PatternSurface->sizlBitmap.cx;
118  }
119  }
120  if (UsesSource)
121  sy = SourceRect->top+(DesY - DestRect->top) * SrcHeight / DstHeight;
122 
123  for (DesX = DestRect->left; DesX < DestRect->right; DesX++)
124  {
125  CanDraw = TRUE;
126 
127  if (fnMask_GetPixel)
128  {
129  sx = SourceRect->left+(DesX - DestRect->left) * SrcWidth / DstWidth;
130  if (sx < 0 || sy < 0 ||
131  MaskSurf->sizlBitmap.cx < sx || MaskCy < sy ||
132  fnMask_GetPixel(MaskSurf, sx, sy) != 0)
133  {
134  CanDraw = FALSE;
135  }
136  }
137 
138  if (UsesSource && CanDraw)
139  {
140  sx = SourceRect->left+(DesX - DestRect->left) * SrcWidth / DstWidth;
141  if (sx >= 0 && sy >= 0 &&
142  SourceSurf->sizlBitmap.cx > sx && SourceCy > sy)
143  {
144  Source = XLATEOBJ_iXlate(ColorTranslation, fnSource_GetPixel(SourceSurf, sx, sy));
145  }
146  else
147  {
148  Source = 0;
149  CanDraw = ((ROP & 0xFF) != R3_OPINDEX_SRCCOPY);
150  }
151  }
152 
153  if (CanDraw)
154  {
155  if (UsesPattern && PatternSurface)
156  {
157  Pattern = fnPattern_GetPixel(PatternSurface, PatternX, PatternY);
158  PatternX++;
159  PatternX %= PatternSurface->sizlBitmap.cx;
160  }
161 
162  Dest = fnDest_GetPixel(DestSurf, DesX, DesY);
163  Color = DIB_DoRop(ROP, Dest, Source, Pattern) & xxBPPMask;
164 
165  fnDest_PutPixel(DestSurf, DesX, DesY, Color);
166  }
167  }
168 
169  if (PatternSurface)
170  {
171  PatternY++;
172  PatternY %= PatternSurface->sizlBitmap.cy;
173  }
174  }
175 
176  return TRUE;
177 }
#define BMF_24BPP
Definition: winddi.h:359
#define abs(i)
Definition: fconv.c:206
#define TRUE
Definition: types.h:120
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel)?(CompletionRoutine!=NULL):TRUE)
#define BitsPerFormat(Format)
Definition: surface.h:102
#define IS_VALID_ROP4(rop)
Definition: inteng.h:49
ULONG(* PFN_DIB_GetPixel)(SURFOBJ *, LONG, LONG)
Definition: dib.h:34
Definition: xlate.c:8
struct Color Color
#define FALSE
Definition: types.h:117
long LONG
Definition: pedump.c:60
PFN_DIB_PutPixel DIB_PutPixel
Definition: dib.h:45
smooth NULL
Definition: ftsmooth.c:557
void DPRINT(...)
Definition: polytest.cpp:61
GLint GLint bottom
Definition: glext.h:7726
#define ROP4_USES_SOURCE(Rop4)
Definition: inteng.h:45
ULONG DIB_DoRop(ULONG Rop, ULONG Dest, ULONG Source, ULONG Pattern)
Definition: dib.c:92
#define BMF_16BPP
Definition: winddi.h:358
unsigned char BOOLEAN
unsigned int BOOL
Definition: ntddk_ex.h:94
if(!(yy_init))
Definition: macro.lex.yy.c:704
VOID(* PFN_DIB_PutPixel)(SURFOBJ *, LONG, LONG, ULONG)
Definition: dib.h:33
GLdouble GLdouble right
Definition: glext.h:10859
PFN_DIB_GetPixel DIB_GetPixel
Definition: dib.h:46
DIB_FUNCTIONS DibFunctionsForBitmapFormat[]
Definition: dib.c:20
#define ROP4_USES_PATTERN(Rop4)
Definition: inteng.h:46
Definition: xlate.c:9
Definition: xlate.c:10
unsigned int ULONG
Definition: retypes.h:1
ENGAPI ULONG APIENTRY XLATEOBJ_iXlate(_In_ XLATEOBJ *pxlo, _In_ ULONG iColor)
Definition: xlateobj.c:664
BOOLEAN Dummy_AlphaBlend ( SURFOBJ ,
SURFOBJ ,
RECTL ,
RECTL ,
CLIPOBJ ,
XLATEOBJ ,
BLENDOBJ  
)

Definition at line 244 of file dib.c.

247 {
248  return FALSE;
249 }
#define FALSE
Definition: types.h:117
BOOLEAN Dummy_BitBlt ( PBLTINFO  )

Definition at line 214 of file dib.c.

215 {
216  return FALSE;
217 }
#define FALSE
Definition: types.h:117
BOOLEAN Dummy_ColorFill ( SURFOBJ ,
RECTL ,
ULONG   
)

Definition at line 237 of file dib.c.

238 {
239  return FALSE;
240 }
#define FALSE
Definition: types.h:117
ULONG Dummy_GetPixel ( SURFOBJ ,
LONG  ,
LONG   
)

Definition at line 199 of file dib.c.

200 {
201  return 0;
202 }
VOID Dummy_HLine ( SURFOBJ ,
LONG  ,
LONG  ,
LONG  ,
ULONG   
)

Definition at line 204 of file dib.c.

205 {
206  return;
207 }
VOID Dummy_PutPixel ( SURFOBJ ,
LONG  ,
LONG  ,
ULONG   
)

Definition at line 194 of file dib.c.

195 {
196  return;
197 }
BOOLEAN Dummy_StretchBlt ( SURFOBJ ,
SURFOBJ ,
SURFOBJ ,
SURFOBJ ,
RECTL ,
RECTL ,
POINTL ,
BRUSHOBJ ,
POINTL ,
XLATEOBJ ,
ROP4   
)

Definition at line 219 of file dib.c.

226 {
227  return FALSE;
228 }
#define FALSE
Definition: types.h:117
BOOLEAN Dummy_TransparentBlt ( SURFOBJ ,
SURFOBJ ,
RECTL ,
RECTL ,
XLATEOBJ ,
ULONG   
)

Definition at line 230 of file dib.c.

233 {
234  return FALSE;
235 }
#define FALSE
Definition: types.h:117
VOID Dummy_VLine ( SURFOBJ ,
LONG  ,
LONG  ,
LONG  ,
ULONG   
)

Definition at line 209 of file dib.c.

210 {
211  return;
212 }

Variable Documentation

unsigned char altnotmask[2]
unsigned char notmask[2]

Definition at line 17 of file dib.c.

Referenced by DIB_4BPP_BitBltSrcCopy(), DIB_4BPP_HLine(), DIB_4BPP_PutPixel(), and DIB_4BPP_VLine().