- Change the prototype of DIB_*_BitBlt* functions to take a pointer to a BLTINFO structure instead of many parameters.

- Make DIB_GetSource and DIB_GetSourceIndex macros.
- Add IntEngCreateSrcMonoXlate.
- Change the semantics of IntEngCreate*Xlate functions to treat palette mode == 0 as mode of the passed palette.
- Add XlateBrush and XlatePen to the DC structure.
- Fixed the bad design decision that caused mess when one brush was selected into more than one DC.
- Remove incorrect Int[Get/Set]DCColor implementation (used by [Get/Set]DC[Pen/Brush]Color).
- Get rid of compiler warnings in Win32k.

svn path=/trunk/; revision=10116
This commit is contained in:
Filip Navara 2004-07-14 20:48:58 +00:00
parent d0ba990059
commit dcbabca872
35 changed files with 1322 additions and 1644 deletions

View file

@ -36,14 +36,9 @@ typedef struct
COLORREF crBack; COLORREF crBack;
COLORREF crFore; COLORREF crFore;
ULONG ulPalTime; ULONG ulPalTime;
#if 0
ULONG ulSurfTime; ULONG ulSurfTime;
PVOID ulRealization; PVOID ulRealization;
ULONG Unknown4C[3]; ULONG Unknown4C[3];
#else
BRUSHOBJ BrushObject;
ULONG Unknown50[2];
#endif
POINT ptPenWidth; POINT ptPenWidth;
ULONG ulPenStyle; ULONG ulPenStyle;
DWORD *pStyle; DWORD *pStyle;
@ -51,6 +46,13 @@ typedef struct
ULONG Unknown6C; ULONG Unknown6C;
} GDIBRUSHOBJ, *PGDIBRUSHOBJ; } GDIBRUSHOBJ, *PGDIBRUSHOBJ;
typedef struct
{
BRUSHOBJ BrushObject;
PGDIBRUSHOBJ GdiBrushObject;
XLATEOBJ *XlateObject;
} GDIBRUSHINST, *PGDIBRUSHINST;
/* GDI Brush Attributes */ /* GDI Brush Attributes */
#define GDIBRUSH_NEED_BK_CLR 0x0002 /* Background color is needed */ #define GDIBRUSH_NEED_BK_CLR 0x0002 /* Background color is needed */

View file

@ -100,6 +100,9 @@ typedef struct _DC
CLIPOBJ *CombinedClip; CLIPOBJ *CombinedClip;
XLATEOBJ *XlateBrush;
XLATEOBJ *XlatePen;
INT saveLevel; INT saveLevel;
WIN_DC_INFO w; WIN_DC_INFO w;

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
/* $Id: dib.c,v 1.11 2004/07/03 13:55:35 navaraf Exp $ */ /* $Id: dib.c,v 1.12 2004/07/14 20:48:56 navaraf Exp $ */
#include <w32k.h> #include <w32k.h>
/* Static data */ /* Static data */
@ -29,106 +29,66 @@ DIB_FUNCTIONS DibFunctionsForBitmapFormat[] =
/* 0 */ /* 0 */
{ {
Dummy_PutPixel, Dummy_GetPixel, Dummy_HLine, Dummy_VLine, Dummy_PutPixel, Dummy_GetPixel, Dummy_HLine, Dummy_VLine,
Dummy_BitBlt, Dummy_StretchBlt, Dummy_TransparentBlt Dummy_BitBlt, Dummy_BitBlt, Dummy_StretchBlt, Dummy_TransparentBlt
}, },
/* BMF_1BPP */ /* BMF_1BPP */
{ {
DIB_1BPP_PutPixel, DIB_1BPP_GetPixel, DIB_1BPP_HLine, DIB_1BPP_VLine, DIB_1BPP_PutPixel, DIB_1BPP_GetPixel, DIB_1BPP_HLine, DIB_1BPP_VLine,
DIB_1BPP_BitBlt, DIB_1BPP_StretchBlt, DIB_1BPP_TransparentBlt DIB_1BPP_BitBlt, DIB_1BPP_BitBltSrcCopy, DIB_1BPP_StretchBlt,
DIB_1BPP_TransparentBlt
}, },
/* BMF_4BPP */ /* BMF_4BPP */
{ {
DIB_4BPP_PutPixel, DIB_4BPP_GetPixel, DIB_4BPP_HLine, DIB_4BPP_VLine, DIB_4BPP_PutPixel, DIB_4BPP_GetPixel, DIB_4BPP_HLine, DIB_4BPP_VLine,
DIB_4BPP_BitBlt, DIB_4BPP_StretchBlt, DIB_4BPP_TransparentBlt DIB_4BPP_BitBlt, DIB_4BPP_BitBltSrcCopy, DIB_4BPP_StretchBlt,
DIB_4BPP_TransparentBlt
}, },
/* BMF_8BPP */ /* BMF_8BPP */
{ {
DIB_8BPP_PutPixel, DIB_8BPP_GetPixel, DIB_8BPP_HLine, DIB_8BPP_VLine, DIB_8BPP_PutPixel, DIB_8BPP_GetPixel, DIB_8BPP_HLine, DIB_8BPP_VLine,
DIB_8BPP_BitBlt, DIB_8BPP_StretchBlt, DIB_8BPP_TransparentBlt DIB_8BPP_BitBlt, DIB_8BPP_BitBltSrcCopy, DIB_8BPP_StretchBlt,
DIB_8BPP_TransparentBlt
}, },
/* BMF_16BPP */ /* BMF_16BPP */
{ {
DIB_16BPP_PutPixel, DIB_16BPP_GetPixel, DIB_16BPP_HLine, DIB_16BPP_VLine, DIB_16BPP_PutPixel, DIB_16BPP_GetPixel, DIB_16BPP_HLine, DIB_16BPP_VLine,
DIB_16BPP_BitBlt, DIB_16BPP_StretchBlt, DIB_16BPP_TransparentBlt DIB_16BPP_BitBlt, DIB_16BPP_BitBltSrcCopy, DIB_16BPP_StretchBlt,
DIB_16BPP_TransparentBlt
}, },
/* BMF_24BPP */ /* BMF_24BPP */
{ {
DIB_24BPP_PutPixel, DIB_24BPP_GetPixel, DIB_24BPP_HLine, DIB_24BPP_VLine, DIB_24BPP_PutPixel, DIB_24BPP_GetPixel, DIB_24BPP_HLine, DIB_24BPP_VLine,
DIB_24BPP_BitBlt, DIB_24BPP_StretchBlt, DIB_24BPP_TransparentBlt DIB_24BPP_BitBlt, DIB_24BPP_BitBltSrcCopy, DIB_24BPP_StretchBlt,
DIB_24BPP_TransparentBlt
}, },
/* BMF_32BPP */ /* BMF_32BPP */
{ {
DIB_32BPP_PutPixel, DIB_32BPP_GetPixel, DIB_32BPP_HLine, DIB_32BPP_VLine, DIB_32BPP_PutPixel, DIB_32BPP_GetPixel, DIB_32BPP_HLine, DIB_32BPP_VLine,
DIB_32BPP_BitBlt, DIB_32BPP_StretchBlt, DIB_32BPP_TransparentBlt DIB_32BPP_BitBlt, DIB_32BPP_BitBltSrcCopy, DIB_32BPP_StretchBlt,
DIB_32BPP_TransparentBlt
}, },
/* BMF_4RLE */ /* BMF_4RLE */
{ {
Dummy_PutPixel, Dummy_GetPixel, Dummy_HLine, Dummy_VLine, Dummy_PutPixel, Dummy_GetPixel, Dummy_HLine, Dummy_VLine,
Dummy_BitBlt, Dummy_StretchBlt, Dummy_TransparentBlt Dummy_BitBlt, Dummy_BitBlt, Dummy_StretchBlt, Dummy_TransparentBlt
}, },
/* BMF_8RLE */ /* BMF_8RLE */
{ {
Dummy_PutPixel, Dummy_GetPixel, Dummy_HLine, Dummy_VLine, Dummy_PutPixel, Dummy_GetPixel, Dummy_HLine, Dummy_VLine,
Dummy_BitBlt, Dummy_StretchBlt, Dummy_TransparentBlt Dummy_BitBlt, Dummy_BitBlt, Dummy_StretchBlt, Dummy_TransparentBlt
}, },
/* BMF_JPEG */ /* BMF_JPEG */
{ {
Dummy_PutPixel, Dummy_GetPixel, Dummy_HLine, Dummy_VLine, Dummy_PutPixel, Dummy_GetPixel, Dummy_HLine, Dummy_VLine,
Dummy_BitBlt, Dummy_StretchBlt, Dummy_TransparentBlt Dummy_BitBlt, Dummy_BitBlt, Dummy_StretchBlt, Dummy_TransparentBlt
}, },
/* BMF_PNG */ /* BMF_PNG */
{ {
Dummy_PutPixel, Dummy_GetPixel, Dummy_HLine, Dummy_VLine, Dummy_PutPixel, Dummy_GetPixel, Dummy_HLine, Dummy_VLine,
Dummy_BitBlt, Dummy_StretchBlt, Dummy_TransparentBlt Dummy_BitBlt, Dummy_BitBlt, Dummy_StretchBlt, Dummy_TransparentBlt
} }
}; };
ULONG
DIB_GetSource(SURFOBJ* SourceSurf, ULONG sx, ULONG sy, XLATEOBJ* ColorTranslation)
{
switch (SourceSurf->iBitmapFormat)
{
case BMF_1BPP:
return(XLATEOBJ_iXlate(ColorTranslation, DIB_1BPP_GetPixel(SourceSurf, sx, sy)));
case BMF_4BPP:
return(XLATEOBJ_iXlate(ColorTranslation, DIB_4BPP_GetPixel(SourceSurf, sx, sy)));
case BMF_8BPP:
return(XLATEOBJ_iXlate(ColorTranslation, DIB_8BPP_GetPixel(SourceSurf, sx, sy)));
case BMF_16BPP:
return(XLATEOBJ_iXlate(ColorTranslation, DIB_16BPP_GetPixel(SourceSurf, sx, sy)));
case BMF_24BPP:
return(XLATEOBJ_iXlate(ColorTranslation, DIB_24BPP_GetPixel(SourceSurf, sx, sy)));
case BMF_32BPP:
return(XLATEOBJ_iXlate(ColorTranslation, DIB_32BPP_GetPixel(SourceSurf, sx, sy)));
default:
DPRINT1("DIB_GetSource: Unhandled number of bits per pixel in source (%d).\n", BitsPerFormat(SourceSurf->iBitmapFormat));
return(0);
}
}
ULONG
DIB_GetSourceIndex(SURFOBJ* SourceSurf, ULONG sx, ULONG sy)
{
switch (SourceSurf->iBitmapFormat)
{
case BMF_1BPP:
return DIB_1BPP_GetPixel(SourceSurf, sx, sy);
case BMF_4BPP:
return DIB_4BPP_GetPixel(SourceSurf, sx, sy);
case BMF_8BPP:
return DIB_8BPP_GetPixel(SourceSurf, sx, sy);
case BMF_16BPP:
return DIB_16BPP_GetPixel(SourceSurf, sx, sy);
case BMF_24BPP:
return DIB_24BPP_GetPixel(SourceSurf, sx, sy);
case BMF_32BPP:
return DIB_32BPP_GetPixel(SourceSurf, sx, sy);
default:
DPRINT1("DIB_GetOriginalSource: Unhandled number of bits per pixel in source (%d).\n", BitsPerFormat(SourceSurf->iBitmapFormat));
return(0);
}
}
ULONG ULONG
DIB_DoRop(ULONG Rop, ULONG Dest, ULONG Source, ULONG Pattern) DIB_DoRop(ULONG Rop, ULONG Dest, ULONG Source, ULONG Pattern)
{ {
@ -249,10 +209,7 @@ VOID Dummy_VLine(SURFOBJ* SurfObj, LONG x, LONG y1, LONG y2, ULONG c)
return; return;
} }
BOOLEAN Dummy_BitBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf, BOOLEAN Dummy_BitBlt(PBLTINFO BltInfo)
RECTL* DestRect, POINTL *SourcePoint,
BRUSHOBJ* BrushObj, POINTL BrushOrign,
XLATEOBJ *ColorTranslation, ULONG Rop4)
{ {
return FALSE; return FALSE;
} }

View file

@ -1,11 +1,25 @@
#ifndef _W32K_DIB_DIB_H #ifndef _W32K_DIB_DIB_H
#define _W32K_DIB_DIB_H #define _W32K_DIB_DIB_H
typedef struct _BLTINFO
{
SURFOBJ *DestSurface;
SURFOBJ *SourceSurface;
SURFOBJ *PatternSurface;
XLATEOBJ *XlateSourceToDest;
XLATEOBJ *XlatePatternToDest;
RECTL DestRect;
POINTL SourcePoint;
BRUSHOBJ *Brush;
POINTL BrushOrigin;
ULONG Rop4;
} BLTINFO, *PBLTINFO;
typedef VOID (*PFN_DIB_PutPixel)(SURFOBJ*,LONG,LONG,ULONG); typedef VOID (*PFN_DIB_PutPixel)(SURFOBJ*,LONG,LONG,ULONG);
typedef ULONG (*PFN_DIB_GetPixel)(SURFOBJ*,LONG,LONG); typedef ULONG (*PFN_DIB_GetPixel)(SURFOBJ*,LONG,LONG);
typedef VOID (*PFN_DIB_HLine)(SURFOBJ*,LONG,LONG,LONG,ULONG); typedef VOID (*PFN_DIB_HLine)(SURFOBJ*,LONG,LONG,LONG,ULONG);
typedef VOID (*PFN_DIB_VLine)(SURFOBJ*,LONG,LONG,LONG,ULONG); typedef VOID (*PFN_DIB_VLine)(SURFOBJ*,LONG,LONG,LONG,ULONG);
typedef BOOLEAN (*PFN_DIB_BitBlt)(SURFOBJ*,SURFOBJ*,RECTL*,POINTL*,BRUSHOBJ*,POINTL,XLATEOBJ*,ULONG); typedef BOOLEAN (*PFN_DIB_BitBlt)(PBLTINFO);
typedef BOOLEAN (*PFN_DIB_StretchBlt)(SURFOBJ*,SURFOBJ*,RECTL*,RECTL*,POINTL*,POINTL,CLIPOBJ*,XLATEOBJ*,ULONG); typedef BOOLEAN (*PFN_DIB_StretchBlt)(SURFOBJ*,SURFOBJ*,RECTL*,RECTL*,POINTL*,POINTL,CLIPOBJ*,XLATEOBJ*,ULONG);
typedef BOOLEAN (*PFN_DIB_TransparentBlt)(SURFOBJ*,SURFOBJ*,RECTL*,POINTL*,XLATEOBJ*,ULONG); typedef BOOLEAN (*PFN_DIB_TransparentBlt)(SURFOBJ*,SURFOBJ*,RECTL*,POINTL*,XLATEOBJ*,ULONG);
@ -16,137 +30,92 @@ typedef struct
PFN_DIB_HLine DIB_HLine; PFN_DIB_HLine DIB_HLine;
PFN_DIB_VLine DIB_VLine; PFN_DIB_VLine DIB_VLine;
PFN_DIB_BitBlt DIB_BitBlt; PFN_DIB_BitBlt DIB_BitBlt;
PFN_DIB_BitBlt DIB_BitBltSrcCopy;
PFN_DIB_StretchBlt DIB_StretchBlt; PFN_DIB_StretchBlt DIB_StretchBlt;
PFN_DIB_TransparentBlt DIB_TransparentBlt; PFN_DIB_TransparentBlt DIB_TransparentBlt;
} DIB_FUNCTIONS; } DIB_FUNCTIONS;
extern DIB_FUNCTIONS DibFunctionsForBitmapFormat[]; extern DIB_FUNCTIONS DibFunctionsForBitmapFormat[];
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*,RECTL*,RECTL*,POINTL*,POINTL,CLIPOBJ*,XLATEOBJ*,ULONG);
BOOLEAN Dummy_TransparentBlt(SURFOBJ*,SURFOBJ*,RECTL*,POINTL*,XLATEOBJ*,ULONG);
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_StretchBlt(SURFOBJ*,SURFOBJ*,RECTL*,RECTL*,POINTL*,POINTL,CLIPOBJ*,XLATEOBJ*,ULONG);
BOOLEAN DIB_1BPP_TransparentBlt(SURFOBJ*,SURFOBJ*,RECTL*,POINTL*,XLATEOBJ*,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_StretchBlt(SURFOBJ*,SURFOBJ*,RECTL*,RECTL*,POINTL*,POINTL,CLIPOBJ*,XLATEOBJ*,ULONG);
BOOLEAN DIB_4BPP_TransparentBlt(SURFOBJ*,SURFOBJ*,RECTL*,POINTL*,XLATEOBJ*,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_StretchBlt(SURFOBJ*,SURFOBJ*,RECTL*,RECTL*,POINTL*,POINTL,CLIPOBJ*,XLATEOBJ*,ULONG);
BOOLEAN DIB_8BPP_TransparentBlt(SURFOBJ*,SURFOBJ*,RECTL*,POINTL*,XLATEOBJ*,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_StretchBlt(SURFOBJ*,SURFOBJ*,RECTL*,RECTL*,POINTL*,POINTL,CLIPOBJ*,XLATEOBJ*,ULONG);
BOOLEAN DIB_16BPP_TransparentBlt(SURFOBJ*,SURFOBJ*,RECTL*,POINTL*,XLATEOBJ*,ULONG);
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_StretchBlt(SURFOBJ*,SURFOBJ*,RECTL*,RECTL*,POINTL*,POINTL,CLIPOBJ*,XLATEOBJ*,ULONG);
BOOLEAN DIB_24BPP_TransparentBlt(SURFOBJ*,SURFOBJ*,RECTL*,POINTL*,XLATEOBJ*,ULONG);
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_StretchBlt(SURFOBJ*,SURFOBJ*,RECTL*,RECTL*,POINTL*,POINTL,CLIPOBJ*,XLATEOBJ*,ULONG);
BOOLEAN DIB_32BPP_TransparentBlt(SURFOBJ*,SURFOBJ*,RECTL*,POINTL*,XLATEOBJ*,ULONG);
#define ROP_USES_SOURCE(Rop4) (((Rop4 & 0xCC0000) >> 2) != (Rop4 & 0x330000))
#define ROP_USES_PATTERN(Rop4) (((Rop4 & 0xF00000) >> 4) != (Rop4 & 0x0F0000))
extern unsigned char notmask[2]; extern unsigned char notmask[2];
extern unsigned char altnotmask[2]; extern unsigned char altnotmask[2];
#define MASK1BPP(x) (1<<(7-((x)&7))) #define MASK1BPP(x) (1<<(7-((x)&7)))
ULONG DIB_DoRop(ULONG Rop, ULONG Dest, ULONG Source, ULONG Pattern); ULONG DIB_DoRop(ULONG Rop, ULONG Dest, ULONG Source, ULONG Pattern);
ULONG DIB_GetSource(SURFOBJ* SourceSurf, ULONG sx, ULONG sy, XLATEOBJ* ColorTranslation);
ULONG DIB_GetSourceIndex(SURFOBJ* SourceSurf, ULONG sx, ULONG sy);
VOID Dummy_PutPixel(SURFOBJ* SurfObj, LONG x, LONG y, ULONG c); #define DIB_GetSource(SourceSurf,sx,sy,ColorTranslation) \
ULONG Dummy_GetPixel(SURFOBJ* SurfObj, LONG x, LONG y); XLATEOBJ_iXlate(ColorTranslation, \
VOID Dummy_HLine(SURFOBJ* SurfObj, LONG x1, LONG x2, LONG y, ULONG c); DibFunctionsForBitmapFormat[SourceSurf->iBitmapFormat]. \
VOID Dummy_VLine(SURFOBJ* SurfObj, LONG x, LONG y1, LONG y2, ULONG c); DIB_GetPixel(SourceSurf, sx, sy))
BOOLEAN Dummy_BitBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
RECTL* DestRect, POINTL *SourcePoint,
BRUSHOBJ* BrushObj, POINTL BrushOrign,
XLATEOBJ *ColorTranslation, ULONG Rop4);
BOOLEAN Dummy_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
RECTL* DestRect, RECTL *SourceRect,
POINTL* MaskOrigin, POINTL BrushOrign,
CLIPOBJ *ClipRegion, XLATEOBJ *ColorTranslation,
ULONG Mode);
BOOLEAN Dummy_TransparentBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
RECTL* DestRect, POINTL *SourcePoint,
XLATEOBJ *ColorTranslation, ULONG iTransColor);
VOID DIB_1BPP_PutPixel(SURFOBJ* SurfObj, LONG x, LONG y, ULONG c); #define DIB_GetSourceIndex(SourceSurf,sx,sy) \
ULONG DIB_1BPP_GetPixel(SURFOBJ* SurfObj, LONG x, LONG y); DibFunctionsForBitmapFormat[SourceSurf->iBitmapFormat]. \
VOID DIB_1BPP_HLine(SURFOBJ* SurfObj, LONG x1, LONG x2, LONG y, ULONG c); DIB_GetPixel(SourceSurf, sx, sy)
VOID DIB_1BPP_VLine(SURFOBJ* SurfObj, LONG x, LONG y1, LONG y2, ULONG c);
BOOLEAN DIB_1BPP_BitBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
RECTL* DestRect, POINTL *SourcePoint,
BRUSHOBJ* Brush, POINTL BrushOrigin,
XLATEOBJ *ColorTranslation, ULONG Rop4);
BOOLEAN DIB_1BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
RECTL* DestRect, RECTL *SourceRect,
POINTL* MaskOrigin, POINTL BrushOrigin,
CLIPOBJ *ClipRegion, XLATEOBJ *ColorTranslation,
ULONG Mode);
BOOLEAN DIB_1BPP_TransparentBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
RECTL* DestRect, POINTL *SourcePoint,
XLATEOBJ *ColorTranslation, ULONG iTransColor);
VOID DIB_4BPP_PutPixel(SURFOBJ* SurfObj, LONG x, LONG y, ULONG c);
ULONG DIB_4BPP_GetPixel(SURFOBJ* SurfObj, LONG x, LONG y);
VOID DIB_4BPP_HLine(SURFOBJ* SurfObj, LONG x1, LONG x2, LONG y, ULONG c);
VOID DIB_4BPP_VLine(SURFOBJ* SurfObj, LONG x, LONG y1, LONG y2, ULONG c);
BOOLEAN DIB_4BPP_BitBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
RECTL* DestRect, POINTL *SourcePoint,
BRUSHOBJ* Brush, POINTL BrushOrigin,
XLATEOBJ *ColorTranslation, ULONG Rop4);
BOOLEAN DIB_4BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
RECTL* DestRect, RECTL *SourceRect,
POINTL* MaskOrigin, POINTL BrushOrigin,
CLIPOBJ *ClipRegion, XLATEOBJ *ColorTranslation,
ULONG Mode);
BOOLEAN DIB_4BPP_TransparentBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
RECTL* DestRect, POINTL *SourcePoint,
XLATEOBJ *ColorTranslation, ULONG iTransColor);
VOID DIB_8BPP_PutPixel(SURFOBJ* SurfObj, LONG x, LONG y, ULONG c);
ULONG DIB_8BPP_GetPixel(SURFOBJ* SurfObj, LONG x, LONG y);
VOID DIB_8BPP_HLine(SURFOBJ* SurfObj, LONG x1, LONG x2, LONG y, ULONG c);
VOID DIB_8BPP_VLine(SURFOBJ* SurfObj, LONG x, LONG y1, LONG y2, ULONG c);
BOOLEAN DIB_8BPP_BitBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
RECTL* DestRect, POINTL *SourcePoint,
BRUSHOBJ* Brush, POINTL BrushOrigin,
XLATEOBJ *ColorTranslation, ULONG Rop4);
BOOLEAN DIB_8BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
RECTL* DestRect, RECTL *SourceRect,
POINTL* MaskOrigin, POINTL BrushOrigin,
CLIPOBJ *ClipRegion, XLATEOBJ *ColorTranslation,
ULONG Mode);
BOOLEAN DIB_8BPP_TransparentBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
RECTL* DestRect, POINTL *SourcePoint,
XLATEOBJ *ColorTranslation, ULONG iTransColor);
VOID DIB_16BPP_PutPixel(SURFOBJ* SurfObj, LONG x, LONG y, ULONG c);
ULONG DIB_16BPP_GetPixel(SURFOBJ* SurfObj, LONG x, LONG y);
VOID DIB_16BPP_HLine(SURFOBJ* SurfObj, LONG x1, LONG x2, LONG y, ULONG c);
VOID DIB_16BPP_VLine(SURFOBJ* SurfObj, LONG x, LONG y1, LONG y2, ULONG c);
BOOLEAN DIB_16BPP_BitBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
RECTL* DestRect, POINTL *SourcePoint,
BRUSHOBJ* Brush, POINTL BrushOrigin,
XLATEOBJ *ColorTranslation, ULONG Rop4);
BOOLEAN DIB_16BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
RECTL* DestRect, RECTL *SourceRect,
POINTL* MaskOrigin, POINTL BrushOrigin,
CLIPOBJ *ClipRegion, XLATEOBJ *ColorTranslation,
ULONG Mode);
BOOLEAN DIB_16BPP_TransparentBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
RECTL* DestRect, POINTL *SourcePoint,
XLATEOBJ *ColorTranslation, ULONG iTransColor);
VOID DIB_24BPP_PutPixel(SURFOBJ* SurfObj, LONG x, LONG y, ULONG c);
ULONG DIB_24BPP_GetPixel(SURFOBJ* SurfObj, LONG x, LONG y);
VOID DIB_24BPP_HLine(SURFOBJ* SurfObj, LONG x1, LONG x2, LONG y, ULONG c);
VOID DIB_24BPP_VLine(SURFOBJ* SurfObj, LONG x, LONG y1, LONG y2, ULONG c);
BOOLEAN DIB_24BPP_BitBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
RECTL* DestRect, POINTL *SourcePoint,
BRUSHOBJ* Brush, POINTL BrushOrigin,
XLATEOBJ *ColorTranslation, ULONG Rop4);
BOOLEAN DIB_24BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
RECTL* DestRect, RECTL *SourceRect,
POINTL* MaskOrigin, POINTL BrushOrigin,
CLIPOBJ *ClipRegion, XLATEOBJ *ColorTranslation,
ULONG Mode);
BOOLEAN DIB_24BPP_TransparentBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
RECTL* DestRect, POINTL *SourcePoint,
XLATEOBJ *ColorTranslation, ULONG iTransColor);
VOID DIB_32BPP_PutPixel(SURFOBJ* SurfObj, LONG x, LONG y, ULONG c);
ULONG DIB_32BPP_GetPixel(SURFOBJ* SurfObj, LONG x, LONG y);
VOID DIB_32BPP_HLine(SURFOBJ* SurfObj, LONG x1, LONG x2, LONG y, ULONG c);
VOID DIB_32BPP_VLine(SURFOBJ* SurfObj, LONG x, LONG y1, LONG y2, ULONG c);
BOOLEAN DIB_32BPP_BitBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
RECTL* DestRect, POINTL *SourcePoint,
BRUSHOBJ* Brush, POINTL BrushOrigin,
XLATEOBJ *ColorTranslation, ULONG Rop4);
BOOLEAN DIB_32BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
RECTL* DestRect, RECTL *SourceRect,
POINTL* MaskOrigin, POINTL BrushOrigin,
CLIPOBJ *ClipRegion, XLATEOBJ *ColorTranslation,
ULONG Mode);
BOOLEAN DIB_32BPP_TransparentBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
RECTL* DestRect, POINTL *SourcePoint,
XLATEOBJ *ColorTranslation, ULONG iTransColor);
#endif /* _W32K_DIB_DIB_H */ #endif /* _W32K_DIB_DIB_H */

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
/* $Id: dib16bpp.c,v 1.34 2004/07/03 17:40:24 navaraf Exp $ */ /* $Id: dib16bpp.c,v 1.35 2004/07/14 20:48:56 navaraf Exp $ */
#include <w32k.h> #include <w32k.h>
VOID VOID
@ -67,32 +67,30 @@ DIB_16BPP_VLine(SURFOBJ *SurfObj, LONG x, LONG y1, LONG y2, ULONG c)
} }
} }
BOOLEAN STATIC BOOLEAN
DIB_16BPP_BitBltSrcCopy(SURFOBJ *DestSurf, SURFOBJ *SourceSurf, DIB_16BPP_BitBltSrcCopy(PBLTINFO BltInfo)
PRECTL DestRect, POINTL *SourcePoint,
XLATEOBJ *ColorTranslation)
{ {
LONG i, j, sx, sy, xColor, f1; LONG i, j, sx, sy, xColor, f1;
PBYTE SourceBits, DestBits, SourceLine, DestLine; PBYTE SourceBits, DestBits, SourceLine, DestLine;
PBYTE SourceBits_4BPP, SourceLine_4BPP; PBYTE SourceBits_4BPP, SourceLine_4BPP;
DestBits = DestSurf->pvScan0 + (DestRect->top * DestSurf->lDelta) + 2 * DestRect->left; DestBits = BltInfo->DestSurface->pvScan0 + (BltInfo->DestRect.top * BltInfo->DestSurface->lDelta) + 2 * BltInfo->DestRect.left;
switch(SourceSurf->iBitmapFormat) switch(BltInfo->SourceSurface->iBitmapFormat)
{ {
case BMF_1BPP: case BMF_1BPP:
sx = SourcePoint->x; sx = BltInfo->SourcePoint.x;
sy = SourcePoint->y; sy = BltInfo->SourcePoint.y;
for (j=DestRect->top; j<DestRect->bottom; j++) for (j=BltInfo->DestRect.top; j<BltInfo->DestRect.bottom; j++)
{ {
sx = SourcePoint->x; sx = BltInfo->SourcePoint.x;
for (i=DestRect->left; i<DestRect->right; i++) for (i=BltInfo->DestRect.left; i<BltInfo->DestRect.right; i++)
{ {
if(DIB_1BPP_GetPixel(SourceSurf, sx, sy) == 0) if(DIB_1BPP_GetPixel(BltInfo->SourceSurface, sx, sy) == 0)
{ {
DIB_16BPP_PutPixel(DestSurf, i, j, XLATEOBJ_iXlate(ColorTranslation, 0)); DIB_16BPP_PutPixel(BltInfo->DestSurface, i, j, XLATEOBJ_iXlate(BltInfo->XlateSourceToDest, 0));
} else { } else {
DIB_16BPP_PutPixel(DestSurf, i, j, XLATEOBJ_iXlate(ColorTranslation, 1)); DIB_16BPP_PutPixel(BltInfo->DestSurface, i, j, XLATEOBJ_iXlate(BltInfo->XlateSourceToDest, 1));
} }
sx++; sx++;
} }
@ -101,161 +99,161 @@ DIB_16BPP_BitBltSrcCopy(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
break; break;
case BMF_4BPP: case BMF_4BPP:
SourceBits_4BPP = SourceSurf->pvScan0 + (SourcePoint->y * SourceSurf->lDelta) + (SourcePoint->x >> 1); SourceBits_4BPP = BltInfo->SourceSurface->pvScan0 + (BltInfo->SourcePoint.y * BltInfo->SourceSurface->lDelta) + (BltInfo->SourcePoint.x >> 1);
for (j=DestRect->top; j<DestRect->bottom; j++) for (j=BltInfo->DestRect.top; j<BltInfo->DestRect.bottom; j++)
{ {
SourceLine_4BPP = SourceBits_4BPP; SourceLine_4BPP = SourceBits_4BPP;
sx = SourcePoint->x; sx = BltInfo->SourcePoint.x;
f1 = sx & 1; f1 = sx & 1;
for (i=DestRect->left; i<DestRect->right; i++) for (i=BltInfo->DestRect.left; i<BltInfo->DestRect.right; i++)
{ {
xColor = XLATEOBJ_iXlate(ColorTranslation, xColor = XLATEOBJ_iXlate(BltInfo->XlateSourceToDest,
(*SourceLine_4BPP & altnotmask[f1]) >> (4 * (1 - f1))); (*SourceLine_4BPP & altnotmask[f1]) >> (4 * (1 - f1)));
DIB_16BPP_PutPixel(DestSurf, i, j, xColor); DIB_16BPP_PutPixel(BltInfo->DestSurface, i, j, xColor);
if(f1 == 1) { SourceLine_4BPP++; f1 = 0; } else { f1 = 1; } if(f1 == 1) { SourceLine_4BPP++; f1 = 0; } else { f1 = 1; }
sx++; sx++;
} }
SourceBits_4BPP += SourceSurf->lDelta; SourceBits_4BPP += BltInfo->SourceSurface->lDelta;
} }
break; break;
case BMF_8BPP: case BMF_8BPP:
SourceLine = SourceSurf->pvScan0 + (SourcePoint->y * SourceSurf->lDelta) + SourcePoint->x; SourceLine = BltInfo->SourceSurface->pvScan0 + (BltInfo->SourcePoint.y * BltInfo->SourceSurface->lDelta) + BltInfo->SourcePoint.x;
DestLine = DestBits; DestLine = DestBits;
for (j = DestRect->top; j < DestRect->bottom; j++) for (j = BltInfo->DestRect.top; j < BltInfo->DestRect.bottom; j++)
{ {
SourceBits = SourceLine; SourceBits = SourceLine;
DestBits = DestLine; DestBits = DestLine;
for (i = DestRect->left; i < DestRect->right; i++) for (i = BltInfo->DestRect.left; i < BltInfo->DestRect.right; i++)
{ {
*((WORD *)DestBits) = (WORD)XLATEOBJ_iXlate(ColorTranslation, *SourceBits); *((WORD *)DestBits) = (WORD)XLATEOBJ_iXlate(BltInfo->XlateSourceToDest, *SourceBits);
SourceBits += 1; SourceBits += 1;
DestBits += 2; DestBits += 2;
} }
SourceLine += SourceSurf->lDelta; SourceLine += BltInfo->SourceSurface->lDelta;
DestLine += DestSurf->lDelta; DestLine += BltInfo->DestSurface->lDelta;
} }
break; break;
case BMF_16BPP: case BMF_16BPP:
if (NULL == ColorTranslation || 0 != (ColorTranslation->flXlate & XO_TRIVIAL)) if (NULL == BltInfo->XlateSourceToDest || 0 != (BltInfo->XlateSourceToDest->flXlate & XO_TRIVIAL))
{ {
if (DestRect->top < SourcePoint->y) if (BltInfo->DestRect.top < BltInfo->SourcePoint.y)
{ {
SourceBits = SourceSurf->pvScan0 + (SourcePoint->y * SourceSurf->lDelta) + 2 * SourcePoint->x; SourceBits = BltInfo->SourceSurface->pvScan0 + (BltInfo->SourcePoint.y * BltInfo->SourceSurface->lDelta) + 2 * BltInfo->SourcePoint.x;
for (j = DestRect->top; j < DestRect->bottom; j++) for (j = BltInfo->DestRect.top; j < BltInfo->DestRect.bottom; j++)
{ {
RtlMoveMemory(DestBits, SourceBits, 2 * (DestRect->right - DestRect->left)); RtlMoveMemory(DestBits, SourceBits, 2 * (BltInfo->DestRect.right - BltInfo->DestRect.left));
SourceBits += SourceSurf->lDelta; SourceBits += BltInfo->SourceSurface->lDelta;
DestBits += DestSurf->lDelta; DestBits += BltInfo->DestSurface->lDelta;
} }
} }
else else
{ {
SourceBits = SourceSurf->pvScan0 + ((SourcePoint->y + DestRect->bottom - DestRect->top - 1) * SourceSurf->lDelta) + 2 * SourcePoint->x; SourceBits = BltInfo->SourceSurface->pvScan0 + ((BltInfo->SourcePoint.y + BltInfo->DestRect.bottom - BltInfo->DestRect.top - 1) * BltInfo->SourceSurface->lDelta) + 2 * BltInfo->SourcePoint.x;
DestBits = DestSurf->pvScan0 + ((DestRect->bottom - 1) * DestSurf->lDelta) + 2 * DestRect->left; DestBits = BltInfo->DestSurface->pvScan0 + ((BltInfo->DestRect.bottom - 1) * BltInfo->DestSurface->lDelta) + 2 * BltInfo->DestRect.left;
for (j = DestRect->bottom - 1; DestRect->top <= j; j--) for (j = BltInfo->DestRect.bottom - 1; BltInfo->DestRect.top <= j; j--)
{ {
RtlMoveMemory(DestBits, SourceBits, 2 * (DestRect->right - DestRect->left)); RtlMoveMemory(DestBits, SourceBits, 2 * (BltInfo->DestRect.right - BltInfo->DestRect.left));
SourceBits -= SourceSurf->lDelta; SourceBits -= BltInfo->SourceSurface->lDelta;
DestBits -= DestSurf->lDelta; DestBits -= BltInfo->DestSurface->lDelta;
} }
} }
} }
else else
{ {
if (DestRect->top < SourcePoint->y) if (BltInfo->DestRect.top < BltInfo->SourcePoint.y)
{ {
SourceLine = SourceSurf->pvScan0 + (SourcePoint->y * SourceSurf->lDelta) + 2 * SourcePoint->x; SourceLine = BltInfo->SourceSurface->pvScan0 + (BltInfo->SourcePoint.y * BltInfo->SourceSurface->lDelta) + 2 * BltInfo->SourcePoint.x;
DestLine = DestBits; DestLine = DestBits;
for (j = DestRect->top; j < DestRect->bottom; j++) for (j = BltInfo->DestRect.top; j < BltInfo->DestRect.bottom; j++)
{ {
SourceBits = SourceLine; SourceBits = SourceLine;
DestBits = DestLine; DestBits = DestLine;
for (i = DestRect->left; i < DestRect->right; i++) for (i = BltInfo->DestRect.left; i < BltInfo->DestRect.right; i++)
{ {
*((WORD *)DestBits) = (WORD)XLATEOBJ_iXlate(ColorTranslation, *((WORD *)SourceBits)); *((WORD *)DestBits) = (WORD)XLATEOBJ_iXlate(BltInfo->XlateSourceToDest, *((WORD *)SourceBits));
SourceBits += 2; SourceBits += 2;
DestBits += 2; DestBits += 2;
} }
SourceLine += SourceSurf->lDelta; SourceLine += BltInfo->SourceSurface->lDelta;
DestLine += DestSurf->lDelta; DestLine += BltInfo->DestSurface->lDelta;
} }
} }
else else
{ {
SourceLine = SourceSurf->pvScan0 + ((SourcePoint->y + DestRect->bottom - DestRect->top - 1) * SourceSurf->lDelta) + 2 * SourcePoint->x; SourceLine = BltInfo->SourceSurface->pvScan0 + ((BltInfo->SourcePoint.y + BltInfo->DestRect.bottom - BltInfo->DestRect.top - 1) * BltInfo->SourceSurface->lDelta) + 2 * BltInfo->SourcePoint.x;
DestLine = DestSurf->pvScan0 + ((DestRect->bottom - 1) * DestSurf->lDelta) + 2 * DestRect->left; DestLine = BltInfo->DestSurface->pvScan0 + ((BltInfo->DestRect.bottom - 1) * BltInfo->DestSurface->lDelta) + 2 * BltInfo->DestRect.left;
for (j = DestRect->bottom - 1; DestRect->top <= j; j--) for (j = BltInfo->DestRect.bottom - 1; BltInfo->DestRect.top <= j; j--)
{ {
SourceBits = SourceLine; SourceBits = SourceLine;
DestBits = DestLine; DestBits = DestLine;
for (i = DestRect->left; i < DestRect->right; i++) for (i = BltInfo->DestRect.left; i < BltInfo->DestRect.right; i++)
{ {
*((WORD *)DestBits) = (WORD)XLATEOBJ_iXlate(ColorTranslation, *((WORD *)SourceBits)); *((WORD *)DestBits) = (WORD)XLATEOBJ_iXlate(BltInfo->XlateSourceToDest, *((WORD *)SourceBits));
SourceBits += 2; SourceBits += 2;
DestBits += 2; DestBits += 2;
} }
SourceLine -= SourceSurf->lDelta; SourceLine -= BltInfo->SourceSurface->lDelta;
DestLine -= DestSurf->lDelta; DestLine -= BltInfo->DestSurface->lDelta;
} }
} }
} }
break; break;
case BMF_24BPP: case BMF_24BPP:
SourceLine = SourceSurf->pvScan0 + (SourcePoint->y * SourceSurf->lDelta) + 3 * SourcePoint->x; SourceLine = BltInfo->SourceSurface->pvScan0 + (BltInfo->SourcePoint.y * BltInfo->SourceSurface->lDelta) + 3 * BltInfo->SourcePoint.x;
DestLine = DestBits; DestLine = DestBits;
for (j = DestRect->top; j < DestRect->bottom; j++) for (j = BltInfo->DestRect.top; j < BltInfo->DestRect.bottom; j++)
{ {
SourceBits = SourceLine; SourceBits = SourceLine;
DestBits = DestLine; DestBits = DestLine;
for (i = DestRect->left; i < DestRect->right; i++) for (i = BltInfo->DestRect.left; i < BltInfo->DestRect.right; i++)
{ {
xColor = (*(SourceBits + 2) << 0x10) + xColor = (*(SourceBits + 2) << 0x10) +
(*(SourceBits + 1) << 0x08) + (*(SourceBits + 1) << 0x08) +
(*(SourceBits)); (*(SourceBits));
*((WORD *)DestBits) = (WORD)XLATEOBJ_iXlate(ColorTranslation, xColor); *((WORD *)DestBits) = (WORD)XLATEOBJ_iXlate(BltInfo->XlateSourceToDest, xColor);
SourceBits += 3; SourceBits += 3;
DestBits += 2; DestBits += 2;
} }
SourceLine += SourceSurf->lDelta; SourceLine += BltInfo->SourceSurface->lDelta;
DestLine += DestSurf->lDelta; DestLine += BltInfo->DestSurface->lDelta;
} }
break; break;
case BMF_32BPP: case BMF_32BPP:
SourceLine = SourceSurf->pvScan0 + (SourcePoint->y * SourceSurf->lDelta) + 4 * SourcePoint->x; SourceLine = BltInfo->SourceSurface->pvScan0 + (BltInfo->SourcePoint.y * BltInfo->SourceSurface->lDelta) + 4 * BltInfo->SourcePoint.x;
DestLine = DestBits; DestLine = DestBits;
for (j = DestRect->top; j < DestRect->bottom; j++) for (j = BltInfo->DestRect.top; j < BltInfo->DestRect.bottom; j++)
{ {
SourceBits = SourceLine; SourceBits = SourceLine;
DestBits = DestLine; DestBits = DestLine;
for (i = DestRect->left; i < DestRect->right; i++) for (i = BltInfo->DestRect.left; i < BltInfo->DestRect.right; i++)
{ {
*((WORD *)DestBits) = (WORD)XLATEOBJ_iXlate(ColorTranslation, *((PDWORD) SourceBits)); *((WORD *)DestBits) = (WORD)XLATEOBJ_iXlate(BltInfo->XlateSourceToDest, *((PDWORD) SourceBits));
SourceBits += 4; SourceBits += 4;
DestBits += 2; DestBits += 2;
} }
SourceLine += SourceSurf->lDelta; SourceLine += BltInfo->SourceSurface->lDelta;
DestLine += DestSurf->lDelta; DestLine += BltInfo->DestSurface->lDelta;
} }
break; break;
default: default:
DPRINT1("DIB_16BPP_Bitblt: Unhandled Source BPP: %u\n", BitsPerFormat(SourceSurf->iBitmapFormat)); DPRINT1("DIB_16BPP_Bitblt: Unhandled Source BPP: %u\n", BitsPerFormat(BltInfo->SourceSurface->iBitmapFormat));
return FALSE; return FALSE;
} }
@ -263,124 +261,94 @@ DIB_16BPP_BitBltSrcCopy(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
} }
BOOLEAN BOOLEAN
DIB_16BPP_BitBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf, DIB_16BPP_BitBlt(PBLTINFO BltInfo)
PRECTL DestRect, POINTL *SourcePoint,
BRUSHOBJ *Brush, POINTL BrushOrigin,
XLATEOBJ *ColorTranslation, ULONG Rop4)
{ {
ULONG X, Y; ULONG DestX, DestY;
ULONG SourceX, SourceY; ULONG SourceX, SourceY;
ULONG wd, Dest, Source = 0, Pattern = 0; ULONG PatternY = 0;
PULONG DestBits; ULONG Dest, Source = 0, Pattern = 0;
BOOL UsesSource; BOOL UsesSource;
BOOL UsesPattern; BOOL UsesPattern;
PULONG DestBits;
ULONG RoundedRight; ULONG RoundedRight;
/* Pattern brushes */
PGDIBRUSHOBJ GdiBrush = NULL;
HBITMAP PatternSurface = NULL;
SURFOBJ *PatternObj = NULL;
ULONG PatternWidth = 0, PatternHeight = 0, PatternY = 0;
if (Rop4 == SRCCOPY) UsesSource = ROP_USES_SOURCE(BltInfo->Rop4);
{ UsesPattern = ROP_USES_PATTERN(BltInfo->Rop4);
return DIB_16BPP_BitBltSrcCopy(
DestSurf,
SourceSurf,
DestRect,
SourcePoint,
ColorTranslation);
}
UsesSource = ((Rop4 & 0xCC0000) >> 2) != (Rop4 & 0x330000); RoundedRight = BltInfo->DestRect.right -
UsesPattern = (((Rop4 & 0xF00000) >> 4) != (Rop4 & 0x0F0000)) && Brush; ((BltInfo->DestRect.right - BltInfo->DestRect.left) & 0x1);
SourceY = BltInfo->SourcePoint.y;
DestBits = (PULONG)(
BltInfo->DestSurface->pvScan0 +
(BltInfo->DestRect.left << 1) +
BltInfo->DestRect.top * BltInfo->DestSurface->lDelta);
if (UsesPattern) if (UsesPattern)
{ {
if (Brush->iSolidColor == 0xFFFFFFFF) if (BltInfo->PatternSurface)
{ {
PBITMAPOBJ PatternBitmap; PatternY = (BltInfo->DestRect.top + BltInfo->BrushOrigin.y) %
BltInfo->PatternSurface->sizlBitmap.cy;
GdiBrush = CONTAINING_RECORD(
Brush,
GDIBRUSHOBJ,
BrushObject);
PatternSurface = GdiBrush->hbmPattern;
PatternBitmap = BITMAPOBJ_LockBitmap(GdiBrush->hbmPattern);
PatternObj = &PatternBitmap->SurfObj;
PatternWidth = PatternObj->sizlBitmap.cx;
PatternHeight = PatternObj->sizlBitmap.cy;
UsesPattern = TRUE;
} }
else else
{ {
UsesPattern = FALSE; Pattern = BltInfo->Brush->iSolidColor |
Pattern = (Brush->iSolidColor & 0xFFFF) | (BltInfo->Brush->iSolidColor << 16);
((Brush->iSolidColor & 0xFFFF) << 16);
} }
} }
wd = ((DestRect->right - DestRect->left) << 1) - DestSurf->lDelta; for (DestY = BltInfo->DestRect.top; DestY < BltInfo->DestRect.bottom; DestY++)
RoundedRight = DestRect->right - ((DestRect->right - DestRect->left) & 0x1);
SourceY = SourcePoint->y;
DestBits = (PULONG)(
DestSurf->pvScan0 +
(DestRect->left << 1) +
DestRect->top * DestSurf->lDelta);
for (Y = DestRect->top; Y < DestRect->bottom; Y++)
{ {
SourceX = SourcePoint->x; SourceX = BltInfo->SourcePoint.x;
if(UsesPattern) for (DestX = BltInfo->DestRect.left; DestX < RoundedRight; DestX += 2, DestBits++, SourceX += 2)
PatternY = (Y + BrushOrigin.y) % PatternHeight;
for (X = DestRect->left; X < RoundedRight; X += 2, DestBits++, SourceX += 2)
{ {
Dest = *DestBits; Dest = *DestBits;
if (UsesSource) if (UsesSource)
{ {
Source = DIB_GetSource(SourceSurf, SourceX, SourceY, ColorTranslation); Source = DIB_GetSource(BltInfo->SourceSurface, SourceX, SourceY, BltInfo->XlateSourceToDest);
Source |= DIB_GetSource(SourceSurf, SourceX + 1, SourceY, ColorTranslation) << 16; Source |= DIB_GetSource(BltInfo->SourceSurface, SourceX + 1, SourceY, BltInfo->XlateSourceToDest) << 16;
} }
if (UsesPattern) if (BltInfo->PatternSurface)
{ {
Pattern = (DIB_1BPP_GetPixel(PatternObj, (X + BrushOrigin.x) % PatternWidth, PatternY) ? GdiBrush->crFore : GdiBrush->crBack); Pattern = DIB_GetSource(BltInfo->PatternSurface, (DestX + BltInfo->BrushOrigin.x) % BltInfo->PatternSurface->sizlBitmap.cx, PatternY, BltInfo->XlatePatternToDest);
Pattern |= (DIB_1BPP_GetPixel(PatternObj, (X + BrushOrigin.x + 1) % PatternWidth, PatternY) ? GdiBrush->crFore : GdiBrush->crBack) << 16; Pattern |= DIB_GetSource(BltInfo->PatternSurface, (DestX + BltInfo->BrushOrigin.x + 1) % BltInfo->PatternSurface->sizlBitmap.cx, PatternY, BltInfo->XlatePatternToDest) << 16;
} }
*DestBits = DIB_DoRop(Rop4, Dest, Source, Pattern); *DestBits = DIB_DoRop(BltInfo->Rop4, Dest, Source, Pattern);
} }
if (X < DestRect->right) if (DestX < BltInfo->DestRect.right)
{ {
Dest = *((PUSHORT)DestBits); Dest = *((PUSHORT)DestBits);
if (UsesSource) if (UsesSource)
{ {
Source = DIB_GetSource(SourceSurf, SourceX, SourceY, ColorTranslation); Source = DIB_GetSource(BltInfo->SourceSurface, SourceX, SourceY, BltInfo->XlateSourceToDest);
} }
if (UsesPattern) if (BltInfo->PatternSurface)
{ {
Pattern = DIB_1BPP_GetPixel(PatternObj, (X + BrushOrigin.x) % PatternWidth, PatternY) ? GdiBrush->crFore : GdiBrush->crBack; Pattern = DIB_GetSource(BltInfo->PatternSurface, (DestX + BltInfo->BrushOrigin.x) % BltInfo->PatternSurface->sizlBitmap.cx, PatternY, BltInfo->XlatePatternToDest);
} }
DIB_16BPP_PutPixel(DestSurf, X, Y, DIB_DoRop(Rop4, Dest, Source, Pattern) & 0xFFFF); DIB_16BPP_PutPixel(BltInfo->DestSurface, DestX, DestY, DIB_DoRop(BltInfo->Rop4, Dest, Source, Pattern) & 0xFFFF);
DestBits = (PULONG)((ULONG_PTR)DestBits + 2); DestBits = (PULONG)((ULONG_PTR)DestBits + 2);
} }
SourceY++; SourceY++;
DestBits = (PULONG)( if (BltInfo->PatternSurface)
(ULONG_PTR)DestBits - wd); {
PatternY++;
PatternY %= BltInfo->PatternSurface->sizlBitmap.cy;
}
DestBits = (PULONG)(
(ULONG_PTR)DestBits -
((BltInfo->DestRect.right - BltInfo->DestRect.left) << 1) +
BltInfo->DestSurface->lDelta);
} }
if (PatternSurface != NULL)
BITMAPOBJ_UnlockBitmap(PatternSurface);
return TRUE; return TRUE;
} }

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
/* $Id: dib1bpp.c,v 1.31 2004/07/03 17:40:24 navaraf Exp $ */ /* $Id: dib1bpp.c,v 1.32 2004/07/14 20:48:56 navaraf Exp $ */
#include <w32k.h> #include <w32k.h>
VOID VOID
@ -227,30 +227,27 @@ DIB_1BPP_BitBltSrcCopy_From1BPP (
} }
BOOLEAN BOOLEAN
DIB_1BPP_BitBltSrcCopy( DIB_1BPP_BitBltSrcCopy(PBLTINFO BltInfo)
SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
PRECTL DestRect, POINTL *SourcePoint,
XLATEOBJ *ColorTranslation)
{ {
LONG i, j, sx, sy = SourcePoint->y; LONG i, j, sx, sy = BltInfo->SourcePoint.y;
switch ( SourceSurf->iBitmapFormat ) switch ( BltInfo->SourceSurface->iBitmapFormat )
{ {
case BMF_1BPP: case BMF_1BPP:
DIB_1BPP_BitBltSrcCopy_From1BPP ( DestSurf, SourceSurf, DestRect, SourcePoint ); DIB_1BPP_BitBltSrcCopy_From1BPP ( BltInfo->DestSurface, BltInfo->SourceSurface, &BltInfo->DestRect, &BltInfo->SourcePoint );
break; break;
case BMF_4BPP: case BMF_4BPP:
for (j=DestRect->top; j<DestRect->bottom; j++) for (j=BltInfo->DestRect.top; j<BltInfo->DestRect.bottom; j++)
{ {
sx = SourcePoint->x; sx = BltInfo->SourcePoint.x;
for (i=DestRect->left; i<DestRect->right; i++) for (i=BltInfo->DestRect.left; i<BltInfo->DestRect.right; i++)
{ {
if(XLATEOBJ_iXlate(ColorTranslation, DIB_4BPP_GetPixel(SourceSurf, sx, sy)) == 0) if(XLATEOBJ_iXlate(BltInfo->XlateSourceToDest, DIB_4BPP_GetPixel(BltInfo->SourceSurface, sx, sy)) == 0)
{ {
DIB_1BPP_PutPixel(DestSurf, i, j, 0); DIB_1BPP_PutPixel(BltInfo->DestSurface, i, j, 0);
} else { } else {
DIB_1BPP_PutPixel(DestSurf, i, j, 1); DIB_1BPP_PutPixel(BltInfo->DestSurface, i, j, 1);
} }
sx++; sx++;
} }
@ -259,16 +256,16 @@ DIB_1BPP_BitBltSrcCopy(
break; break;
case BMF_8BPP: case BMF_8BPP:
for (j=DestRect->top; j<DestRect->bottom; j++) for (j=BltInfo->DestRect.top; j<BltInfo->DestRect.bottom; j++)
{ {
sx = SourcePoint->x; sx = BltInfo->SourcePoint.x;
for (i=DestRect->left; i<DestRect->right; i++) for (i=BltInfo->DestRect.left; i<BltInfo->DestRect.right; i++)
{ {
if(XLATEOBJ_iXlate(ColorTranslation, DIB_8BPP_GetPixel(SourceSurf, sx, sy)) == 0) if(XLATEOBJ_iXlate(BltInfo->XlateSourceToDest, DIB_8BPP_GetPixel(BltInfo->SourceSurface, sx, sy)) == 0)
{ {
DIB_1BPP_PutPixel(DestSurf, i, j, 0); DIB_1BPP_PutPixel(BltInfo->DestSurface, i, j, 0);
} else { } else {
DIB_1BPP_PutPixel(DestSurf, i, j, 1); DIB_1BPP_PutPixel(BltInfo->DestSurface, i, j, 1);
} }
sx++; sx++;
} }
@ -277,16 +274,16 @@ DIB_1BPP_BitBltSrcCopy(
break; break;
case BMF_16BPP: case BMF_16BPP:
for (j=DestRect->top; j<DestRect->bottom; j++) for (j=BltInfo->DestRect.top; j<BltInfo->DestRect.bottom; j++)
{ {
sx = SourcePoint->x; sx = BltInfo->SourcePoint.x;
for (i=DestRect->left; i<DestRect->right; i++) for (i=BltInfo->DestRect.left; i<BltInfo->DestRect.right; i++)
{ {
if(XLATEOBJ_iXlate(ColorTranslation, DIB_16BPP_GetPixel(SourceSurf, sx, sy)) == 0) if(XLATEOBJ_iXlate(BltInfo->XlateSourceToDest, DIB_16BPP_GetPixel(BltInfo->SourceSurface, sx, sy)) == 0)
{ {
DIB_1BPP_PutPixel(DestSurf, i, j, 0); DIB_1BPP_PutPixel(BltInfo->DestSurface, i, j, 0);
} else { } else {
DIB_1BPP_PutPixel(DestSurf, i, j, 1); DIB_1BPP_PutPixel(BltInfo->DestSurface, i, j, 1);
} }
sx++; sx++;
} }
@ -295,16 +292,16 @@ DIB_1BPP_BitBltSrcCopy(
break; break;
case BMF_24BPP: case BMF_24BPP:
for (j=DestRect->top; j<DestRect->bottom; j++) for (j=BltInfo->DestRect.top; j<BltInfo->DestRect.bottom; j++)
{ {
sx = SourcePoint->x; sx = BltInfo->SourcePoint.x;
for (i=DestRect->left; i<DestRect->right; i++) for (i=BltInfo->DestRect.left; i<BltInfo->DestRect.right; i++)
{ {
if(XLATEOBJ_iXlate(ColorTranslation, DIB_24BPP_GetPixel(SourceSurf, sx, sy)) == 0) if(XLATEOBJ_iXlate(BltInfo->XlateSourceToDest, DIB_24BPP_GetPixel(BltInfo->SourceSurface, sx, sy)) == 0)
{ {
DIB_1BPP_PutPixel(DestSurf, i, j, 0); DIB_1BPP_PutPixel(BltInfo->DestSurface, i, j, 0);
} else { } else {
DIB_1BPP_PutPixel(DestSurf, i, j, 1); DIB_1BPP_PutPixel(BltInfo->DestSurface, i, j, 1);
} }
sx++; sx++;
} }
@ -313,16 +310,16 @@ DIB_1BPP_BitBltSrcCopy(
break; break;
case BMF_32BPP: case BMF_32BPP:
for (j=DestRect->top; j<DestRect->bottom; j++) for (j=BltInfo->DestRect.top; j<BltInfo->DestRect.bottom; j++)
{ {
sx = SourcePoint->x; sx = BltInfo->SourcePoint.x;
for (i=DestRect->left; i<DestRect->right; i++) for (i=BltInfo->DestRect.left; i<BltInfo->DestRect.right; i++)
{ {
if(XLATEOBJ_iXlate(ColorTranslation, DIB_32BPP_GetPixel(SourceSurf, sx, sy)) == 0) if(XLATEOBJ_iXlate(BltInfo->XlateSourceToDest, DIB_32BPP_GetPixel(BltInfo->SourceSurface, sx, sy)) == 0)
{ {
DIB_1BPP_PutPixel(DestSurf, i, j, 0); DIB_1BPP_PutPixel(BltInfo->DestSurface, i, j, 0);
} else { } else {
DIB_1BPP_PutPixel(DestSurf, i, j, 1); DIB_1BPP_PutPixel(BltInfo->DestSurface, i, j, 1);
} }
sx++; sx++;
} }
@ -331,7 +328,7 @@ DIB_1BPP_BitBltSrcCopy(
break; break;
default: default:
DbgPrint("DIB_1BPP_BitBlt: Unhandled Source BPP: %u\n", BitsPerFormat(SourceSurf->iBitmapFormat)); DbgPrint("DIB_1BPP_BitBlt: Unhandled Source BPP: %u\n", BitsPerFormat(BltInfo->SourceSurface->iBitmapFormat));
return FALSE; return FALSE;
} }
@ -339,99 +336,70 @@ DIB_1BPP_BitBltSrcCopy(
} }
BOOLEAN BOOLEAN
DIB_1BPP_BitBlt( DIB_1BPP_BitBlt(PBLTINFO BltInfo)
SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
PRECTL DestRect, POINTL *SourcePoint,
BRUSHOBJ *Brush, POINTL BrushOrigin,
XLATEOBJ *ColorTranslation, ULONG Rop4)
{ {
ULONG X, Y, SourceX, SourceY, k; ULONG DestX, DestY;
ULONG SourceX, SourceY;
ULONG PatternY = 0;
ULONG Dest, Source = 0, Pattern = 0; ULONG Dest, Source = 0, Pattern = 0;
ULONG Index;
BOOLEAN UsesSource;
BOOLEAN UsesPattern;
PULONG DestBits; PULONG DestBits;
BOOL UsesSource;
BOOL UsesPattern;
ULONG RoundedRight; ULONG RoundedRight;
BYTE NoBits; /* BYTE NoBits;*/
/* Pattern brushes */
PGDIBRUSHOBJ GdiBrush = NULL;
HBITMAP PatternSurface = NULL;
SURFOBJ *PatternObj = NULL;
ULONG PatternWidth = 0, PatternHeight = 0, PatternY = 0;
if (Rop4 == SRCCOPY) UsesSource = ROP_USES_SOURCE(BltInfo->Rop4);
{ UsesPattern = ROP_USES_PATTERN(BltInfo->Rop4);
return DIB_1BPP_BitBltSrcCopy(
DestSurf,
SourceSurf,
DestRect,
SourcePoint,
ColorTranslation);
}
UsesSource = ((Rop4 & 0xCC0000) >> 2) != (Rop4 & 0x330000); RoundedRight = BltInfo->DestRect.right -
UsesPattern = (((Rop4 & 0xF00000) >> 4) != (Rop4 & 0x0F0000)) && Brush; ((BltInfo->DestRect.right - BltInfo->DestRect.left) & 31);
SourceY = BltInfo->SourcePoint.y;
if (UsesPattern) if (UsesPattern)
{ {
if (Brush->iSolidColor == 0xFFFFFFFF) if (BltInfo->PatternSurface)
{ {
PBITMAPOBJ PatternBitmap; PatternY = (BltInfo->DestRect.top + BltInfo->BrushOrigin.y) %
BltInfo->PatternSurface->sizlBitmap.cy;
GdiBrush = CONTAINING_RECORD(
Brush,
GDIBRUSHOBJ,
BrushObject);
PatternSurface = GdiBrush->hbmPattern;
PatternBitmap = BITMAPOBJ_LockBitmap(GdiBrush->hbmPattern);
PatternObj = &PatternBitmap->SurfObj;
PatternWidth = PatternObj->sizlBitmap.cx;
PatternHeight = PatternObj->sizlBitmap.cy;
UsesPattern = TRUE;
} }
else else
{ {
UsesPattern = FALSE; /* FIXME: Shouldn't it be expanded? */
Pattern = Brush->iSolidColor; Pattern = BltInfo->Brush->iSolidColor;
} }
} }
RoundedRight = DestRect->right - ((DestRect->right - DestRect->left) & 31); for (DestY = BltInfo->DestRect.top; DestY < BltInfo->DestRect.bottom; DestY++)
SourceY = SourcePoint->y;
for (Y = DestRect->top; Y < DestRect->bottom; Y++)
{ {
SourceX = SourcePoint->x; DestX = BltInfo->DestRect.left;
SourceX = BltInfo->SourcePoint.x;
DestBits = (PULONG)( DestBits = (PULONG)(
DestSurf->pvScan0 + BltInfo->DestSurface->pvScan0 +
(DestRect->left >> 3) + (BltInfo->DestRect.left >> 3) +
Y * DestSurf->lDelta); DestY * BltInfo->DestSurface->lDelta);
if(UsesPattern) if (DestX & 31)
PatternY = (Y + BrushOrigin.y) % PatternHeight;
X = DestRect->left;
if (X & 31)
{ {
#if 0
/* FIXME: This case is completely untested!!! */ /* FIXME: This case is completely untested!!! */
Dest = *((PBYTE)DestBits); Dest = *((PBYTE)DestBits);
NoBits = 31 - (X & 31); NoBits = 31 - (DestX & 31);
if (UsesSource) if (UsesSource)
{ {
Source = 0; Source = 0;
for (k = 31 - NoBits; k < NoBits; k++) /* FIXME: This is incorrect! */
Source |= (DIB_GetSource(SourceSurf, SourceX + k, SourceY, ColorTranslation) << (31 - k)); for (Index = 31 - NoBits; Index >= 0; Index++)
Source |= (DIB_GetSource(SourceSurf, SourceX + Index, SourceY, ColorTranslation) << (31 - Index));
} }
if (UsesPattern) if (BltInfo->PatternSurface)
{ {
Pattern = 0; Pattern = 0;
for (k = 31 - NoBits; k < NoBits; k++) for (k = 31 - NoBits; k >= 0; k++)
Pattern |= (DIB_1BPP_GetPixel(PatternObj, (X + BrushOrigin.x + k) % PatternWidth, PatternY) << (31 - k)); Pattern |= (DIB_GetSource(PatternObj, (X + BrushOrigin.x + k) % PatternWidth, PatternY, BltInfo->XlatePatternToDest) << (31 - k));
} }
Dest = DIB_DoRop(Rop4, Dest, Source, Pattern); Dest = DIB_DoRop(Rop4, Dest, Source, Pattern);
@ -440,69 +408,72 @@ DIB_1BPP_BitBlt(
*DestBits = Dest; *DestBits = Dest;
X += NoBits; DestX += NoBits;
SourceX += NoBits; SourceX += NoBits;
#endif
} }
for (; X < RoundedRight; X += 32, DestBits++, SourceX++) for (; DestX < RoundedRight; DestX += 32, DestBits++, SourceX++)
{ {
Dest = *DestBits; Dest = *DestBits;
if (UsesSource) if (UsesSource)
{ {
Source = 0; Source = 0;
for (k = 0; k < 8; k++) for (Index = 0; Index < 8; Index++)
{ {
Source |= (DIB_GetSource(SourceSurf, SourceX + k, SourceY, ColorTranslation) << (7 - k)); Source |= DIB_GetSource(BltInfo->SourceSurface, SourceX + Index, SourceY, BltInfo->XlateSourceToDest) << (7 - Index);
Source |= (DIB_GetSource(SourceSurf, SourceX + k + 8, SourceY, ColorTranslation) << (8 + (7 - k))); Source |= DIB_GetSource(BltInfo->SourceSurface, SourceX + Index + 8, SourceY, BltInfo->XlateSourceToDest) << (8 + (7 - Index));
Source |= (DIB_GetSource(SourceSurf, SourceX + k + 16, SourceY, ColorTranslation) << (16 + (7 - k))); Source |= DIB_GetSource(BltInfo->SourceSurface, SourceX + Index + 16, SourceY, BltInfo->XlateSourceToDest) << (16 + (7 - Index));
Source |= (DIB_GetSource(SourceSurf, SourceX + k + 24, SourceY, ColorTranslation) << (24 + (7 - k))); Source |= DIB_GetSource(BltInfo->SourceSurface, SourceX + Index + 24, SourceY, BltInfo->XlateSourceToDest) << (24 + (7 - Index));
} }
} }
if (UsesPattern) if (BltInfo->PatternSurface)
{ {
Pattern = 0; Pattern = 0;
for (k = 0; k < 8; k++) for (Index = 0; Index < 8; Index++)
{ {
Pattern |= (DIB_1BPP_GetPixel(PatternObj, (X + BrushOrigin.x + k) % PatternWidth, PatternY) << (7 - k)); Pattern |= DIB_GetSource(BltInfo->PatternSurface, (DestX + BltInfo->BrushOrigin.x + Index) % BltInfo->PatternSurface->sizlBitmap.cx, PatternY, BltInfo->XlatePatternToDest) << (7 - Index);
Pattern |= (DIB_1BPP_GetPixel(PatternObj, (X + BrushOrigin.x + k + 8) % PatternWidth, PatternY) << (8 + (7 - k))); Pattern |= DIB_GetSource(BltInfo->PatternSurface, (DestX + BltInfo->BrushOrigin.x + Index + 8) % BltInfo->PatternSurface->sizlBitmap.cx, PatternY, BltInfo->XlatePatternToDest) << (8 + (7 - Index));
Pattern |= (DIB_1BPP_GetPixel(PatternObj, (X + BrushOrigin.x + k + 16) % PatternWidth, PatternY) << (16 + (7 - k))); Pattern |= DIB_GetSource(BltInfo->PatternSurface, (DestX + BltInfo->BrushOrigin.x + Index + 16) % BltInfo->PatternSurface->sizlBitmap.cx, PatternY, BltInfo->XlatePatternToDest) << (16 + (7 - Index));
Pattern |= (DIB_1BPP_GetPixel(PatternObj, (X + BrushOrigin.x + k + 24) % PatternWidth, PatternY) << (24 + (7 - k))); Pattern |= DIB_GetSource(BltInfo->PatternSurface, (DestX + BltInfo->BrushOrigin.x + Index + 24) % BltInfo->PatternSurface->sizlBitmap.cx, PatternY, BltInfo->XlatePatternToDest) << (24 + (7 - Index));
} }
} }
*DestBits = DIB_DoRop(Rop4, Dest, Source, Pattern); *DestBits = DIB_DoRop(BltInfo->Rop4, Dest, Source, Pattern);
} }
if (X < DestRect->right) if (DestX < BltInfo->DestRect.right)
{ {
// Dest = *DestBits; // Dest = *DestBits;
for (; X < DestRect->right; X++, SourceX++) for (; DestX < BltInfo->DestRect.right; DestX++, SourceX++)
{ {
// Dest = *DestBits; // Dest = *DestBits;
Dest = DIB_1BPP_GetPixel(DestSurf, X, Y); Dest = DIB_1BPP_GetPixel(BltInfo->DestSurface, DestX, DestY);
if (UsesSource) if (UsesSource)
{ {
Source = DIB_GetSource(SourceSurf, SourceX, SourceY, ColorTranslation); Source = DIB_GetSource(BltInfo->SourceSurface, SourceX, SourceY, BltInfo->XlateSourceToDest);
} }
if (UsesPattern) if (BltInfo->PatternSurface)
{ {
Pattern = DIB_1BPP_GetPixel(PatternObj, (X + BrushOrigin.x) % PatternWidth, PatternY); Pattern = DIB_GetSource(BltInfo->PatternSurface, (DestX + BltInfo->BrushOrigin.x) % BltInfo->PatternSurface->sizlBitmap.cx, PatternY, BltInfo->XlatePatternToDest);
} }
DIB_1BPP_PutPixel(DestSurf, X, Y, DIB_DoRop(Rop4, Dest, Source, Pattern) & 0xF); DIB_1BPP_PutPixel(BltInfo->DestSurface, DestX, DestY, DIB_DoRop(BltInfo->Rop4, Dest, Source, Pattern) & 0xF);
// Dest >>= 1; // Dest >>= 1;
} }
} }
SourceY++; SourceY++;
if (BltInfo->PatternSurface)
{
PatternY++;
PatternY %= BltInfo->PatternSurface->sizlBitmap.cy;
}
} }
if (PatternSurface != NULL)
BITMAPOBJ_UnlockBitmap(PatternSurface);
return TRUE; return TRUE;
} }

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
/* $Id: dib24bpp.c,v 1.30 2004/07/03 17:40:24 navaraf Exp $ */ /* $Id: dib24bpp.c,v 1.31 2004/07/14 20:48:56 navaraf Exp $ */
#include <w32k.h> #include <w32k.h>
VOID VOID
@ -66,33 +66,31 @@ DIB_24BPP_VLine(SURFOBJ *SurfObj, LONG x, LONG y1, LONG y2, ULONG c)
} }
BOOLEAN BOOLEAN
DIB_24BPP_BitBltSrcCopy( SURFOBJ *DestSurf, SURFOBJ *SourceSurf, DIB_24BPP_BitBltSrcCopy(PBLTINFO BltInfo)
PRECTL DestRect, POINTL *SourcePoint,
XLATEOBJ *ColorTranslation)
{ {
LONG i, j, sx, sy, xColor, f1; LONG i, j, sx, sy, xColor, f1;
PBYTE SourceBits, DestBits, SourceLine, DestLine; PBYTE SourceBits, DestBits, SourceLine, DestLine;
PBYTE SourceBits_4BPP, SourceLine_4BPP; PBYTE SourceBits_4BPP, SourceLine_4BPP;
PWORD SourceBits_16BPP, SourceLine_16BPP; PWORD SourceBits_16BPP, SourceLine_16BPP;
DestBits = DestSurf->pvScan0 + (DestRect->top * DestSurf->lDelta) + DestRect->left * 3; DestBits = BltInfo->DestSurface->pvScan0 + (BltInfo->DestRect.top * BltInfo->DestSurface->lDelta) + BltInfo->DestRect.left * 3;
switch(SourceSurf->iBitmapFormat) switch(BltInfo->SourceSurface->iBitmapFormat)
{ {
case BMF_1BPP: case BMF_1BPP:
sx = SourcePoint->x; sx = BltInfo->SourcePoint.x;
sy = SourcePoint->y; sy = BltInfo->SourcePoint.y;
for (j=DestRect->top; j<DestRect->bottom; j++) for (j=BltInfo->DestRect.top; j<BltInfo->DestRect.bottom; j++)
{ {
sx = SourcePoint->x; sx = BltInfo->SourcePoint.x;
for (i=DestRect->left; i<DestRect->right; i++) for (i=BltInfo->DestRect.left; i<BltInfo->DestRect.right; i++)
{ {
if(DIB_1BPP_GetPixel(SourceSurf, sx, sy) == 0) if(DIB_1BPP_GetPixel(BltInfo->SourceSurface, sx, sy) == 0)
{ {
DIB_24BPP_PutPixel(DestSurf, i, j, XLATEOBJ_iXlate(ColorTranslation, 0)); DIB_24BPP_PutPixel(BltInfo->DestSurface, i, j, XLATEOBJ_iXlate(BltInfo->XlateSourceToDest, 0));
} else { } else {
DIB_24BPP_PutPixel(DestSurf, i, j, XLATEOBJ_iXlate(ColorTranslation, 1)); DIB_24BPP_PutPixel(BltInfo->DestSurface, i, j, XLATEOBJ_iXlate(BltInfo->XlateSourceToDest, 1));
} }
sx++; sx++;
} }
@ -101,18 +99,18 @@ DIB_24BPP_BitBltSrcCopy( SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
break; break;
case BMF_4BPP: case BMF_4BPP:
SourceBits_4BPP = SourceSurf->pvScan0 + (SourcePoint->y * SourceSurf->lDelta) + (SourcePoint->x >> 1); SourceBits_4BPP = BltInfo->SourceSurface->pvScan0 + (BltInfo->SourcePoint.y * BltInfo->SourceSurface->lDelta) + (BltInfo->SourcePoint.x >> 1);
for (j=DestRect->top; j<DestRect->bottom; j++) for (j=BltInfo->DestRect.top; j<BltInfo->DestRect.bottom; j++)
{ {
SourceLine_4BPP = SourceBits_4BPP; SourceLine_4BPP = SourceBits_4BPP;
DestLine = DestBits; DestLine = DestBits;
sx = SourcePoint->x; sx = BltInfo->SourcePoint.x;
f1 = sx & 1; f1 = sx & 1;
for (i=DestRect->left; i<DestRect->right; i++) for (i=BltInfo->DestRect.left; i<BltInfo->DestRect.right; i++)
{ {
xColor = XLATEOBJ_iXlate(ColorTranslation, xColor = XLATEOBJ_iXlate(BltInfo->XlateSourceToDest,
(*SourceLine_4BPP & altnotmask[f1]) >> (4 * (1 - f1))); (*SourceLine_4BPP & altnotmask[f1]) >> (4 * (1 - f1)));
*DestLine++ = xColor & 0xff; *DestLine++ = xColor & 0xff;
*(PWORD)DestLine = xColor >> 8; *(PWORD)DestLine = xColor >> 8;
@ -121,114 +119,114 @@ DIB_24BPP_BitBltSrcCopy( SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
sx++; sx++;
} }
SourceBits_4BPP += SourceSurf->lDelta; SourceBits_4BPP += BltInfo->SourceSurface->lDelta;
DestBits += DestSurf->lDelta; DestBits += BltInfo->DestSurface->lDelta;
} }
break; break;
case BMF_8BPP: case BMF_8BPP:
SourceLine = SourceSurf->pvScan0 + (SourcePoint->y * SourceSurf->lDelta) + SourcePoint->x; SourceLine = BltInfo->SourceSurface->pvScan0 + (BltInfo->SourcePoint.y * BltInfo->SourceSurface->lDelta) + BltInfo->SourcePoint.x;
DestLine = DestBits; DestLine = DestBits;
for (j = DestRect->top; j < DestRect->bottom; j++) for (j = BltInfo->DestRect.top; j < BltInfo->DestRect.bottom; j++)
{ {
SourceBits = SourceLine; SourceBits = SourceLine;
DestBits = DestLine; DestBits = DestLine;
for (i = DestRect->left; i < DestRect->right; i++) for (i = BltInfo->DestRect.left; i < BltInfo->DestRect.right; i++)
{ {
xColor = XLATEOBJ_iXlate(ColorTranslation, *SourceBits); xColor = XLATEOBJ_iXlate(BltInfo->XlateSourceToDest, *SourceBits);
*DestBits = xColor & 0xff; *DestBits = xColor & 0xff;
*(PWORD)(DestBits + 1) = xColor >> 8; *(PWORD)(DestBits + 1) = xColor >> 8;
SourceBits += 1; SourceBits += 1;
DestBits += 3; DestBits += 3;
} }
SourceLine += SourceSurf->lDelta; SourceLine += BltInfo->SourceSurface->lDelta;
DestLine += DestSurf->lDelta; DestLine += BltInfo->DestSurface->lDelta;
} }
break; break;
case BMF_16BPP: case BMF_16BPP:
SourceBits_16BPP = SourceSurf->pvScan0 + (SourcePoint->y * SourceSurf->lDelta) + 2 * SourcePoint->x; SourceBits_16BPP = BltInfo->SourceSurface->pvScan0 + (BltInfo->SourcePoint.y * BltInfo->SourceSurface->lDelta) + 2 * BltInfo->SourcePoint.x;
for (j=DestRect->top; j<DestRect->bottom; j++) for (j=BltInfo->DestRect.top; j<BltInfo->DestRect.bottom; j++)
{ {
SourceLine_16BPP = SourceBits_16BPP; SourceLine_16BPP = SourceBits_16BPP;
DestLine = DestBits; DestLine = DestBits;
for (i=DestRect->left; i<DestRect->right; i++) for (i=BltInfo->DestRect.left; i<BltInfo->DestRect.right; i++)
{ {
xColor = XLATEOBJ_iXlate(ColorTranslation, *SourceLine_16BPP); xColor = XLATEOBJ_iXlate(BltInfo->XlateSourceToDest, *SourceLine_16BPP);
*DestLine++ = xColor & 0xff; *DestLine++ = xColor & 0xff;
*(PWORD)DestLine = xColor >> 8; *(PWORD)DestLine = xColor >> 8;
DestLine += 2; DestLine += 2;
SourceLine_16BPP++; SourceLine_16BPP++;
} }
SourceBits_16BPP = (PWORD)((PBYTE)SourceBits_16BPP + SourceSurf->lDelta); SourceBits_16BPP = (PWORD)((PBYTE)SourceBits_16BPP + BltInfo->SourceSurface->lDelta);
DestBits += DestSurf->lDelta; DestBits += BltInfo->DestSurface->lDelta;
} }
break; break;
case BMF_24BPP: case BMF_24BPP:
if (NULL == ColorTranslation || 0 != (ColorTranslation->flXlate & XO_TRIVIAL)) if (NULL == BltInfo->XlateSourceToDest || 0 != (BltInfo->XlateSourceToDest->flXlate & XO_TRIVIAL))
{ {
if (DestRect->top < SourcePoint->y) if (BltInfo->DestRect.top < BltInfo->SourcePoint.y)
{ {
SourceBits = SourceSurf->pvScan0 + (SourcePoint->y * SourceSurf->lDelta) + 3 * SourcePoint->x; SourceBits = BltInfo->SourceSurface->pvScan0 + (BltInfo->SourcePoint.y * BltInfo->SourceSurface->lDelta) + 3 * BltInfo->SourcePoint.x;
for (j = DestRect->top; j < DestRect->bottom; j++) for (j = BltInfo->DestRect.top; j < BltInfo->DestRect.bottom; j++)
{ {
RtlMoveMemory(DestBits, SourceBits, 3 * (DestRect->right - DestRect->left)); RtlMoveMemory(DestBits, SourceBits, 3 * (BltInfo->DestRect.right - BltInfo->DestRect.left));
SourceBits += SourceSurf->lDelta; SourceBits += BltInfo->SourceSurface->lDelta;
DestBits += DestSurf->lDelta; DestBits += BltInfo->DestSurface->lDelta;
} }
} }
else else
{ {
SourceBits = SourceSurf->pvScan0 + ((SourcePoint->y + DestRect->bottom - DestRect->top - 1) * SourceSurf->lDelta) + 3 * SourcePoint->x; SourceBits = BltInfo->SourceSurface->pvScan0 + ((BltInfo->SourcePoint.y + BltInfo->DestRect.bottom - BltInfo->DestRect.top - 1) * BltInfo->SourceSurface->lDelta) + 3 * BltInfo->SourcePoint.x;
DestBits = DestSurf->pvScan0 + ((DestRect->bottom - 1) * DestSurf->lDelta) + 3 * DestRect->left; DestBits = BltInfo->DestSurface->pvScan0 + ((BltInfo->DestRect.bottom - 1) * BltInfo->DestSurface->lDelta) + 3 * BltInfo->DestRect.left;
for (j = DestRect->bottom - 1; DestRect->top <= j; j--) for (j = BltInfo->DestRect.bottom - 1; BltInfo->DestRect.top <= j; j--)
{ {
RtlMoveMemory(DestBits, SourceBits, 3 * (DestRect->right - DestRect->left)); RtlMoveMemory(DestBits, SourceBits, 3 * (BltInfo->DestRect.right - BltInfo->DestRect.left));
SourceBits -= SourceSurf->lDelta; SourceBits -= BltInfo->SourceSurface->lDelta;
DestBits -= DestSurf->lDelta; DestBits -= BltInfo->DestSurface->lDelta;
} }
} }
} }
else else
{ {
/* FIXME */ /* FIXME */
DPRINT1("DIB_24BPP_Bitblt: Unhandled ColorTranslation for 16 -> 16 copy\n"); DPRINT1("DIB_24BPP_Bitblt: Unhandled BltInfo->XlateSourceToDest for 16 -> 16 copy\n");
return FALSE; return FALSE;
} }
break; break;
case BMF_32BPP: case BMF_32BPP:
SourceLine = SourceSurf->pvScan0 + (SourcePoint->y * SourceSurf->lDelta) + 4 * SourcePoint->x; SourceLine = BltInfo->SourceSurface->pvScan0 + (BltInfo->SourcePoint.y * BltInfo->SourceSurface->lDelta) + 4 * BltInfo->SourcePoint.x;
DestLine = DestBits; DestLine = DestBits;
for (j = DestRect->top; j < DestRect->bottom; j++) for (j = BltInfo->DestRect.top; j < BltInfo->DestRect.bottom; j++)
{ {
SourceBits = SourceLine; SourceBits = SourceLine;
DestBits = DestLine; DestBits = DestLine;
for (i = DestRect->left; i < DestRect->right; i++) for (i = BltInfo->DestRect.left; i < BltInfo->DestRect.right; i++)
{ {
xColor = XLATEOBJ_iXlate(ColorTranslation, *((PDWORD) SourceBits)); xColor = XLATEOBJ_iXlate(BltInfo->XlateSourceToDest, *((PDWORD) SourceBits));
*DestBits = xColor & 0xff; *DestBits = xColor & 0xff;
*(PWORD)(DestBits + 1) = xColor >> 8; *(PWORD)(DestBits + 1) = xColor >> 8;
SourceBits += 4; SourceBits += 4;
DestBits += 3; DestBits += 3;
} }
SourceLine += SourceSurf->lDelta; SourceLine += BltInfo->SourceSurface->lDelta;
DestLine += DestSurf->lDelta; DestLine += BltInfo->DestSurface->lDelta;
} }
break; break;
default: default:
DbgPrint("DIB_24BPP_Bitblt: Unhandled Source BPP: %u\n", BitsPerFormat(SourceSurf->iBitmapFormat)); DbgPrint("DIB_24BPP_Bitblt: Unhandled Source BPP: %u\n", BitsPerFormat(BltInfo->SourceSurface->iBitmapFormat));
return FALSE; return FALSE;
} }
@ -236,102 +234,70 @@ DIB_24BPP_BitBltSrcCopy( SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
} }
BOOLEAN BOOLEAN
DIB_24BPP_BitBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf, DIB_24BPP_BitBlt(PBLTINFO BltInfo)
PRECTL DestRect, POINTL *SourcePoint,
BRUSHOBJ *Brush, POINTL BrushOrigin,
XLATEOBJ *ColorTranslation, ULONG Rop4)
{ {
ULONG X, Y; ULONG DestX, DestY;
ULONG SourceX, SourceY; ULONG SourceX, SourceY;
ULONG PatternY = 0;
ULONG Dest, Source = 0, Pattern = 0; ULONG Dest, Source = 0, Pattern = 0;
PBYTE DestBits;
BOOL UsesSource; BOOL UsesSource;
BOOL UsesPattern; BOOL UsesPattern;
/* Pattern brushes */ PBYTE DestBits;
PGDIBRUSHOBJ GdiBrush = NULL;
HBITMAP PatternSurface = NULL;
SURFOBJ *PatternObj = NULL;
ULONG PatternWidth = 0, PatternHeight = 0, PatternY = 0;
if (Rop4 == SRCCOPY) UsesSource = ROP_USES_SOURCE(BltInfo->Rop4);
{ UsesPattern = ROP_USES_PATTERN(BltInfo->Rop4);
return DIB_24BPP_BitBltSrcCopy(
DestSurf,
SourceSurf,
DestRect,
SourcePoint,
ColorTranslation);
}
UsesSource = ((Rop4 & 0xCC0000) >> 2) != (Rop4 & 0x330000); SourceY = BltInfo->SourcePoint.y;
UsesPattern = (((Rop4 & 0xF00000) >> 4) != (Rop4 & 0x0F0000)) && Brush; DestBits = (PBYTE)(
BltInfo->DestSurface->pvScan0 +
(BltInfo->DestRect.left << 1) + BltInfo->DestRect.left +
BltInfo->DestRect.top * BltInfo->DestSurface->lDelta);
if (UsesPattern) if (UsesPattern)
{ {
if (Brush->iSolidColor == 0xFFFFFFFF) if (BltInfo->PatternSurface)
{ {
PBITMAPOBJ PatternBitmap; PatternY = (BltInfo->DestRect.top + BltInfo->BrushOrigin.y) %
BltInfo->PatternSurface->sizlBitmap.cy;
GdiBrush = CONTAINING_RECORD(
Brush,
GDIBRUSHOBJ,
BrushObject);
PatternSurface = GdiBrush->hbmPattern;
PatternBitmap = BITMAPOBJ_LockBitmap(GdiBrush->hbmPattern);
PatternObj = &PatternBitmap->SurfObj;
PatternWidth = PatternObj->sizlBitmap.cx;
PatternHeight = PatternObj->sizlBitmap.cy;
UsesPattern = TRUE;
} }
else else
{ {
UsesPattern = FALSE; Pattern = BltInfo->Brush->iSolidColor;
Pattern = Brush->iSolidColor;
} }
} }
SourceY = SourcePoint->y; for (DestY = BltInfo->DestRect.top; DestY < BltInfo->DestRect.bottom; DestY++)
DestBits = (PBYTE)(
DestSurf->pvScan0 +
(DestRect->left << 1) + DestRect->left +
DestRect->top * DestSurf->lDelta);
for (Y = DestRect->top; Y < DestRect->bottom; Y++)
{ {
SourceX = SourcePoint->x; SourceX = BltInfo->SourcePoint.x;
if(UsesPattern) for (DestX = BltInfo->DestRect.left; DestX < BltInfo->DestRect.right; DestX++, DestBits += 3, SourceX++)
PatternY = (Y + BrushOrigin.y) % PatternHeight;
for (X = DestRect->left; X < DestRect->right; X++, DestBits += 3, SourceX++)
{ {
Dest = *((PUSHORT)DestBits) + (*(DestBits + 2) << 16); Dest = *((PUSHORT)DestBits) + (*(DestBits + 2) << 16);
if (UsesSource) if (UsesSource)
{ {
Source = DIB_GetSource(SourceSurf, SourceX, SourceY, ColorTranslation); Source = DIB_GetSource(BltInfo->SourceSurface, SourceX, SourceY, BltInfo->XlateSourceToDest);
} }
if (UsesPattern) if (BltInfo->PatternSurface)
{ {
Pattern = DIB_1BPP_GetPixel(PatternObj, (X + BrushOrigin.x) % PatternWidth, PatternY) ? GdiBrush->crFore : GdiBrush->crBack; Pattern = DIB_GetSource(BltInfo->PatternSurface, (DestX + BltInfo->BrushOrigin.x) % BltInfo->PatternSurface->sizlBitmap.cx, PatternY, BltInfo->XlatePatternToDest);
} }
Dest = DIB_DoRop(Rop4, Dest, Source, Pattern) & 0xFFFFFF; Dest = DIB_DoRop(BltInfo->Rop4, Dest, Source, Pattern) & 0xFFFFFF;
*(PUSHORT)(DestBits) = Dest & 0xFFFF; *(PUSHORT)(DestBits) = Dest & 0xFFFF;
*(DestBits + 2) = Dest >> 16; *(DestBits + 2) = Dest >> 16;
} }
SourceY++; SourceY++;
DestBits -= (DestRect->right - DestRect->left) * 3; if (BltInfo->PatternSurface)
DestBits += DestSurf->lDelta; {
PatternY++;
PatternY %= BltInfo->PatternSurface->sizlBitmap.cy;
}
DestBits -= (BltInfo->DestRect.right - BltInfo->DestRect.left) * 3;
DestBits += BltInfo->DestSurface->lDelta;
} }
if (PatternSurface != NULL)
BITMAPOBJ_UnlockBitmap(PatternSurface);
return TRUE; return TRUE;
} }

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
/* $Id: dib32bpp.c,v 1.29 2004/07/03 17:40:24 navaraf Exp $ */ /* $Id: dib32bpp.c,v 1.30 2004/07/14 20:48:56 navaraf Exp $ */
#include <w32k.h> #include <w32k.h>
VOID VOID
@ -67,33 +67,31 @@ DIB_32BPP_VLine(SURFOBJ *SurfObj, LONG x, LONG y1, LONG y2, ULONG c)
} }
BOOLEAN BOOLEAN
DIB_32BPP_BitBltSrcCopy(SURFOBJ *DestSurf, SURFOBJ *SourceSurf, DIB_32BPP_BitBltSrcCopy(PBLTINFO BltInfo)
PRECTL DestRect, POINTL *SourcePoint,
XLATEOBJ *ColorTranslation)
{ {
LONG i, j, sx, sy, xColor, f1; LONG i, j, sx, sy, xColor, f1;
PBYTE SourceBits, DestBits, SourceLine, DestLine; PBYTE SourceBits, DestBits, SourceLine, DestLine;
PBYTE SourceBits_4BPP, SourceLine_4BPP; PBYTE SourceBits_4BPP, SourceLine_4BPP;
PDWORD Source32, Dest32; PDWORD Source32, Dest32;
DestBits = DestSurf->pvScan0 + (DestRect->top * DestSurf->lDelta) + 4 * DestRect->left; DestBits = BltInfo->DestSurface->pvScan0 + (BltInfo->DestRect.top * BltInfo->DestSurface->lDelta) + 4 * BltInfo->DestRect.left;
switch(SourceSurf->iBitmapFormat) switch(BltInfo->SourceSurface->iBitmapFormat)
{ {
case BMF_1BPP: case BMF_1BPP:
sx = SourcePoint->x; sx = BltInfo->SourcePoint.x;
sy = SourcePoint->y; sy = BltInfo->SourcePoint.y;
for (j=DestRect->top; j<DestRect->bottom; j++) for (j=BltInfo->DestRect.top; j<BltInfo->DestRect.bottom; j++)
{ {
sx = SourcePoint->x; sx = BltInfo->SourcePoint.x;
for (i=DestRect->left; i<DestRect->right; i++) for (i=BltInfo->DestRect.left; i<BltInfo->DestRect.right; i++)
{ {
if(DIB_1BPP_GetPixel(SourceSurf, sx, sy) == 0) if(DIB_1BPP_GetPixel(BltInfo->SourceSurface, sx, sy) == 0)
{ {
DIB_32BPP_PutPixel(DestSurf, i, j, XLATEOBJ_iXlate(ColorTranslation, 0)); DIB_32BPP_PutPixel(BltInfo->DestSurface, i, j, XLATEOBJ_iXlate(BltInfo->XlateSourceToDest, 0));
} else { } else {
DIB_32BPP_PutPixel(DestSurf, i, j, XLATEOBJ_iXlate(ColorTranslation, 1)); DIB_32BPP_PutPixel(BltInfo->DestSurface, i, j, XLATEOBJ_iXlate(BltInfo->XlateSourceToDest, 1));
} }
sx++; sx++;
} }
@ -102,182 +100,182 @@ DIB_32BPP_BitBltSrcCopy(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
break; break;
case BMF_4BPP: case BMF_4BPP:
SourceBits_4BPP = SourceSurf->pvScan0 + (SourcePoint->y * SourceSurf->lDelta) + (SourcePoint->x >> 1); SourceBits_4BPP = BltInfo->SourceSurface->pvScan0 + (BltInfo->SourcePoint.y * BltInfo->SourceSurface->lDelta) + (BltInfo->SourcePoint.x >> 1);
for (j=DestRect->top; j<DestRect->bottom; j++) for (j=BltInfo->DestRect.top; j<BltInfo->DestRect.bottom; j++)
{ {
SourceLine_4BPP = SourceBits_4BPP; SourceLine_4BPP = SourceBits_4BPP;
sx = SourcePoint->x; sx = BltInfo->SourcePoint.x;
f1 = sx & 1; f1 = sx & 1;
for (i=DestRect->left; i<DestRect->right; i++) for (i=BltInfo->DestRect.left; i<BltInfo->DestRect.right; i++)
{ {
xColor = XLATEOBJ_iXlate(ColorTranslation, xColor = XLATEOBJ_iXlate(BltInfo->XlateSourceToDest,
(*SourceLine_4BPP & altnotmask[f1]) >> (4 * (1 - f1))); (*SourceLine_4BPP & altnotmask[f1]) >> (4 * (1 - f1)));
DIB_32BPP_PutPixel(DestSurf, i, j, xColor); DIB_32BPP_PutPixel(BltInfo->DestSurface, i, j, xColor);
if(f1 == 1) { SourceLine_4BPP++; f1 = 0; } else { f1 = 1; } if(f1 == 1) { SourceLine_4BPP++; f1 = 0; } else { f1 = 1; }
sx++; sx++;
} }
SourceBits_4BPP += SourceSurf->lDelta; SourceBits_4BPP += BltInfo->SourceSurface->lDelta;
} }
break; break;
case BMF_8BPP: case BMF_8BPP:
SourceLine = SourceSurf->pvScan0 + (SourcePoint->y * SourceSurf->lDelta) + SourcePoint->x; SourceLine = BltInfo->SourceSurface->pvScan0 + (BltInfo->SourcePoint.y * BltInfo->SourceSurface->lDelta) + BltInfo->SourcePoint.x;
DestLine = DestBits; DestLine = DestBits;
for (j = DestRect->top; j < DestRect->bottom; j++) for (j = BltInfo->DestRect.top; j < BltInfo->DestRect.bottom; j++)
{ {
SourceBits = SourceLine; SourceBits = SourceLine;
DestBits = DestLine; DestBits = DestLine;
for (i = DestRect->left; i < DestRect->right; i++) for (i = BltInfo->DestRect.left; i < BltInfo->DestRect.right; i++)
{ {
xColor = *SourceBits; xColor = *SourceBits;
*((PDWORD) DestBits) = (DWORD)XLATEOBJ_iXlate(ColorTranslation, xColor); *((PDWORD) DestBits) = (DWORD)XLATEOBJ_iXlate(BltInfo->XlateSourceToDest, xColor);
SourceBits += 1; SourceBits += 1;
DestBits += 4; DestBits += 4;
} }
SourceLine += SourceSurf->lDelta; SourceLine += BltInfo->SourceSurface->lDelta;
DestLine += DestSurf->lDelta; DestLine += BltInfo->DestSurface->lDelta;
} }
break; break;
case BMF_16BPP: case BMF_16BPP:
SourceLine = SourceSurf->pvScan0 + (SourcePoint->y * SourceSurf->lDelta) + 2 * SourcePoint->x; SourceLine = BltInfo->SourceSurface->pvScan0 + (BltInfo->SourcePoint.y * BltInfo->SourceSurface->lDelta) + 2 * BltInfo->SourcePoint.x;
DestLine = DestBits; DestLine = DestBits;
for (j = DestRect->top; j < DestRect->bottom; j++) for (j = BltInfo->DestRect.top; j < BltInfo->DestRect.bottom; j++)
{ {
SourceBits = SourceLine; SourceBits = SourceLine;
DestBits = DestLine; DestBits = DestLine;
for (i = DestRect->left; i < DestRect->right; i++) for (i = BltInfo->DestRect.left; i < BltInfo->DestRect.right; i++)
{ {
xColor = *((PWORD) SourceBits); xColor = *((PWORD) SourceBits);
*((PDWORD) DestBits) = (DWORD)XLATEOBJ_iXlate(ColorTranslation, xColor); *((PDWORD) DestBits) = (DWORD)XLATEOBJ_iXlate(BltInfo->XlateSourceToDest, xColor);
SourceBits += 2; SourceBits += 2;
DestBits += 4; DestBits += 4;
} }
SourceLine += SourceSurf->lDelta; SourceLine += BltInfo->SourceSurface->lDelta;
DestLine += DestSurf->lDelta; DestLine += BltInfo->DestSurface->lDelta;
} }
break; break;
case BMF_24BPP: case BMF_24BPP:
SourceLine = SourceSurf->pvScan0 + (SourcePoint->y * SourceSurf->lDelta) + 3 * SourcePoint->x; SourceLine = BltInfo->SourceSurface->pvScan0 + (BltInfo->SourcePoint.y * BltInfo->SourceSurface->lDelta) + 3 * BltInfo->SourcePoint.x;
DestLine = DestBits; DestLine = DestBits;
for (j = DestRect->top; j < DestRect->bottom; j++) for (j = BltInfo->DestRect.top; j < BltInfo->DestRect.bottom; j++)
{ {
SourceBits = SourceLine; SourceBits = SourceLine;
DestBits = DestLine; DestBits = DestLine;
for (i = DestRect->left; i < DestRect->right; i++) for (i = BltInfo->DestRect.left; i < BltInfo->DestRect.right; i++)
{ {
xColor = (*(SourceBits + 2) << 0x10) + xColor = (*(SourceBits + 2) << 0x10) +
(*(SourceBits + 1) << 0x08) + (*(SourceBits + 1) << 0x08) +
(*(SourceBits)); (*(SourceBits));
*((PDWORD)DestBits) = (DWORD)XLATEOBJ_iXlate(ColorTranslation, xColor); *((PDWORD)DestBits) = (DWORD)XLATEOBJ_iXlate(BltInfo->XlateSourceToDest, xColor);
SourceBits += 3; SourceBits += 3;
DestBits += 4; DestBits += 4;
} }
SourceLine += SourceSurf->lDelta; SourceLine += BltInfo->SourceSurface->lDelta;
DestLine += DestSurf->lDelta; DestLine += BltInfo->DestSurface->lDelta;
} }
break; break;
case BMF_32BPP: case BMF_32BPP:
if (NULL == ColorTranslation || 0 != (ColorTranslation->flXlate & XO_TRIVIAL)) if (NULL == BltInfo->XlateSourceToDest || 0 != (BltInfo->XlateSourceToDest->flXlate & XO_TRIVIAL))
{ {
if (DestRect->top < SourcePoint->y) if (BltInfo->DestRect.top < BltInfo->SourcePoint.y)
{ {
SourceBits = SourceSurf->pvScan0 + (SourcePoint->y * SourceSurf->lDelta) + 4 * SourcePoint->x; SourceBits = BltInfo->SourceSurface->pvScan0 + (BltInfo->SourcePoint.y * BltInfo->SourceSurface->lDelta) + 4 * BltInfo->SourcePoint.x;
for (j = DestRect->top; j < DestRect->bottom; j++) for (j = BltInfo->DestRect.top; j < BltInfo->DestRect.bottom; j++)
{ {
RtlMoveMemory(DestBits, SourceBits, 4 * (DestRect->right - DestRect->left)); RtlMoveMemory(DestBits, SourceBits, 4 * (BltInfo->DestRect.right - BltInfo->DestRect.left));
SourceBits += SourceSurf->lDelta; SourceBits += BltInfo->SourceSurface->lDelta;
DestBits += DestSurf->lDelta; DestBits += BltInfo->DestSurface->lDelta;
} }
} }
else else
{ {
SourceBits = SourceSurf->pvScan0 + ((SourcePoint->y + DestRect->bottom - DestRect->top - 1) * SourceSurf->lDelta) + 4 * SourcePoint->x; SourceBits = BltInfo->SourceSurface->pvScan0 + ((BltInfo->SourcePoint.y + BltInfo->DestRect.bottom - BltInfo->DestRect.top - 1) * BltInfo->SourceSurface->lDelta) + 4 * BltInfo->SourcePoint.x;
DestBits = DestSurf->pvScan0 + ((DestRect->bottom - 1) * DestSurf->lDelta) + 4 * DestRect->left; DestBits = BltInfo->DestSurface->pvScan0 + ((BltInfo->DestRect.bottom - 1) * BltInfo->DestSurface->lDelta) + 4 * BltInfo->DestRect.left;
for (j = DestRect->bottom - 1; DestRect->top <= j; j--) for (j = BltInfo->DestRect.bottom - 1; BltInfo->DestRect.top <= j; j--)
{ {
RtlMoveMemory(DestBits, SourceBits, 4 * (DestRect->right - DestRect->left)); RtlMoveMemory(DestBits, SourceBits, 4 * (BltInfo->DestRect.right - BltInfo->DestRect.left));
SourceBits -= SourceSurf->lDelta; SourceBits -= BltInfo->SourceSurface->lDelta;
DestBits -= DestSurf->lDelta; DestBits -= BltInfo->DestSurface->lDelta;
} }
} }
} }
else else
{ {
if (DestRect->top < SourcePoint->y) if (BltInfo->DestRect.top < BltInfo->SourcePoint.y)
{ {
SourceBits = (SourceSurf->pvScan0 + (SourcePoint->y * SourceSurf->lDelta) + 4 * SourcePoint->x); SourceBits = (BltInfo->SourceSurface->pvScan0 + (BltInfo->SourcePoint.y * BltInfo->SourceSurface->lDelta) + 4 * BltInfo->SourcePoint.x);
for (j = DestRect->top; j < DestRect->bottom; j++) for (j = BltInfo->DestRect.top; j < BltInfo->DestRect.bottom; j++)
{ {
if (DestRect->left < SourcePoint->x) if (BltInfo->DestRect.left < BltInfo->SourcePoint.x)
{ {
Dest32 = (DWORD *) DestBits; Dest32 = (DWORD *) DestBits;
Source32 = (DWORD *) SourceBits; Source32 = (DWORD *) SourceBits;
for (i = DestRect->left; i < DestRect->right; i++) for (i = BltInfo->DestRect.left; i < BltInfo->DestRect.right; i++)
{ {
*Dest32++ = XLATEOBJ_iXlate(ColorTranslation, *Source32++); *Dest32++ = XLATEOBJ_iXlate(BltInfo->XlateSourceToDest, *Source32++);
} }
} }
else else
{ {
Dest32 = (DWORD *) DestBits + (DestRect->right - DestRect->left - 1); Dest32 = (DWORD *) DestBits + (BltInfo->DestRect.right - BltInfo->DestRect.left - 1);
Source32 = (DWORD *) SourceBits + (DestRect->right - DestRect->left - 1); Source32 = (DWORD *) SourceBits + (BltInfo->DestRect.right - BltInfo->DestRect.left - 1);
for (i = DestRect->right - 1; DestRect->left <= i; i--) for (i = BltInfo->DestRect.right - 1; BltInfo->DestRect.left <= i; i--)
{ {
*Dest32-- = XLATEOBJ_iXlate(ColorTranslation, *Source32--); *Dest32-- = XLATEOBJ_iXlate(BltInfo->XlateSourceToDest, *Source32--);
} }
} }
SourceBits += SourceSurf->lDelta; SourceBits += BltInfo->SourceSurface->lDelta;
DestBits += DestSurf->lDelta; DestBits += BltInfo->DestSurface->lDelta;
} }
} }
else else
{ {
SourceBits = SourceSurf->pvScan0 + ((SourcePoint->y + DestRect->bottom - DestRect->top - 1) * SourceSurf->lDelta) + 4 * SourcePoint->x; SourceBits = BltInfo->SourceSurface->pvScan0 + ((BltInfo->SourcePoint.y + BltInfo->DestRect.bottom - BltInfo->DestRect.top - 1) * BltInfo->SourceSurface->lDelta) + 4 * BltInfo->SourcePoint.x;
DestBits = DestSurf->pvScan0 + ((DestRect->bottom - 1) * DestSurf->lDelta) + 4 * DestRect->left; DestBits = BltInfo->DestSurface->pvScan0 + ((BltInfo->DestRect.bottom - 1) * BltInfo->DestSurface->lDelta) + 4 * BltInfo->DestRect.left;
for (j = DestRect->bottom - 1; DestRect->top <= j; j--) for (j = BltInfo->DestRect.bottom - 1; BltInfo->DestRect.top <= j; j--)
{ {
if (DestRect->left < SourcePoint->x) if (BltInfo->DestRect.left < BltInfo->SourcePoint.x)
{ {
Dest32 = (DWORD *) DestBits; Dest32 = (DWORD *) DestBits;
Source32 = (DWORD *) SourceBits; Source32 = (DWORD *) SourceBits;
for (i = DestRect->left; i < DestRect->right; i++) for (i = BltInfo->DestRect.left; i < BltInfo->DestRect.right; i++)
{ {
*Dest32++ = XLATEOBJ_iXlate(ColorTranslation, *Source32++); *Dest32++ = XLATEOBJ_iXlate(BltInfo->XlateSourceToDest, *Source32++);
} }
} }
else else
{ {
Dest32 = (DWORD *) DestBits + (DestRect->right - DestRect->left - 1); Dest32 = (DWORD *) DestBits + (BltInfo->DestRect.right - BltInfo->DestRect.left - 1);
Source32 = (DWORD *) SourceBits + (DestRect->right - DestRect->left - 1); Source32 = (DWORD *) SourceBits + (BltInfo->DestRect.right - BltInfo->DestRect.left - 1);
for (i = DestRect->right; DestRect->left < i; i--) for (i = BltInfo->DestRect.right; BltInfo->DestRect.left < i; i--)
{ {
*Dest32-- = XLATEOBJ_iXlate(ColorTranslation, *Source32--); *Dest32-- = XLATEOBJ_iXlate(BltInfo->XlateSourceToDest, *Source32--);
} }
} }
SourceBits -= SourceSurf->lDelta; SourceBits -= BltInfo->SourceSurface->lDelta;
DestBits -= DestSurf->lDelta; DestBits -= BltInfo->DestSurface->lDelta;
} }
} }
} }
break; break;
default: default:
DPRINT1("DIB_32BPP_Bitblt: Unhandled Source BPP: %u\n", BitsPerFormat(SourceSurf->iBitmapFormat)); DPRINT1("DIB_32BPP_Bitblt: Unhandled Source BPP: %u\n", BitsPerFormat(BltInfo->SourceSurface->iBitmapFormat));
return FALSE; return FALSE;
} }
@ -285,101 +283,70 @@ DIB_32BPP_BitBltSrcCopy(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
} }
BOOLEAN BOOLEAN
DIB_32BPP_BitBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf, DIB_32BPP_BitBlt(PBLTINFO BltInfo)
PRECTL DestRect, POINTL *SourcePoint,
BRUSHOBJ *Brush, POINTL BrushOrigin,
XLATEOBJ *ColorTranslation, ULONG Rop4)
{ {
ULONG X, Y; ULONG DestX, DestY;
ULONG SourceX, SourceY; ULONG SourceX, SourceY;
ULONG Dest, Source = 0, Pattern = 0, wd; ULONG PatternY = 0;
PULONG DestBits; ULONG Dest, Source = 0, Pattern = 0;
BOOL UsesSource; BOOL UsesSource;
BOOL UsesPattern; BOOL UsesPattern;
/* Pattern brushes */ PULONG DestBits;
PGDIBRUSHOBJ GdiBrush = NULL;
HBITMAP PatternSurface = NULL;
SURFOBJ *PatternObj = NULL;
ULONG PatternWidth = 0, PatternHeight = 0, PatternY = 0;
if (Rop4 == SRCCOPY) UsesSource = ROP_USES_SOURCE(BltInfo->Rop4);
{ UsesPattern = ROP_USES_PATTERN(BltInfo->Rop4);
return DIB_32BPP_BitBltSrcCopy(
DestSurf,
SourceSurf,
DestRect,
SourcePoint,
ColorTranslation);
}
UsesSource = ((Rop4 & 0xCC0000) >> 2) != (Rop4 & 0x330000); SourceY = BltInfo->SourcePoint.y;
UsesPattern = (((Rop4 & 0xF00000) >> 4) != (Rop4 & 0x0F0000)) && Brush; DestBits = (PULONG)(
BltInfo->DestSurface->pvScan0 +
(BltInfo->DestRect.left << 2) +
BltInfo->DestRect.top * BltInfo->DestSurface->lDelta);
if (UsesPattern) if (UsesPattern)
{ {
if (Brush->iSolidColor == 0xFFFFFFFF) if (BltInfo->PatternSurface)
{ {
PBITMAPOBJ PatternBitmap; PatternY = (BltInfo->DestRect.top + BltInfo->BrushOrigin.y) %
BltInfo->PatternSurface->sizlBitmap.cy;
GdiBrush = CONTAINING_RECORD(
Brush,
GDIBRUSHOBJ,
BrushObject);
PatternSurface = GdiBrush->hbmPattern;
PatternBitmap = BITMAPOBJ_LockBitmap(GdiBrush->hbmPattern);
PatternObj = &PatternBitmap->SurfObj;
PatternWidth = PatternObj->sizlBitmap.cx;
PatternHeight = PatternObj->sizlBitmap.cy;
UsesPattern = TRUE;
} }
else else
{ {
UsesPattern = FALSE; Pattern = BltInfo->Brush->iSolidColor;
Pattern = Brush->iSolidColor;
} }
} }
SourceY = SourcePoint->y; for (DestY = BltInfo->DestRect.top; DestY < BltInfo->DestRect.bottom; DestY++)
DestBits = (PULONG)(
DestSurf->pvScan0 +
(DestRect->left << 2) +
DestRect->top * DestSurf->lDelta);
wd = ((DestRect->right - DestRect->left) << 2) - DestSurf->lDelta;
for (Y = DestRect->top; Y < DestRect->bottom; Y++)
{ {
SourceX = SourcePoint->x; SourceX = BltInfo->SourcePoint.x;
if(UsesPattern) for (DestX = BltInfo->DestRect.left; DestX < BltInfo->DestRect.right; DestX++, DestBits++, SourceX++)
PatternY = (Y + BrushOrigin.y) % PatternHeight;
for (X = DestRect->left; X < DestRect->right; X++, DestBits++, SourceX++)
{ {
Dest = *DestBits; Dest = *DestBits;
if (UsesSource) if (UsesSource)
{ {
Source = DIB_GetSource(SourceSurf, SourceX, SourceY, ColorTranslation); Source = DIB_GetSource(BltInfo->SourceSurface, SourceX, SourceY, BltInfo->XlateSourceToDest);
} }
if (UsesPattern) if (BltInfo->PatternSurface)
{ {
Pattern = DIB_1BPP_GetPixel(PatternObj, (X + BrushOrigin.x) % PatternWidth, PatternY) ? GdiBrush->crFore : GdiBrush->crBack; Pattern = DIB_GetSource(BltInfo->PatternSurface, (DestX + BltInfo->BrushOrigin.x) % BltInfo->PatternSurface->sizlBitmap.cx, PatternY, BltInfo->XlatePatternToDest);
} }
*DestBits = DIB_DoRop(Rop4, Dest, Source, Pattern); *DestBits = DIB_DoRop(BltInfo->Rop4, Dest, Source, Pattern);
} }
SourceY++; SourceY++;
DestBits = (PULONG)( if (BltInfo->PatternSurface)
(ULONG_PTR)DestBits - wd); {
PatternY++;
PatternY %= BltInfo->PatternSurface->sizlBitmap.cy;
}
DestBits = (PULONG)(
(ULONG_PTR)DestBits -
((BltInfo->DestRect.right - BltInfo->DestRect.left) << 2) -
BltInfo->DestSurface->lDelta);
} }
if (PatternSurface != NULL)
BITMAPOBJ_UnlockBitmap(PatternSurface);
return TRUE; return TRUE;
} }

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
/* $Id: dib4bpp.c,v 1.37 2004/07/03 17:40:24 navaraf Exp $ */ /* $Id: dib4bpp.c,v 1.38 2004/07/14 20:48:56 navaraf Exp $ */
#include <w32k.h> #include <w32k.h>
VOID VOID
@ -60,34 +60,34 @@ DIB_4BPP_VLine(SURFOBJ *SurfObj, LONG x, LONG y1, LONG y2, ULONG c)
} }
} }
BOOLEAN STATIC BOOLEAN
DIB_4BPP_BitBltSrcCopy(SURFOBJ *DestSurf, SURFOBJ *SourceSurf, DIB_4BPP_BitBltSrcCopy(PBLTINFO BltInfo)
PRECTL DestRect, POINTL *SourcePoint,
XLATEOBJ* ColorTranslation)
{ {
LONG i, j, sx, sy, f2, xColor; LONG i, j, sx, sy, f2, xColor;
PBYTE SourceBits_24BPP, SourceLine_24BPP; PBYTE SourceBits_24BPP, SourceLine_24BPP;
PBYTE DestBits, DestLine, SourceBits_8BPP, SourceLine_8BPP; PBYTE DestBits, DestLine, SourceBits_8BPP, SourceLine_8BPP;
PBYTE SourceBits, SourceLine; PBYTE SourceBits, SourceLine;
DestBits = DestSurf->pvScan0 + (DestRect->left>>1) + DestRect->top * DestSurf->lDelta; DestBits = BltInfo->DestSurface->pvScan0 +
(BltInfo->DestRect.left >> 1) +
BltInfo->DestRect.top * BltInfo->DestSurface->lDelta;
switch(SourceSurf->iBitmapFormat) switch (BltInfo->SourceSurface->iBitmapFormat)
{ {
case BMF_1BPP: case BMF_1BPP:
sx = SourcePoint->x; sx = BltInfo->SourcePoint.x;
sy = SourcePoint->y; sy = BltInfo->SourcePoint.y;
for (j=DestRect->top; j<DestRect->bottom; j++) for (j=BltInfo->DestRect.top; j<BltInfo->DestRect.bottom; j++)
{ {
sx = SourcePoint->x; sx = BltInfo->SourcePoint.x;
for (i=DestRect->left; i<DestRect->right; i++) for (i=BltInfo->DestRect.left; i<BltInfo->DestRect.right; i++)
{ {
if(DIB_1BPP_GetPixel(SourceSurf, sx, sy) == 0) if(DIB_1BPP_GetPixel(BltInfo->SourceSurface, sx, sy) == 0)
{ {
DIB_4BPP_PutPixel(DestSurf, i, j, XLATEOBJ_iXlate(ColorTranslation, 0)); DIB_4BPP_PutPixel(BltInfo->DestSurface, i, j, XLATEOBJ_iXlate(BltInfo->XlateSourceToDest, 0));
} else { } else {
DIB_4BPP_PutPixel(DestSurf, i, j, XLATEOBJ_iXlate(ColorTranslation, 1)); DIB_4BPP_PutPixel(BltInfo->DestSurface, i, j, XLATEOBJ_iXlate(BltInfo->XlateSourceToDest, 1));
} }
sx++; sx++;
} }
@ -96,21 +96,21 @@ DIB_4BPP_BitBltSrcCopy(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
break; break;
case BMF_4BPP: case BMF_4BPP:
sy = SourcePoint->y; sy = BltInfo->SourcePoint.y;
for (j=DestRect->top; j<DestRect->bottom; j++) for (j=BltInfo->DestRect.top; j<BltInfo->DestRect.bottom; j++)
{ {
sx = SourcePoint->x; sx = BltInfo->SourcePoint.x;
for (i=DestRect->left; i<DestRect->right; i++) for (i=BltInfo->DestRect.left; i<BltInfo->DestRect.right; i++)
{ {
if (NULL != ColorTranslation) if (NULL != BltInfo->XlateSourceToDest)
{ {
DIB_4BPP_PutPixel(DestSurf, i, j, XLATEOBJ_iXlate(ColorTranslation, DIB_4BPP_GetPixel(SourceSurf, sx, sy))); DIB_4BPP_PutPixel(BltInfo->DestSurface, i, j, XLATEOBJ_iXlate(BltInfo->XlateSourceToDest, DIB_4BPP_GetPixel(BltInfo->SourceSurface, sx, sy)));
} }
else else
{ {
DIB_4BPP_PutPixel(DestSurf, i, j, DIB_4BPP_GetPixel(SourceSurf, sx, sy)); DIB_4BPP_PutPixel(BltInfo->DestSurface, i, j, DIB_4BPP_GetPixel(BltInfo->SourceSurface, sx, sy));
} }
sx++; sx++;
} }
@ -119,124 +119,118 @@ DIB_4BPP_BitBltSrcCopy(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
break; break;
case BMF_8BPP: case BMF_8BPP:
SourceBits_8BPP = SourceSurf->pvScan0 + (SourcePoint->y * SourceSurf->lDelta) + SourcePoint->x; SourceBits_8BPP = BltInfo->SourceSurface->pvScan0 + (BltInfo->SourcePoint.y * BltInfo->SourceSurface->lDelta) + BltInfo->SourcePoint.x;
for (j=DestRect->top; j<DestRect->bottom; j++) for (j=BltInfo->DestRect.top; j<BltInfo->DestRect.bottom; j++)
{ {
SourceLine_8BPP = SourceBits_8BPP; SourceLine_8BPP = SourceBits_8BPP;
DestLine = DestBits; DestLine = DestBits;
f2 = DestRect->left & 1; f2 = BltInfo->DestRect.left & 1;
for (i=DestRect->left; i<DestRect->right; i++) for (i=BltInfo->DestRect.left; i<BltInfo->DestRect.right; i++)
{ {
*DestLine = (*DestLine & notmask[f2]) | *DestLine = (*DestLine & notmask[f2]) |
((XLATEOBJ_iXlate(ColorTranslation, *SourceLine_8BPP)) << ((4 * (1 - f2)))); ((XLATEOBJ_iXlate(BltInfo->XlateSourceToDest, *SourceLine_8BPP)) << ((4 * (1 - f2))));
if(f2 == 1) { DestLine++; f2 = 0; } else { f2 = 1; } if(f2 == 1) { DestLine++; f2 = 0; } else { f2 = 1; }
SourceLine_8BPP++; SourceLine_8BPP++;
} }
SourceBits_8BPP += SourceSurf->lDelta; SourceBits_8BPP += BltInfo->SourceSurface->lDelta;
DestBits += DestSurf->lDelta; DestBits += BltInfo->DestSurface->lDelta;
} }
break; break;
case BMF_16BPP: case BMF_16BPP:
SourceLine = SourceSurf->pvScan0 + (SourcePoint->y * SourceSurf->lDelta) + 2 * SourcePoint->x; SourceLine = BltInfo->SourceSurface->pvScan0 + (BltInfo->SourcePoint.y * BltInfo->SourceSurface->lDelta) + 2 * BltInfo->SourcePoint.x;
DestLine = DestBits; DestLine = DestBits;
for (j = DestRect->top; j < DestRect->bottom; j++) for (j = BltInfo->DestRect.top; j < BltInfo->DestRect.bottom; j++)
{ {
SourceBits = SourceLine; SourceBits = SourceLine;
DestBits = DestLine; DestBits = DestLine;
f2 = DestRect->left & 1; f2 = BltInfo->DestRect.left & 1;
for (i = DestRect->left; i < DestRect->right; i++) for (i = BltInfo->DestRect.left; i < BltInfo->DestRect.right; i++)
{ {
xColor = *((PWORD) SourceBits); xColor = *((PWORD) SourceBits);
*DestBits = (*DestBits & notmask[f2]) | *DestBits = (*DestBits & notmask[f2]) |
((XLATEOBJ_iXlate(ColorTranslation, xColor)) << ((4 * (1 - f2)))); ((XLATEOBJ_iXlate(BltInfo->XlateSourceToDest, xColor)) << ((4 * (1 - f2))));
if(f2 == 1) { DestBits++; f2 = 0; } else { f2 = 1; } if(f2 == 1) { DestBits++; f2 = 0; } else { f2 = 1; }
SourceBits += 2; SourceBits += 2;
} }
SourceLine += SourceSurf->lDelta; SourceLine += BltInfo->SourceSurface->lDelta;
DestLine += DestSurf->lDelta; DestLine += BltInfo->DestSurface->lDelta;
} }
break; break;
case BMF_24BPP: case BMF_24BPP:
SourceBits_24BPP = SourceSurf->pvScan0 + (SourcePoint->y * SourceSurf->lDelta) + SourcePoint->x * 3; SourceBits_24BPP = BltInfo->SourceSurface->pvScan0 + (BltInfo->SourcePoint.y * BltInfo->SourceSurface->lDelta) + BltInfo->SourcePoint.x * 3;
for (j=DestRect->top; j<DestRect->bottom; j++) for (j=BltInfo->DestRect.top; j<BltInfo->DestRect.bottom; j++)
{ {
SourceLine_24BPP = SourceBits_24BPP; SourceLine_24BPP = SourceBits_24BPP;
DestLine = DestBits; DestLine = DestBits;
f2 = DestRect->left & 1; f2 = BltInfo->DestRect.left & 1;
for (i=DestRect->left; i<DestRect->right; i++) for (i=BltInfo->DestRect.left; i<BltInfo->DestRect.right; i++)
{ {
xColor = (*(SourceLine_24BPP + 2) << 0x10) + xColor = (*(SourceLine_24BPP + 2) << 0x10) +
(*(SourceLine_24BPP + 1) << 0x08) + (*(SourceLine_24BPP + 1) << 0x08) +
(*(SourceLine_24BPP)); (*(SourceLine_24BPP));
*DestLine = (*DestLine & notmask[f2]) | *DestLine = (*DestLine & notmask[f2]) |
((XLATEOBJ_iXlate(ColorTranslation, xColor)) << ((4 * (1 - f2)))); ((XLATEOBJ_iXlate(BltInfo->XlateSourceToDest, xColor)) << ((4 * (1 - f2))));
if(f2 == 1) { DestLine++; f2 = 0; } else { f2 = 1; } if(f2 == 1) { DestLine++; f2 = 0; } else { f2 = 1; }
SourceLine_24BPP+=3; SourceLine_24BPP+=3;
} }
SourceBits_24BPP += SourceSurf->lDelta; SourceBits_24BPP += BltInfo->SourceSurface->lDelta;
DestBits += DestSurf->lDelta; DestBits += BltInfo->DestSurface->lDelta;
} }
break; break;
case BMF_32BPP: case BMF_32BPP:
SourceLine = SourceSurf->pvScan0 + (SourcePoint->y * SourceSurf->lDelta) + 4 * SourcePoint->x; SourceLine = BltInfo->SourceSurface->pvScan0 + (BltInfo->SourcePoint.y * BltInfo->SourceSurface->lDelta) + 4 * BltInfo->SourcePoint.x;
DestLine = DestBits; DestLine = DestBits;
for (j = DestRect->top; j < DestRect->bottom; j++) for (j = BltInfo->DestRect.top; j < BltInfo->DestRect.bottom; j++)
{ {
SourceBits = SourceLine; SourceBits = SourceLine;
DestBits = DestLine; DestBits = DestLine;
f2 = DestRect->left & 1; f2 = BltInfo->DestRect.left & 1;
for (i = DestRect->left; i < DestRect->right; i++) for (i = BltInfo->DestRect.left; i < BltInfo->DestRect.right; i++)
{ {
xColor = *((PDWORD) SourceBits); xColor = *((PDWORD) SourceBits);
*DestBits = (*DestBits & notmask[f2]) | *DestBits = (*DestBits & notmask[f2]) |
((XLATEOBJ_iXlate(ColorTranslation, xColor)) << ((4 * (1 - f2)))); ((XLATEOBJ_iXlate(BltInfo->XlateSourceToDest, xColor)) << ((4 * (1 - f2))));
if(f2 == 1) { DestBits++; f2 = 0; } else { f2 = 1; } if(f2 == 1) { DestBits++; f2 = 0; } else { f2 = 1; }
SourceBits += 4; SourceBits += 4;
} }
SourceLine += SourceSurf->lDelta; SourceLine += BltInfo->SourceSurface->lDelta;
DestLine += DestSurf->lDelta; DestLine += BltInfo->DestSurface->lDelta;
} }
break; break;
default: default:
DbgPrint("DIB_4BPP_Bitblt: Unhandled Source BPP: %u\n", BitsPerFormat(SourceSurf->iBitmapFormat)); DbgPrint("DIB_4BPP_Bitblt: Unhandled Source BPP: %u\n", BitsPerFormat(BltInfo->SourceSurface->iBitmapFormat));
return FALSE; return FALSE;
} }
return(TRUE); return(TRUE);
} }
BOOLEAN BOOLEAN
DIB_4BPP_BitBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf, DIB_4BPP_BitBlt(PBLTINFO BltInfo)
PRECTL DestRect, POINTL *SourcePoint,
BRUSHOBJ *Brush, POINTL BrushOrigin,
XLATEOBJ *ColorTranslation, ULONG Rop4)
{ {
LONG i, j, sx, sy; ULONG DestX, DestY;
ULONG SourceX, SourceY;
ULONG PatternY = 0;
ULONG Dest, Source = 0, Pattern = 0; ULONG Dest, Source = 0, Pattern = 0;
BOOLEAN UsesSource;
BOOLEAN UsesPattern;
PULONG DestBits; PULONG DestBits;
BOOL UsesSource;
BOOL UsesPattern;
LONG RoundedRight; LONG RoundedRight;
/* Pattern brushes */
PGDIBRUSHOBJ GdiBrush = NULL;
HBITMAP PatternSurface = NULL;
SURFOBJ *PatternObj = NULL;
ULONG PatternWidth = 0, PatternHeight = 0, PatternY = 0;
static const ULONG ExpandSolidColor[16] = static const ULONG ExpandSolidColor[16] =
{ {
0x00000000 /* 0 */, 0x00000000 /* 0 */,
@ -257,126 +251,107 @@ DIB_4BPP_BitBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
0xFFFFFFFF /* 15 */, 0xFFFFFFFF /* 15 */,
}; };
if (Rop4 == SRCCOPY) UsesSource = ROP_USES_SOURCE(BltInfo->Rop4);
{ UsesPattern = ROP_USES_PATTERN(BltInfo->Rop4);
return DIB_4BPP_BitBltSrcCopy(
DestSurf,
SourceSurf,
DestRect,
SourcePoint,
ColorTranslation);
}
UsesSource = ((Rop4 & 0xCC0000) >> 2) != (Rop4 & 0x330000); SourceY = BltInfo->SourcePoint.y;
UsesPattern = (((Rop4 & 0xF00000) >> 4) != (Rop4 & 0x0F0000)) && Brush; RoundedRight = BltInfo->DestRect.right -
((BltInfo->DestRect.right - BltInfo->DestRect.left) & 0x7);
if (UsesPattern) if (UsesPattern)
{ {
if (Brush->iSolidColor == 0xFFFFFFFF) if (BltInfo->PatternSurface)
{ {
PBITMAPOBJ PatternBitmap; PatternY = (BltInfo->DestRect.top + BltInfo->BrushOrigin.y) %
BltInfo->PatternSurface->sizlBitmap.cy;
GdiBrush = CONTAINING_RECORD(
Brush,
GDIBRUSHOBJ,
BrushObject);
PatternSurface = GdiBrush->hbmPattern;
PatternBitmap = BITMAPOBJ_LockBitmap(GdiBrush->hbmPattern);
PatternObj = &PatternBitmap->SurfObj;
PatternWidth = PatternObj->sizlBitmap.cx;
PatternHeight = PatternObj->sizlBitmap.cy;
UsesPattern = TRUE;
} }
else else
{ {
UsesPattern = FALSE; Pattern = ExpandSolidColor[BltInfo->Brush->iSolidColor];
Pattern = ExpandSolidColor[Brush->iSolidColor & 0xF];
} }
} }
sy = SourcePoint->y; for (DestY = BltInfo->DestRect.top; DestY < BltInfo->DestRect.bottom; DestY++)
RoundedRight = DestRect->right - ((DestRect->right - DestRect->left) & 0x7);
for (j = DestRect->top; j < DestRect->bottom; j++, sy++)
{ {
DestBits = (PULONG)(DestSurf->pvScan0 + (DestRect->left >> 1) + j * DestSurf->lDelta); DestBits = (PULONG)(
sx = SourcePoint->x; BltInfo->DestSurface->pvScan0 +
i = DestRect->left; (BltInfo->DestRect.left >> 1) +
DestY * BltInfo->DestSurface->lDelta);
SourceX = BltInfo->SourcePoint.x;
DestX = BltInfo->DestRect.left;
if (UsesPattern) if (DestX & 0x1)
PatternY = (j + BrushOrigin.y) % PatternHeight;
if (i & 0x1)
{ {
Dest = DIB_4BPP_GetPixel(DestSurf, i, j); Dest = DIB_4BPP_GetPixel(BltInfo->DestSurface, DestX, DestY);
if (UsesSource) if (UsesSource)
{ {
Source = DIB_GetSource(SourceSurf, sx, sy, ColorTranslation); Source = DIB_GetSource(BltInfo->SourceSurface, SourceX, SourceY, BltInfo->XlateSourceToDest);
} }
if (UsesPattern) if (BltInfo->PatternSurface)
{ {
Pattern = DIB_1BPP_GetPixel(PatternObj, (i + BrushOrigin.x) % PatternWidth, PatternY) ? GdiBrush->crFore : GdiBrush->crBack; Pattern = DIB_GetSource(BltInfo->PatternSurface, (DestX + BltInfo->BrushOrigin.x) % BltInfo->PatternSurface->sizlBitmap.cx, PatternY, BltInfo->XlatePatternToDest);
} }
DIB_4BPP_PutPixel(DestSurf, i, j, DIB_DoRop(Rop4, Dest, Source, Pattern) & 0xF); DIB_4BPP_PutPixel(BltInfo->DestSurface, DestX, DestY, DIB_DoRop(BltInfo->Rop4, Dest, Source, Pattern) & 0xF);
i++; DestX++;
sx++; SourceX++;
DestBits = (PULONG)((ULONG_PTR)DestBits + 1); DestBits = (PULONG)((ULONG_PTR)DestBits + 1);
} }
for (; i < RoundedRight; i += 8, sx += 8, DestBits++) for (; DestX < RoundedRight; DestX += 8, SourceX += 8, DestBits++)
{ {
Dest = *DestBits; Dest = *DestBits;
if (UsesSource) if (UsesSource)
{ {
Source = Source =
(DIB_GetSource(SourceSurf, sx + 1, sy, ColorTranslation)) | (DIB_GetSource(BltInfo->SourceSurface, SourceX + 1, SourceY, BltInfo->XlateSourceToDest)) |
(DIB_GetSource(SourceSurf, sx + 0, sy, ColorTranslation) << 4) | (DIB_GetSource(BltInfo->SourceSurface, SourceX + 0, SourceY, BltInfo->XlateSourceToDest) << 4) |
(DIB_GetSource(SourceSurf, sx + 3, sy, ColorTranslation) << 8) | (DIB_GetSource(BltInfo->SourceSurface, SourceX + 3, SourceY, BltInfo->XlateSourceToDest) << 8) |
(DIB_GetSource(SourceSurf, sx + 2, sy, ColorTranslation) << 12) | (DIB_GetSource(BltInfo->SourceSurface, SourceX + 2, SourceY, BltInfo->XlateSourceToDest) << 12) |
(DIB_GetSource(SourceSurf, sx + 5, sy, ColorTranslation) << 16) | (DIB_GetSource(BltInfo->SourceSurface, SourceX + 5, SourceY, BltInfo->XlateSourceToDest) << 16) |
(DIB_GetSource(SourceSurf, sx + 4, sy, ColorTranslation) << 20) | (DIB_GetSource(BltInfo->SourceSurface, SourceX + 4, SourceY, BltInfo->XlateSourceToDest) << 20) |
(DIB_GetSource(SourceSurf, sx + 7, sy, ColorTranslation) << 24) | (DIB_GetSource(BltInfo->SourceSurface, SourceX + 7, SourceY, BltInfo->XlateSourceToDest) << 24) |
(DIB_GetSource(SourceSurf, sx + 6, sy, ColorTranslation) << 28); (DIB_GetSource(BltInfo->SourceSurface, SourceX + 6, SourceY, BltInfo->XlateSourceToDest) << 28);
} }
if (UsesPattern) if (BltInfo->PatternSurface)
{ {
Pattern = DIB_1BPP_GetPixel(PatternObj, (i + BrushOrigin.x + 1) % PatternWidth, PatternY) ? GdiBrush->crFore : GdiBrush->crBack; Pattern = DIB_GetSource(BltInfo->PatternSurface, (DestX + BltInfo->BrushOrigin.x + 1) % BltInfo->PatternSurface->sizlBitmap.cx, PatternY, BltInfo->XlatePatternToDest);
Pattern |= (DIB_1BPP_GetPixel(PatternObj, (i + BrushOrigin.x + 0) % PatternWidth, PatternY) ? GdiBrush->crFore : GdiBrush->crBack) << 4; Pattern |= DIB_GetSource(BltInfo->PatternSurface, (DestX + BltInfo->BrushOrigin.x + 0) % BltInfo->PatternSurface->sizlBitmap.cx, PatternY, BltInfo->XlatePatternToDest) << 4;
Pattern |= (DIB_1BPP_GetPixel(PatternObj, (i + BrushOrigin.x + 3) % PatternWidth, PatternY) ? GdiBrush->crFore : GdiBrush->crBack) << 8; Pattern |= DIB_GetSource(BltInfo->PatternSurface, (DestX + BltInfo->BrushOrigin.x + 3) % BltInfo->PatternSurface->sizlBitmap.cx, PatternY, BltInfo->XlatePatternToDest) << 8;
Pattern |= (DIB_1BPP_GetPixel(PatternObj, (i + BrushOrigin.x + 2) % PatternWidth, PatternY) ? GdiBrush->crFore : GdiBrush->crBack) << 12; Pattern |= DIB_GetSource(BltInfo->PatternSurface, (DestX + BltInfo->BrushOrigin.x + 2) % BltInfo->PatternSurface->sizlBitmap.cx, PatternY, BltInfo->XlatePatternToDest) << 12;
Pattern |= (DIB_1BPP_GetPixel(PatternObj, (i + BrushOrigin.x + 5) % PatternWidth, PatternY) ? GdiBrush->crFore : GdiBrush->crBack) << 16; Pattern |= DIB_GetSource(BltInfo->PatternSurface, (DestX + BltInfo->BrushOrigin.x + 5) % BltInfo->PatternSurface->sizlBitmap.cx, PatternY, BltInfo->XlatePatternToDest) << 16;
Pattern |= (DIB_1BPP_GetPixel(PatternObj, (i + BrushOrigin.x + 4) % PatternWidth, PatternY) ? GdiBrush->crFore : GdiBrush->crBack) << 20; Pattern |= DIB_GetSource(BltInfo->PatternSurface, (DestX + BltInfo->BrushOrigin.x + 4) % BltInfo->PatternSurface->sizlBitmap.cx, PatternY, BltInfo->XlatePatternToDest) << 20;
Pattern |= (DIB_1BPP_GetPixel(PatternObj, (i + BrushOrigin.x + 7) % PatternWidth, PatternY) ? GdiBrush->crFore : GdiBrush->crBack) << 24; Pattern |= DIB_GetSource(BltInfo->PatternSurface, (DestX + BltInfo->BrushOrigin.x + 7) % BltInfo->PatternSurface->sizlBitmap.cx, PatternY, BltInfo->XlatePatternToDest) << 24;
Pattern |= (DIB_1BPP_GetPixel(PatternObj, (i + BrushOrigin.x + 6) % PatternWidth, PatternY) ? GdiBrush->crFore : GdiBrush->crBack) << 28; Pattern |= DIB_GetSource(BltInfo->PatternSurface, (DestX + BltInfo->BrushOrigin.x + 6) % BltInfo->PatternSurface->sizlBitmap.cx, PatternY, BltInfo->XlatePatternToDest) << 28;
} }
*DestBits = DIB_DoRop(Rop4, Dest, Source, Pattern); *DestBits = DIB_DoRop(BltInfo->Rop4, Dest, Source, Pattern);
} }
/* Process the rest of pixel on the line */ /* Process the rest of pixel on the line */
for (; i < DestRect->right; i++, sx++) for (; DestX < BltInfo->DestRect.right; DestX++, SourceX++)
{ {
Dest = DIB_4BPP_GetPixel(DestSurf, i, j); Dest = DIB_4BPP_GetPixel(BltInfo->DestSurface, DestX, DestY);
if (UsesSource) if (UsesSource)
{ {
Source = DIB_GetSource(SourceSurf, sx, sy, ColorTranslation); Source = DIB_GetSource(BltInfo->SourceSurface, SourceX, SourceY, BltInfo->XlateSourceToDest);
} }
if (UsesPattern) if (BltInfo->PatternSurface)
{ {
Pattern = DIB_1BPP_GetPixel(PatternObj, (i + BrushOrigin.x) % PatternWidth, PatternY) ? GdiBrush->crFore : GdiBrush->crBack; Pattern = DIB_GetSource(BltInfo->PatternSurface, (DestX + BltInfo->BrushOrigin.x) % BltInfo->PatternSurface->sizlBitmap.cx, PatternY, BltInfo->XlatePatternToDest);
}
DIB_4BPP_PutPixel(DestSurf, i, j, DIB_DoRop(Rop4, Dest, Source, Pattern) & 0xF);
} }
DIB_4BPP_PutPixel(BltInfo->DestSurface, DestX, DestY, DIB_DoRop(BltInfo->Rop4, Dest, Source, Pattern) & 0xF);
} }
if (PatternSurface != NULL) SourceY++;
BITMAPOBJ_UnlockBitmap(PatternSurface); if (BltInfo->PatternSurface)
{
PatternY++;
PatternY %= BltInfo->PatternSurface->sizlBitmap.cy;
}
}
return TRUE; return TRUE;
} }

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
/* $Id: dib8bpp.c,v 1.28 2004/07/03 17:40:24 navaraf Exp $ */ /* $Id: dib8bpp.c,v 1.29 2004/07/14 20:48:56 navaraf Exp $ */
#include <w32k.h> #include <w32k.h>
VOID VOID
@ -65,32 +65,30 @@ DIB_8BPP_VLine(SURFOBJ *SurfObj, LONG x, LONG y1, LONG y2, ULONG c)
} }
BOOLEAN BOOLEAN
DIB_8BPP_BitBltSrcCopy(SURFOBJ *DestSurf, SURFOBJ *SourceSurf, DIB_8BPP_BitBltSrcCopy(PBLTINFO BltInfo)
PRECTL DestRect, POINTL *SourcePoint,
XLATEOBJ *ColorTranslation)
{ {
LONG i, j, sx, sy, xColor, f1; LONG i, j, sx, sy, xColor, f1;
PBYTE SourceBits, DestBits, SourceLine, DestLine; PBYTE SourceBits, DestBits, SourceLine, DestLine;
PBYTE SourceBits_4BPP, SourceLine_4BPP; PBYTE SourceBits_4BPP, SourceLine_4BPP;
DestBits = DestSurf->pvScan0 + (DestRect->top * DestSurf->lDelta) + DestRect->left; DestBits = BltInfo->DestSurface->pvScan0 + (BltInfo->DestRect.top * BltInfo->DestSurface->lDelta) + BltInfo->DestRect.left;
switch(SourceSurf->iBitmapFormat) switch(BltInfo->SourceSurface->iBitmapFormat)
{ {
case BMF_1BPP: case BMF_1BPP:
sx = SourcePoint->x; sx = BltInfo->SourcePoint.x;
sy = SourcePoint->y; sy = BltInfo->SourcePoint.y;
for (j=DestRect->top; j<DestRect->bottom; j++) for (j=BltInfo->DestRect.top; j<BltInfo->DestRect.bottom; j++)
{ {
sx = SourcePoint->x; sx = BltInfo->SourcePoint.x;
for (i=DestRect->left; i<DestRect->right; i++) for (i=BltInfo->DestRect.left; i<BltInfo->DestRect.right; i++)
{ {
if(DIB_1BPP_GetPixel(SourceSurf, sx, sy) == 0) if(DIB_1BPP_GetPixel(BltInfo->SourceSurface, sx, sy) == 0)
{ {
DIB_8BPP_PutPixel(DestSurf, i, j, XLATEOBJ_iXlate(ColorTranslation, 0)); DIB_8BPP_PutPixel(BltInfo->DestSurface, i, j, XLATEOBJ_iXlate(BltInfo->XlateSourceToDest, 0));
} else { } else {
DIB_8BPP_PutPixel(DestSurf, i, j, XLATEOBJ_iXlate(ColorTranslation, 1)); DIB_8BPP_PutPixel(BltInfo->DestSurface, i, j, XLATEOBJ_iXlate(BltInfo->XlateSourceToDest, 1));
} }
sx++; sx++;
} }
@ -99,159 +97,159 @@ DIB_8BPP_BitBltSrcCopy(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
break; break;
case BMF_4BPP: case BMF_4BPP:
SourceBits_4BPP = SourceSurf->pvScan0 + (SourcePoint->y * SourceSurf->lDelta) + (SourcePoint->x >> 1); SourceBits_4BPP = BltInfo->SourceSurface->pvScan0 + (BltInfo->SourcePoint.y * BltInfo->SourceSurface->lDelta) + (BltInfo->SourcePoint.x >> 1);
for (j=DestRect->top; j<DestRect->bottom; j++) for (j=BltInfo->DestRect.top; j<BltInfo->DestRect.bottom; j++)
{ {
SourceLine_4BPP = SourceBits_4BPP; SourceLine_4BPP = SourceBits_4BPP;
sx = SourcePoint->x; sx = BltInfo->SourcePoint.x;
f1 = sx & 1; f1 = sx & 1;
for (i=DestRect->left; i<DestRect->right; i++) for (i=BltInfo->DestRect.left; i<BltInfo->DestRect.right; i++)
{ {
xColor = XLATEOBJ_iXlate(ColorTranslation, xColor = XLATEOBJ_iXlate(BltInfo->XlateSourceToDest,
(*SourceLine_4BPP & altnotmask[f1]) >> (4 * (1 - f1))); (*SourceLine_4BPP & altnotmask[f1]) >> (4 * (1 - f1)));
DIB_8BPP_PutPixel(DestSurf, i, j, xColor); DIB_8BPP_PutPixel(BltInfo->DestSurface, i, j, xColor);
if(f1 == 1) { SourceLine_4BPP++; f1 = 0; } else { f1 = 1; } if(f1 == 1) { SourceLine_4BPP++; f1 = 0; } else { f1 = 1; }
sx++; sx++;
} }
SourceBits_4BPP += SourceSurf->lDelta; SourceBits_4BPP += BltInfo->SourceSurface->lDelta;
} }
break; break;
case BMF_8BPP: case BMF_8BPP:
if (NULL == ColorTranslation || 0 != (ColorTranslation->flXlate & XO_TRIVIAL)) if (NULL == BltInfo->XlateSourceToDest || 0 != (BltInfo->XlateSourceToDest->flXlate & XO_TRIVIAL))
{ {
if (DestRect->top < SourcePoint->y) if (BltInfo->DestRect.top < BltInfo->SourcePoint.y)
{ {
SourceBits = SourceSurf->pvScan0 + (SourcePoint->y * SourceSurf->lDelta) + SourcePoint->x; SourceBits = BltInfo->SourceSurface->pvScan0 + (BltInfo->SourcePoint.y * BltInfo->SourceSurface->lDelta) + BltInfo->SourcePoint.x;
for (j = DestRect->top; j < DestRect->bottom; j++) for (j = BltInfo->DestRect.top; j < BltInfo->DestRect.bottom; j++)
{ {
RtlMoveMemory(DestBits, SourceBits, DestRect->right - DestRect->left); RtlMoveMemory(DestBits, SourceBits, BltInfo->DestRect.right - BltInfo->DestRect.left);
SourceBits += SourceSurf->lDelta; SourceBits += BltInfo->SourceSurface->lDelta;
DestBits += DestSurf->lDelta; DestBits += BltInfo->DestSurface->lDelta;
} }
} }
else else
{ {
SourceBits = SourceSurf->pvScan0 + ((SourcePoint->y + DestRect->bottom - DestRect->top - 1) * SourceSurf->lDelta) + SourcePoint->x; SourceBits = BltInfo->SourceSurface->pvScan0 + ((BltInfo->SourcePoint.y + BltInfo->DestRect.bottom - BltInfo->DestRect.top - 1) * BltInfo->SourceSurface->lDelta) + BltInfo->SourcePoint.x;
DestBits = DestSurf->pvScan0 + ((DestRect->bottom - 1) * DestSurf->lDelta) + DestRect->left; DestBits = BltInfo->DestSurface->pvScan0 + ((BltInfo->DestRect.bottom - 1) * BltInfo->DestSurface->lDelta) + BltInfo->DestRect.left;
for (j = DestRect->bottom - 1; DestRect->top <= j; j--) for (j = BltInfo->DestRect.bottom - 1; BltInfo->DestRect.top <= j; j--)
{ {
RtlMoveMemory(DestBits, SourceBits, DestRect->right - DestRect->left); RtlMoveMemory(DestBits, SourceBits, BltInfo->DestRect.right - BltInfo->DestRect.left);
SourceBits -= SourceSurf->lDelta; SourceBits -= BltInfo->SourceSurface->lDelta;
DestBits -= DestSurf->lDelta; DestBits -= BltInfo->DestSurface->lDelta;
} }
} }
} }
else else
{ {
if (DestRect->top < SourcePoint->y) if (BltInfo->DestRect.top < BltInfo->SourcePoint.y)
{ {
SourceLine = SourceSurf->pvScan0 + (SourcePoint->y * SourceSurf->lDelta) + SourcePoint->x; SourceLine = BltInfo->SourceSurface->pvScan0 + (BltInfo->SourcePoint.y * BltInfo->SourceSurface->lDelta) + BltInfo->SourcePoint.x;
DestLine = DestBits; DestLine = DestBits;
for (j = DestRect->top; j < DestRect->bottom; j++) for (j = BltInfo->DestRect.top; j < BltInfo->DestRect.bottom; j++)
{ {
SourceBits = SourceLine; SourceBits = SourceLine;
DestBits = DestLine; DestBits = DestLine;
for (i=DestRect->left; i<DestRect->right; i++) for (i=BltInfo->DestRect.left; i<BltInfo->DestRect.right; i++)
{ {
*DestBits++ = XLATEOBJ_iXlate(ColorTranslation, *SourceBits++); *DestBits++ = XLATEOBJ_iXlate(BltInfo->XlateSourceToDest, *SourceBits++);
} }
SourceLine += SourceSurf->lDelta; SourceLine += BltInfo->SourceSurface->lDelta;
DestLine += DestSurf->lDelta; DestLine += BltInfo->DestSurface->lDelta;
} }
} }
else else
{ {
SourceLine = SourceSurf->pvScan0 + ((SourcePoint->y + DestRect->bottom - DestRect->top - 1) * SourceSurf->lDelta) + SourcePoint->x; SourceLine = BltInfo->SourceSurface->pvScan0 + ((BltInfo->SourcePoint.y + BltInfo->DestRect.bottom - BltInfo->DestRect.top - 1) * BltInfo->SourceSurface->lDelta) + BltInfo->SourcePoint.x;
DestLine = DestSurf->pvScan0 + ((DestRect->bottom - 1) * DestSurf->lDelta) + DestRect->left; DestLine = BltInfo->DestSurface->pvScan0 + ((BltInfo->DestRect.bottom - 1) * BltInfo->DestSurface->lDelta) + BltInfo->DestRect.left;
for (j = DestRect->bottom - 1; DestRect->top <= j; j--) for (j = BltInfo->DestRect.bottom - 1; BltInfo->DestRect.top <= j; j--)
{ {
SourceBits = SourceLine; SourceBits = SourceLine;
DestBits = DestLine; DestBits = DestLine;
for (i=DestRect->left; i<DestRect->right; i++) for (i=BltInfo->DestRect.left; i<BltInfo->DestRect.right; i++)
{ {
*DestBits++ = XLATEOBJ_iXlate(ColorTranslation, *SourceBits++); *DestBits++ = XLATEOBJ_iXlate(BltInfo->XlateSourceToDest, *SourceBits++);
} }
SourceLine -= SourceSurf->lDelta; SourceLine -= BltInfo->SourceSurface->lDelta;
DestLine -= DestSurf->lDelta; DestLine -= BltInfo->DestSurface->lDelta;
} }
} }
} }
break; break;
case BMF_16BPP: case BMF_16BPP:
SourceLine = SourceSurf->pvScan0 + (SourcePoint->y * SourceSurf->lDelta) + 2 * SourcePoint->x; SourceLine = BltInfo->SourceSurface->pvScan0 + (BltInfo->SourcePoint.y * BltInfo->SourceSurface->lDelta) + 2 * BltInfo->SourcePoint.x;
DestLine = DestBits; DestLine = DestBits;
for (j = DestRect->top; j < DestRect->bottom; j++) for (j = BltInfo->DestRect.top; j < BltInfo->DestRect.bottom; j++)
{ {
SourceBits = SourceLine; SourceBits = SourceLine;
DestBits = DestLine; DestBits = DestLine;
for (i = DestRect->left; i < DestRect->right; i++) for (i = BltInfo->DestRect.left; i < BltInfo->DestRect.right; i++)
{ {
xColor = *((PWORD) SourceBits); xColor = *((PWORD) SourceBits);
*DestBits = XLATEOBJ_iXlate(ColorTranslation, xColor); *DestBits = XLATEOBJ_iXlate(BltInfo->XlateSourceToDest, xColor);
SourceBits += 2; SourceBits += 2;
DestBits += 1; DestBits += 1;
} }
SourceLine += SourceSurf->lDelta; SourceLine += BltInfo->SourceSurface->lDelta;
DestLine += DestSurf->lDelta; DestLine += BltInfo->DestSurface->lDelta;
} }
break; break;
case BMF_24BPP: case BMF_24BPP:
SourceLine = SourceSurf->pvScan0 + (SourcePoint->y * SourceSurf->lDelta) + 3 * SourcePoint->x; SourceLine = BltInfo->SourceSurface->pvScan0 + (BltInfo->SourcePoint.y * BltInfo->SourceSurface->lDelta) + 3 * BltInfo->SourcePoint.x;
DestLine = DestBits; DestLine = DestBits;
for (j = DestRect->top; j < DestRect->bottom; j++) for (j = BltInfo->DestRect.top; j < BltInfo->DestRect.bottom; j++)
{ {
SourceBits = SourceLine; SourceBits = SourceLine;
DestBits = DestLine; DestBits = DestLine;
for (i = DestRect->left; i < DestRect->right; i++) for (i = BltInfo->DestRect.left; i < BltInfo->DestRect.right; i++)
{ {
xColor = (*(SourceBits + 2) << 0x10) + xColor = (*(SourceBits + 2) << 0x10) +
(*(SourceBits + 1) << 0x08) + (*(SourceBits + 1) << 0x08) +
(*(SourceBits)); (*(SourceBits));
*DestBits = XLATEOBJ_iXlate(ColorTranslation, xColor); *DestBits = XLATEOBJ_iXlate(BltInfo->XlateSourceToDest, xColor);
SourceBits += 3; SourceBits += 3;
DestBits += 1; DestBits += 1;
} }
SourceLine += SourceSurf->lDelta; SourceLine += BltInfo->SourceSurface->lDelta;
DestLine += DestSurf->lDelta; DestLine += BltInfo->DestSurface->lDelta;
} }
break; break;
case BMF_32BPP: case BMF_32BPP:
SourceLine = SourceSurf->pvScan0 + (SourcePoint->y * SourceSurf->lDelta) + 4 * SourcePoint->x; SourceLine = BltInfo->SourceSurface->pvScan0 + (BltInfo->SourcePoint.y * BltInfo->SourceSurface->lDelta) + 4 * BltInfo->SourcePoint.x;
DestLine = DestBits; DestLine = DestBits;
for (j = DestRect->top; j < DestRect->bottom; j++) for (j = BltInfo->DestRect.top; j < BltInfo->DestRect.bottom; j++)
{ {
SourceBits = SourceLine; SourceBits = SourceLine;
DestBits = DestLine; DestBits = DestLine;
for (i = DestRect->left; i < DestRect->right; i++) for (i = BltInfo->DestRect.left; i < BltInfo->DestRect.right; i++)
{ {
xColor = *((PDWORD) SourceBits); xColor = *((PDWORD) SourceBits);
*DestBits = XLATEOBJ_iXlate(ColorTranslation, xColor); *DestBits = XLATEOBJ_iXlate(BltInfo->XlateSourceToDest, xColor);
SourceBits += 4; SourceBits += 4;
DestBits += 1; DestBits += 1;
} }
SourceLine += SourceSurf->lDelta; SourceLine += BltInfo->SourceSurface->lDelta;
DestLine += DestSurf->lDelta; DestLine += BltInfo->DestSurface->lDelta;
} }
break; break;
default: default:
DPRINT1("DIB_8BPP_Bitblt: Unhandled Source BPP: %u\n", BitsPerFormat(SourceSurf->iBitmapFormat)); DPRINT1("DIB_8BPP_Bitblt: Unhandled Source BPP: %u\n", BitsPerFormat(BltInfo->SourceSurface->iBitmapFormat));
return FALSE; return FALSE;
} }
@ -259,123 +257,98 @@ DIB_8BPP_BitBltSrcCopy(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
} }
BOOLEAN BOOLEAN
DIB_8BPP_BitBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf, DIB_8BPP_BitBlt(PBLTINFO BltInfo)
PRECTL DestRect, POINTL *SourcePoint,
BRUSHOBJ *Brush, POINTL BrushOrigin,
XLATEOBJ *ColorTranslation, ULONG Rop4)
{ {
LONG i, j, k, sx, sy; ULONG DestX, DestY;
ULONG SourceX, SourceY;
ULONG PatternY = 0;
ULONG Dest, Source = 0, Pattern = 0; ULONG Dest, Source = 0, Pattern = 0;
PULONG DestBits;
BOOL UsesSource; BOOL UsesSource;
BOOL UsesPattern; BOOL UsesPattern;
PULONG DestBits;
LONG RoundedRight; LONG RoundedRight;
/* Pattern brushes */
PGDIBRUSHOBJ GdiBrush = NULL;
HBITMAP PatternSurface = NULL;
SURFOBJ *PatternObj = NULL;
ULONG PatternWidth = 0, PatternHeight = 0, PatternY = 0;
if (Rop4 == SRCCOPY) UsesSource = ROP_USES_SOURCE(BltInfo->Rop4);
{ UsesPattern = ROP_USES_PATTERN(BltInfo->Rop4);
return DIB_8BPP_BitBltSrcCopy(
DestSurf,
SourceSurf,
DestRect,
SourcePoint,
ColorTranslation);
}
UsesSource = ((Rop4 & 0xCC0000) >> 2) != (Rop4 & 0x330000); SourceY = BltInfo->SourcePoint.y;
UsesPattern = (((Rop4 & 0xF00000) >> 4) != (Rop4 & 0x0F0000)) && Brush; RoundedRight = BltInfo->DestRect.right -
((BltInfo->DestRect.right - BltInfo->DestRect.left) & 0x7);
if (UsesPattern) if (UsesPattern)
{ {
if (Brush->iSolidColor == 0xFFFFFFFF) if (BltInfo->PatternSurface)
{ {
PBITMAPOBJ PatternBitmap; PatternY = (BltInfo->DestRect.top + BltInfo->BrushOrigin.y) %
BltInfo->PatternSurface->sizlBitmap.cy;
GdiBrush = CONTAINING_RECORD(
Brush,
GDIBRUSHOBJ,
BrushObject);
PatternSurface = GdiBrush->hbmPattern;
PatternBitmap = BITMAPOBJ_LockBitmap(GdiBrush->hbmPattern);
PatternObj = &PatternBitmap->SurfObj;
PatternWidth = PatternObj->sizlBitmap.cx;
PatternHeight = PatternObj->sizlBitmap.cy;
UsesPattern = TRUE;
} }
else else
{ {
UsesPattern = FALSE; Pattern = BltInfo->Brush->iSolidColor |
Pattern = (Brush->iSolidColor & 0xFF) | (BltInfo->Brush->iSolidColor << 8) |
((Brush->iSolidColor & 0xFF) << 8) | (BltInfo->Brush->iSolidColor << 16) |
((Brush->iSolidColor & 0xFF) << 16) | (BltInfo->Brush->iSolidColor << 24);
((Brush->iSolidColor & 0xFF) << 24);
} }
} }
RoundedRight = DestRect->right - ((DestRect->right - DestRect->left) & 0x3); for (DestY = BltInfo->DestRect.top; DestY < BltInfo->DestRect.bottom; DestY++)
sy = SourcePoint->y;
for (j = DestRect->top; j < DestRect->bottom; j++)
{ {
sx = SourcePoint->x; SourceX = BltInfo->SourcePoint.x;
DestBits = (PULONG)(DestSurf->pvScan0 + DestRect->left + j * DestSurf->lDelta); DestBits = (PULONG)(
BltInfo->DestSurface->pvScan0 +
BltInfo->DestRect.left +
DestY * BltInfo->DestSurface->lDelta);
if(UsesPattern) for (DestX = BltInfo->DestRect.left; DestX < RoundedRight; DestX += 4, DestBits++)
PatternY = (j + BrushOrigin.y) % PatternHeight;
for (i = DestRect->left; i < RoundedRight; i += 4, DestBits++)
{ {
Dest = *DestBits; Dest = *DestBits;
if (UsesSource) if (UsesSource)
{ {
Source = 0; Source = DIB_GetSource(BltInfo->SourceSurface, SourceX + (DestX - BltInfo->DestRect.left), SourceY, BltInfo->XlateSourceToDest);
for (k = 0; k < 4; k++) Source |= DIB_GetSource(BltInfo->SourceSurface, SourceX + (DestX - BltInfo->DestRect.left) + 1, SourceY, BltInfo->XlateSourceToDest) << 8;
Source |= (DIB_GetSource(SourceSurf, sx + (i - DestRect->left) + k, sy, ColorTranslation) << (k * 8)); Source |= DIB_GetSource(BltInfo->SourceSurface, SourceX + (DestX - BltInfo->DestRect.left) + 2, SourceY, BltInfo->XlateSourceToDest) << 16;
Source |= DIB_GetSource(BltInfo->SourceSurface, SourceX + (DestX - BltInfo->DestRect.left) + 3, SourceY, BltInfo->XlateSourceToDest) << 24;
} }
if (UsesPattern) if (BltInfo->PatternSurface)
{ {
Pattern = DIB_1BPP_GetPixel(PatternObj, (i + BrushOrigin.x) % PatternWidth, PatternY) ? GdiBrush->crFore : GdiBrush->crBack; Pattern = DIB_GetSource(BltInfo->PatternSurface, (DestX + BltInfo->BrushOrigin.x) % BltInfo->PatternSurface->sizlBitmap.cx, PatternY, BltInfo->XlatePatternToDest);
Pattern |= (DIB_1BPP_GetPixel(PatternObj, (i + BrushOrigin.x + 1) % PatternWidth, PatternY) ? GdiBrush->crFore : GdiBrush->crBack) << 8; Pattern |= DIB_GetSource(BltInfo->PatternSurface, (DestX + BltInfo->BrushOrigin.x + 1) % BltInfo->PatternSurface->sizlBitmap.cx, PatternY, BltInfo->XlatePatternToDest) << 8;
Pattern |= (DIB_1BPP_GetPixel(PatternObj, (i + BrushOrigin.x + 2) % PatternWidth, PatternY) ? GdiBrush->crFore : GdiBrush->crBack) << 16; Pattern |= DIB_GetSource(BltInfo->PatternSurface, (DestX + BltInfo->BrushOrigin.x + 2) % BltInfo->PatternSurface->sizlBitmap.cx, PatternY, BltInfo->XlatePatternToDest) << 16;
Pattern |= (DIB_1BPP_GetPixel(PatternObj, (i + BrushOrigin.x + 3) % PatternWidth, PatternY) ? GdiBrush->crFore : GdiBrush->crBack) << 24; Pattern |= DIB_GetSource(BltInfo->PatternSurface, (DestX + BltInfo->BrushOrigin.x + 3) % BltInfo->PatternSurface->sizlBitmap.cx, PatternY, BltInfo->XlatePatternToDest) << 24;
}
*DestBits = DIB_DoRop(Rop4, Dest, Source, Pattern);
} }
if (i < DestRect->right) *DestBits = DIB_DoRop(BltInfo->Rop4, Dest, Source, Pattern);
}
if (DestX < BltInfo->DestRect.right)
{ {
for (; i < DestRect->right; i++) for (; DestX < BltInfo->DestRect.right; DestX++)
{ {
Dest = DIB_8BPP_GetPixel(DestSurf, i, j); Dest = DIB_8BPP_GetPixel(BltInfo->DestSurface, DestX, DestY);
if (UsesSource) if (UsesSource)
{ {
Source = DIB_GetSource(SourceSurf, sx + (i - DestRect->left), sy, ColorTranslation); Source = DIB_GetSource(BltInfo->SourceSurface, SourceX + (DestX - BltInfo->DestRect.left), SourceY, BltInfo->XlateSourceToDest);
} }
if (UsesPattern) if (BltInfo->PatternSurface)
{ {
Pattern = DIB_1BPP_GetPixel(PatternObj, (i + BrushOrigin.x) % PatternWidth,PatternY) ? GdiBrush->crFore : GdiBrush->crBack; Pattern = DIB_GetSource(BltInfo->PatternSurface, (DestX + BltInfo->BrushOrigin.x) % BltInfo->PatternSurface->sizlBitmap.cx, PatternY, BltInfo->XlatePatternToDest);
} }
DIB_8BPP_PutPixel(DestSurf, i, j, DIB_DoRop(Rop4, Dest, Source, Pattern) & 0xFFFF); DIB_8BPP_PutPixel(BltInfo->DestSurface, DestX, DestY, DIB_DoRop(BltInfo->Rop4, Dest, Source, Pattern) & 0xFFFF);
} }
} }
sy++; SourceY++;
if (BltInfo->PatternSurface)
{
PatternY++;
PatternY %= BltInfo->PatternSurface->sizlBitmap.cy;
}
} }
if (PatternSurface != NULL)
BITMAPOBJ_UnlockBitmap(PatternSurface);
return TRUE; return TRUE;
} }

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
/* $Id: bitblt.c,v 1.57 2004/07/03 17:40:25 navaraf Exp $ /* $Id: bitblt.c,v 1.58 2004/07/14 20:48:57 navaraf Exp $
* *
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel
@ -88,7 +88,7 @@ BltMask(SURFOBJ* Dest,
BYTE *tMask, *lMask; BYTE *tMask, *lMask;
static BYTE maskbit[8] = { 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01 }; static BYTE maskbit[8] = { 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01 };
/* Pattern brushes */ /* Pattern brushes */
PGDIBRUSHOBJ GdiBrush = NULL; PGDIBRUSHINST GdiBrush = NULL;
HBITMAP PatternSurface = NULL; HBITMAP PatternSurface = NULL;
SURFOBJ *PatternObj = NULL; SURFOBJ *PatternObj = NULL;
ULONG PatternWidth = 0, PatternHeight = 0, PatternY = 0; ULONG PatternWidth = 0, PatternHeight = 0, PatternY = 0;
@ -107,11 +107,11 @@ BltMask(SURFOBJ* Dest,
GdiBrush = CONTAINING_RECORD( GdiBrush = CONTAINING_RECORD(
Brush, Brush,
GDIBRUSHOBJ, GDIBRUSHINST,
BrushObject); BrushObject);
PatternSurface = GdiBrush->hbmPattern; PatternSurface = GdiBrush->GdiBrushObject->hbmPattern;
PatternBitmap = BITMAPOBJ_LockBitmap(GdiBrush->hbmPattern); PatternBitmap = BITMAPOBJ_LockBitmap(GdiBrush->GdiBrushObject->hbmPattern);
PatternObj = &PatternBitmap->SurfObj; PatternObj = &PatternBitmap->SurfObj;
PatternWidth = PatternObj->sizlBitmap.cx; PatternWidth = PatternObj->sizlBitmap.cx;
@ -140,7 +140,7 @@ BltMask(SURFOBJ* Dest,
{ {
DibFunctionsForBitmapFormat[Dest->iBitmapFormat].DIB_PutPixel( DibFunctionsForBitmapFormat[Dest->iBitmapFormat].DIB_PutPixel(
Dest, DestRect->left + i, DestRect->top + j, Dest, DestRect->left + i, DestRect->top + j,
DIB_1BPP_GetPixel(PatternObj, (DestRect->left + i) % PatternWidth, PatternY) ? GdiBrush->crFore : GdiBrush->crBack); DIB_GetSource(PatternObj, (DestRect->left + i) % PatternWidth, PatternY, GdiBrush->XlateObject));
} }
} }
c8++; c8++;
@ -198,18 +198,44 @@ CallDibBitBlt(SURFOBJ* OutputObj,
POINTL* BrushOrigin, POINTL* BrushOrigin,
ROP4 Rop4) ROP4 Rop4)
{ {
POINTL RealBrushOrigin; BLTINFO BltInfo;
if (BrushOrigin == NULL) PGDIBRUSHINST GdiBrush = NULL;
BITMAPOBJ *bmPattern;
BOOLEAN Result;
BltInfo.DestSurface = OutputObj;
BltInfo.SourceSurface = InputObj;
BltInfo.PatternSurface = NULL;
BltInfo.XlateSourceToDest = ColorTranslation;
BltInfo.DestRect = *OutputRect;
BltInfo.SourcePoint = *InputPoint;
if (Rop4 == SRCCOPY)
return DibFunctionsForBitmapFormat[OutputObj->iBitmapFormat].DIB_BitBltSrcCopy(&BltInfo);
BltInfo.XlatePatternToDest = NULL;
BltInfo.Brush = Brush;
BltInfo.BrushOrigin = *BrushOrigin;
BltInfo.Rop4 = Rop4;
/* Pattern brush */
if (ROP_USES_PATTERN(Rop4) && Brush->iSolidColor == 0xFFFFFFFF)
{ {
RealBrushOrigin.x = RealBrushOrigin.y = 0; GdiBrush = CONTAINING_RECORD(Brush, GDIBRUSHINST, BrushObject);
} bmPattern = BITMAPOBJ_LockBitmap(GdiBrush->GdiBrushObject->hbmPattern);
else BltInfo.PatternSurface = &bmPattern->SurfObj;
{ BltInfo.XlatePatternToDest = GdiBrush->XlateObject;
RealBrushOrigin = *BrushOrigin;
} }
return DibFunctionsForBitmapFormat[OutputObj->iBitmapFormat].DIB_BitBlt( Result = DibFunctionsForBitmapFormat[OutputObj->iBitmapFormat].DIB_BitBlt(&BltInfo);
OutputObj, InputObj, OutputRect, InputPoint, Brush, RealBrushOrigin, ColorTranslation, Rop4);
/* Pattern brush */
if (ROP_USES_PATTERN(Rop4) && Brush->iSolidColor == 0xFFFFFFFF)
{
BITMAPOBJ_UnlockBitmap(BltInfo.PatternSurface->hsurf);
}
return Result;
} }
INT abs(INT nm); INT abs(INT nm);

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
/* $Id: copybits.c,v 1.25 2004/07/03 13:55:35 navaraf Exp $ /* $Id: copybits.c,v 1.26 2004/07/14 20:48:57 navaraf Exp $
* *
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel
@ -41,11 +41,9 @@ EngCopyBits(SURFOBJ *Dest,
{ {
BOOLEAN ret; BOOLEAN ret;
BYTE clippingType; BYTE clippingType;
RECTL rclTmp;
POINTL ptlTmp;
RECT_ENUM RectEnum; RECT_ENUM RectEnum;
BOOL EnumMore; BOOL EnumMore;
POINTL BrushOrigin; BLTINFO BltInfo;
MouseSafetyOnDrawStart(Source, SourcePoint->x, SourcePoint->y, MouseSafetyOnDrawStart(Source, SourcePoint->x, SourcePoint->y,
(SourcePoint->x + abs(DestRect->right - DestRect->left)), (SourcePoint->x + abs(DestRect->right - DestRect->left)),
@ -114,13 +112,20 @@ EngCopyBits(SURFOBJ *Dest,
clippingType = Clip->iDComplexity; clippingType = Clip->iDComplexity;
} }
BrushOrigin.x = BrushOrigin.y = 0; BltInfo.DestSurface = Dest;
BltInfo.SourceSurface = Source;
BltInfo.PatternSurface = NULL;
BltInfo.XlateSourceToDest = ColorTranslation;
BltInfo.XlatePatternToDest = NULL;
BltInfo.Rop4 = SRCCOPY;
switch(clippingType) switch(clippingType)
{ {
case DC_TRIVIAL: case DC_TRIVIAL:
DibFunctionsForBitmapFormat[Dest->iBitmapFormat].DIB_BitBlt( BltInfo.DestRect = *DestRect;
Dest, Source, DestRect, SourcePoint, NULL, BrushOrigin, ColorTranslation, SRCCOPY); BltInfo.SourcePoint = *SourcePoint;
DibFunctionsForBitmapFormat[Dest->iBitmapFormat].DIB_BitBltSrcCopy(&BltInfo);
MouseSafetyOnDrawEnd(Dest); MouseSafetyOnDrawEnd(Dest);
MouseSafetyOnDrawEnd(Source); MouseSafetyOnDrawEnd(Source);
@ -129,13 +134,12 @@ EngCopyBits(SURFOBJ *Dest,
case DC_RECT: case DC_RECT:
// Clip the blt to the clip rectangle // Clip the blt to the clip rectangle
EngIntersectRect(&rclTmp, DestRect, &Clip->rclBounds); EngIntersectRect(&BltInfo.DestRect, DestRect, &Clip->rclBounds);
ptlTmp.x = SourcePoint->x + rclTmp.left - DestRect->left; BltInfo.SourcePoint.x = SourcePoint->x + BltInfo.DestRect.left - DestRect->left;
ptlTmp.y = SourcePoint->y + rclTmp.top - DestRect->top; BltInfo.SourcePoint.y = SourcePoint->y + BltInfo.DestRect.top - DestRect->top;
DibFunctionsForBitmapFormat[Dest->iBitmapFormat].DIB_BitBlt( DibFunctionsForBitmapFormat[Dest->iBitmapFormat].DIB_BitBltSrcCopy(&BltInfo);
Dest, Source, &rclTmp, &ptlTmp, NULL, BrushOrigin, ColorTranslation, SRCCOPY);
MouseSafetyOnDrawEnd(Dest); MouseSafetyOnDrawEnd(Dest);
MouseSafetyOnDrawEnd(Source); MouseSafetyOnDrawEnd(Source);
@ -155,13 +159,13 @@ EngCopyBits(SURFOBJ *Dest,
RECTL* prcl = &RectEnum.arcl[0]; RECTL* prcl = &RectEnum.arcl[0];
do { do {
EngIntersectRect(prcl, prcl, DestRect); EngIntersectRect(&BltInfo.DestRect, prcl, DestRect);
ptlTmp.x = SourcePoint->x + prcl->left - DestRect->left; BltInfo.SourcePoint.x = SourcePoint->x + prcl->left - DestRect->left;
ptlTmp.y = SourcePoint->y + prcl->top - DestRect->top; BltInfo.SourcePoint.y = SourcePoint->y + prcl->top - DestRect->top;
if(!DibFunctionsForBitmapFormat[Dest->iBitmapFormat].DIB_BitBlt( if(!DibFunctionsForBitmapFormat[Dest->iBitmapFormat].DIB_BitBltSrcCopy(&BltInfo))
Dest, Source, prcl, &ptlTmp, NULL, BrushOrigin, ColorTranslation, SRCCOPY)) return FALSE; return FALSE;
prcl++; prcl++;

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
* *
* $Id: lineto.c,v 1.34 2004/07/03 13:55:35 navaraf Exp $ * $Id: lineto.c,v 1.35 2004/07/14 20:48:57 navaraf Exp $
*/ */
#include <w32k.h> #include <w32k.h>
@ -40,7 +40,7 @@ TranslateRects(RECT_ENUM *RectEnum, POINTL* Translate)
/* /*
* Draw a line from top-left to bottom-right * Draw a line from top-left to bottom-right
*/ */
static void FASTCALL void FASTCALL
NWtoSE(SURFOBJ* OutputObj, CLIPOBJ* Clip, NWtoSE(SURFOBJ* OutputObj, CLIPOBJ* Clip,
BRUSHOBJ* Brush, LONG x, LONG y, LONG deltax, LONG deltay, BRUSHOBJ* Brush, LONG x, LONG y, LONG deltax, LONG deltay,
POINTL* Translate) POINTL* Translate)
@ -111,7 +111,7 @@ NWtoSE(SURFOBJ* OutputObj, CLIPOBJ* Clip,
} }
} }
static void FASTCALL void FASTCALL
SWtoNE(SURFOBJ* OutputObj, CLIPOBJ* Clip, SWtoNE(SURFOBJ* OutputObj, CLIPOBJ* Clip,
BRUSHOBJ* Brush, LONG x, LONG y, LONG deltax, LONG deltay, BRUSHOBJ* Brush, LONG x, LONG y, LONG deltax, LONG deltay,
POINTL* Translate) POINTL* Translate)
@ -181,7 +181,7 @@ SWtoNE(SURFOBJ* OutputObj, CLIPOBJ* Clip,
} }
} }
static void FASTCALL void FASTCALL
NEtoSW(SURFOBJ* OutputObj, CLIPOBJ* Clip, NEtoSW(SURFOBJ* OutputObj, CLIPOBJ* Clip,
BRUSHOBJ* Brush, LONG x, LONG y, LONG deltax, LONG deltay, BRUSHOBJ* Brush, LONG x, LONG y, LONG deltax, LONG deltay,
POINTL* Translate) POINTL* Translate)
@ -251,7 +251,7 @@ NEtoSW(SURFOBJ* OutputObj, CLIPOBJ* Clip,
} }
} }
static void FASTCALL void FASTCALL
SEtoNW(SURFOBJ* OutputObj, CLIPOBJ* Clip, SEtoNW(SURFOBJ* OutputObj, CLIPOBJ* Clip,
BRUSHOBJ* Brush, LONG x, LONG y, LONG deltax, LONG deltay, BRUSHOBJ* Brush, LONG x, LONG y, LONG deltax, LONG deltay,
POINTL* Translate) POINTL* Translate)
@ -492,15 +492,15 @@ IntEngLineTo(BITMAPOBJ *DestObj,
{ {
BOOLEAN ret; BOOLEAN ret;
SURFOBJ *DestSurf = &DestObj->SurfObj; SURFOBJ *DestSurf = &DestObj->SurfObj;
PGDIBRUSHOBJ GdiBrush; PGDIBRUSHINST GdiBrush;
RECTL b; RECTL b;
GdiBrush = CONTAINING_RECORD( GdiBrush = CONTAINING_RECORD(
Brush, Brush,
GDIBRUSHOBJ, GDIBRUSHINST,
BrushObject); BrushObject);
if (GdiBrush->flAttrs & GDIBRUSH_IS_NULL) if (GdiBrush->GdiBrushObject->flAttrs & GDIBRUSH_IS_NULL)
return TRUE; return TRUE;
/* No success yet */ /* No success yet */

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
/* $Id: mouse.c,v 1.75 2004/07/03 17:40:25 navaraf Exp $ /* $Id: mouse.c,v 1.76 2004/07/14 20:48:57 navaraf Exp $
* *
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel
* PURPOSE: Mouse * PURPOSE: Mouse
@ -591,18 +591,13 @@ EngSetPointerShape(
HPALETTE BWPalette, DestPalette; HPALETTE BWPalette, DestPalette;
ULONG BWColors[] = {0, 0xFFFFFF}; ULONG BWColors[] = {0, 0xFFFFFF};
PDC Dc; PDC Dc;
PPALGDI PalObj;
LONG DestMode;
BWPalette = EngCreatePalette(PAL_INDEXED, sizeof(BWColors) / sizeof(ULONG), BWPalette = EngCreatePalette(PAL_INDEXED, sizeof(BWColors) / sizeof(ULONG),
BWColors, 0, 0, 0); BWColors, 0, 0, 0);
Dc = DC_LockDc(IntGetScreenDC()); Dc = DC_LockDc(IntGetScreenDC());
DestPalette = Dc->w.hPalette; DestPalette = Dc->w.hPalette;
PalObj = PALETTE_LockPalette(DestPalette);
DestMode = PalObj->Mode;
PALETTE_UnlockPalette(DestPalette);
DC_UnlockDc(IntGetScreenDC()); DC_UnlockDc(IntGetScreenDC());
ppdev->PointerXlateObject = IntEngCreateXlate(DestMode, PAL_INDEXED, ppdev->PointerXlateObject = IntEngCreateXlate(0, PAL_INDEXED,
DestPalette, BWPalette); DestPalette, BWPalette);
EngDeletePalette(BWPalette); EngDeletePalette(BWPalette);
} }

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
/* $Id: xlate.c,v 1.40 2004/07/04 17:09:45 navaraf Exp $ /* $Id: xlate.c,v 1.41 2004/07/14 20:48:57 navaraf Exp $
* *
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel
@ -162,6 +162,11 @@ IntEngCreateXlate(USHORT DestPalType, USHORT SourcePalType,
else if (PaletteDest != NULL) else if (PaletteDest != NULL)
DestPalGDI = PALETTE_LockPalette(PaletteDest); DestPalGDI = PALETTE_LockPalette(PaletteDest);
if (SourcePalType == 0)
SourcePalType = SourcePalGDI->Mode;
if (DestPalType == 0)
DestPalType = DestPalGDI->Mode;
XlateObj->iSrcType = SourcePalType; XlateObj->iSrcType = SourcePalType;
XlateObj->iDstType = DestPalType; XlateObj->iDstType = DestPalType;
XlateObj->flXlate = 0; XlateObj->flXlate = 0;
@ -269,15 +274,21 @@ XLATEOBJ * STDCALL IntEngCreateMonoXlate(
USHORT SourcePalType, HPALETTE PaletteDest, HPALETTE PaletteSource, USHORT SourcePalType, HPALETTE PaletteDest, HPALETTE PaletteSource,
ULONG BackgroundColor) ULONG BackgroundColor)
{ {
HPALETTE NewXlate; ULONG NewXlate;
XLATEOBJ *XlateObj; XLATEOBJ *XlateObj;
XLATEGDI *XlateGDI; XLATEGDI *XlateGDI;
PALGDI *SourcePalGDI; PALGDI *SourcePalGDI;
NewXlate = (HPALETTE)CreateGDIHandle(sizeof(XLATEGDI), sizeof(XLATEOBJ), (PVOID*)&XlateGDI, (PVOID*)&XlateObj); NewXlate = CreateGDIHandle(sizeof(XLATEGDI), sizeof(XLATEOBJ), (PVOID*)&XlateGDI, (PVOID*)&XlateObj);
if (!ValidEngHandle(NewXlate)) if (!ValidEngHandle(NewXlate))
return NULL; return NULL;
SourcePalGDI = PALETTE_LockPalette(PaletteSource);
ASSERT(SourcePalGDI);
if (SourcePalType == 0)
SourcePalType = SourcePalGDI->Mode;
XlateObj->iSrcType = SourcePalType; XlateObj->iSrcType = SourcePalType;
XlateObj->iDstType = PAL_INDEXED; XlateObj->iDstType = PAL_INDEXED;
@ -303,18 +314,69 @@ XLATEOBJ * STDCALL IntEngCreateMonoXlate(
break; break;
case PAL_BITFIELDS: case PAL_BITFIELDS:
{ {
SourcePalGDI = PALETTE_LockPalette(PaletteSource);
BitMasksFromPal(SourcePalType, SourcePalGDI, &XlateGDI->RedMask, BitMasksFromPal(SourcePalType, SourcePalGDI, &XlateGDI->RedMask,
&XlateGDI->BlueMask, &XlateGDI->GreenMask); &XlateGDI->BlueMask, &XlateGDI->GreenMask);
XlateGDI->RedShift = CalculateShift(0xFF) - CalculateShift(XlateGDI->RedMask); XlateGDI->RedShift = CalculateShift(0xFF) - CalculateShift(XlateGDI->RedMask);
XlateGDI->GreenShift = CalculateShift(0xFF00) - CalculateShift(XlateGDI->GreenMask); XlateGDI->GreenShift = CalculateShift(0xFF00) - CalculateShift(XlateGDI->GreenMask);
XlateGDI->BlueShift = CalculateShift(0xFF0000) - CalculateShift(XlateGDI->BlueMask); XlateGDI->BlueShift = CalculateShift(0xFF0000) - CalculateShift(XlateGDI->BlueMask);
XlateGDI->BackgroundColor = ShiftAndMask(XlateGDI, BackgroundColor); XlateGDI->BackgroundColor = ShiftAndMask(XlateGDI, BackgroundColor);
PALETTE_UnlockPalette(PaletteSource);
} }
break; break;
} }
PALETTE_UnlockPalette(PaletteSource);
return XlateObj;
}
XLATEOBJ * STDCALL
IntEngCreateSrcMonoXlate(HPALETTE PaletteDest,
ULONG ForegroundColor,
ULONG BackgroundColor)
{
ULONG NewXlate;
XLATEOBJ *XlateObj;
XLATEGDI *XlateGDI;
PALGDI *DestPalGDI;
DestPalGDI = PALETTE_LockPalette(PaletteDest);
if (DestPalGDI == NULL)
return NULL;
NewXlate = CreateGDIHandle(sizeof(XLATEGDI), sizeof(XLATEOBJ), (PVOID*)&XlateGDI, (PVOID*)&XlateObj);
if (!ValidEngHandle(NewXlate))
return NULL;
XlateGDI->translationTable = EngAllocMem(0, sizeof(ULONG) * 2, 0);
if (XlateGDI->translationTable == NULL)
{
FreeGDIHandle(NewXlate);
return NULL;
}
XlateObj->pulXlate = XlateGDI->translationTable;
XlateObj->iSrcType = PAL_INDEXED;
XlateObj->iDstType = DestPalGDI->Mode;
/* Store handles of palettes in internal Xlate GDI object (or NULLs) */
XlateGDI->SourcePal = NULL;
XlateGDI->DestPal = PaletteDest;
XlateObj->flXlate = XO_TABLE;
BitMasksFromPal(DestPalGDI->Mode, DestPalGDI, &XlateGDI->RedMask,
&XlateGDI->BlueMask, &XlateGDI->GreenMask);
XlateGDI->RedShift = CalculateShift(RGB(255, 0, 0)) - CalculateShift(XlateGDI->RedMask);
XlateGDI->GreenShift = CalculateShift(RGB(0, 255, 0)) - CalculateShift(XlateGDI->GreenMask);
XlateGDI->BlueShift = CalculateShift(RGB(0, 0, 255)) - CalculateShift(XlateGDI->BlueMask);
XlateGDI->translationTable[0] = ShiftAndMask(XlateGDI, BackgroundColor);
XlateGDI->translationTable[1] = ShiftAndMask(XlateGDI, ForegroundColor);
PALETTE_UnlockPalette(PaletteDest);
return XlateObj; return XlateObj;
} }

View file

@ -66,6 +66,11 @@ IntEngCreateMonoXlate(USHORT SourcePalType,
HPALETTE PaletteSource, HPALETTE PaletteSource,
ULONG BackgroundColor); ULONG BackgroundColor);
XLATEOBJ * STDCALL
IntEngCreateSrcMonoXlate(HPALETTE PaletteDest,
ULONG ForegroundColor,
ULONG BackgroundColor);
BOOL STDCALL BOOL STDCALL
IntEngPolyline(BITMAPOBJ *DestSurf, IntEngPolyline(BITMAPOBJ *DestSurf,
CLIPOBJ *Clip, CLIPOBJ *Clip,

View file

@ -3,6 +3,12 @@
/* Brush functions */ /* Brush functions */
XLATEOBJ* FASTCALL
IntGdiCreateBrushXlate(PDC Dc, GDIBRUSHOBJ *BrushObj, BOOLEAN *Failed);
VOID FASTCALL
IntGdiInitBrushInstance(GDIBRUSHINST *BrushInst, PGDIBRUSHOBJ BrushObj, XLATEOBJ *XlateObj);
HBRUSH FASTCALL HBRUSH FASTCALL
IntGdiCreateBrushIndirect(PLOGBRUSH lb); IntGdiCreateBrushIndirect(PLOGBRUSH lb);

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
/* $Id: winpos.c,v 1.118 2004/06/20 22:27:19 gvg Exp $ /* $Id: winpos.c,v 1.119 2004/07/14 20:48:57 navaraf Exp $
* *
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel
@ -98,6 +98,22 @@ NtUserGetClientOrigin(HWND hWnd, LPPOINT Point)
return Ret; return Ret;
} }
/*******************************************************************
* WinPosCanActivateWindow
*
* Check if we can activate the specified window.
*/
static BOOL WinPosCanActivateWindow(HWND hWnd)
{
LONG Style;
if (!hWnd) return FALSE;
Style = NtUserGetWindowLong(hWnd, GWL_STYLE, FALSE);
if (!(Style & WS_VISIBLE)) return FALSE;
if ((Style & (WS_POPUP | WS_CHILD)) == WS_CHILD) return FALSE;
return !(Style & WS_DISABLED);
}
/******************************************************************* /*******************************************************************
* WinPosActivateOtherWindow * WinPosActivateOtherWindow
* *
@ -106,63 +122,37 @@ NtUserGetClientOrigin(HWND hWnd, LPPOINT Point)
VOID FASTCALL VOID FASTCALL
WinPosActivateOtherWindow(PWINDOW_OBJECT Window) WinPosActivateOtherWindow(PWINDOW_OBJECT Window)
{ {
PWINDOW_OBJECT Wnd, Old; HWND hwndTo = NULL, fg;
int TryTopmost; PWINDOW_OBJECT wndTo;
if (!Window || IntIsDesktopWindow(Window)) if ((Window->Style & WS_POPUP) && (hwndTo = Window->Owner))
{ {
IntSetFocusMessageQueue(NULL); hwndTo = NtUserGetAncestor(hwndTo, GA_ROOT);
if (WinPosCanActivateWindow(hwndTo))
goto done;
}
for (hwndTo = NtUserGetWindow(Window->Self, GW_HWNDNEXT);
hwndTo != NULL;
hwndTo = NtUserGetWindow(hwndTo, GW_HWNDNEXT))
{
if (WinPosCanActivateWindow(hwndTo)) break;
}
done:
fg = NtUserGetForegroundWindow();
if (!fg || (Window->Self == fg))
{
wndTo = IntGetWindowObject(hwndTo);
if (wndTo != NULL && IntSetForegroundWindow(wndTo))
{
IntReleaseWindowObject(wndTo);
return; return;
} }
Wnd = Window; IntReleaseWindowObject(wndTo);
for(;;)
{
HWND *List, *phWnd;
Old = Wnd;
Wnd = IntGetParentObject(Wnd);
if(Old != Window)
{
IntReleaseWindowObject(Old);
} }
if(!Wnd) if (!NtUserSetActiveWindow(hwndTo))
{ NtUserSetActiveWindow(0);
IntSetFocusMessageQueue(NULL);
return;
}
if((List = IntWinListChildren(Wnd)))
{
for(TryTopmost = 0; TryTopmost <= 1; TryTopmost++)
{
for(phWnd = List; *phWnd; phWnd++)
{
PWINDOW_OBJECT Child;
if((*phWnd) == Window->Self)
{
continue;
}
if((Child = IntGetWindowObject(*phWnd)))
{
if(((! TryTopmost && (0 == (Child->ExStyle & WS_EX_TOPMOST)))
|| (TryTopmost && (0 != (Child->ExStyle & WS_EX_TOPMOST))))
&& IntSetForegroundWindow(Child))
{
ExFreePool(List);
IntReleaseWindowObject(Wnd);
IntReleaseWindowObject(Child);
return;
}
IntReleaseWindowObject(Child);
}
}
}
ExFreePool(List);
}
}
IntReleaseWindowObject(Wnd);
} }
VOID STATIC FASTCALL VOID STATIC FASTCALL

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
/* $Id: bitmaps.c,v 1.78 2004/07/07 16:36:08 navaraf Exp $ */ /* $Id: bitmaps.c,v 1.79 2004/07/14 20:48:57 navaraf Exp $ */
#include <w32k.h> #include <w32k.h>
#define IN_RECT(r,x,y) \ #define IN_RECT(r,x,y) \
@ -45,14 +45,12 @@ NtGdiBitBlt(
RECTL DestRect; RECTL DestRect;
POINTL SourcePoint, BrushOrigin; POINTL SourcePoint, BrushOrigin;
BOOL Status; BOOL Status;
PPALGDI PalDestGDI, PalSourceGDI;
XLATEOBJ *XlateObj = NULL; XLATEOBJ *XlateObj = NULL;
HPALETTE SourcePalette = 0, DestPalette = 0; HPALETTE SourcePalette = 0, DestPalette = 0;
ULONG SourceMode, DestMode;
PGDIBRUSHOBJ BrushObj; PGDIBRUSHOBJ BrushObj;
BOOL UsesSource = ((ROP & 0xCC0000) >> 2) != (ROP & 0x330000); GDIBRUSHINST BrushInst;
BOOL UsesPattern = TRUE;//((ROP & 0xF00000) >> 4) != (ROP & 0x0F0000); BOOL UsesSource = ROP_USES_SOURCE(ROP);
HPALETTE Mono = NULL; BOOL UsesPattern = ROP_USES_PATTERN(ROP);
DCDest = DC_LockDc(hDCDest); DCDest = DC_LockDc(hDCDest);
if (NULL == DCDest) if (NULL == DCDest)
@ -133,6 +131,7 @@ NtGdiBitBlt(
return FALSE; return FALSE;
} }
BrushOrigin = BrushObj->ptOrigin; BrushOrigin = BrushObj->ptOrigin;
IntGdiInitBrushInstance(&BrushInst, BrushObj, DCDest->XlateBrush);
} }
else else
{ {
@ -148,73 +147,27 @@ NtGdiBitBlt(
if (DCSrc->w.hPalette != 0) if (DCSrc->w.hPalette != 0)
SourcePalette = DCSrc->w.hPalette; SourcePalette = DCSrc->w.hPalette;
PalSourceGDI = PALETTE_LockPalette(SourcePalette);
if (NULL == PalSourceGDI)
{
if (UsesSource && hDCSrc != hDCDest)
{
DC_UnlockDc(hDCSrc);
}
DC_UnlockDc(hDCDest);
SetLastWin32Error(ERROR_INVALID_HANDLE);
return FALSE;
}
SourceMode = PalSourceGDI->Mode;
PALETTE_UnlockPalette(SourcePalette);
if (DestPalette == SourcePalette)
{
DestMode = SourceMode;
}
else
{
PalDestGDI = PALETTE_LockPalette(DestPalette);
if (NULL == PalDestGDI)
{
if (UsesSource && hDCSrc != hDCDest)
{
DC_UnlockDc(hDCSrc);
}
DC_UnlockDc(hDCDest);
SetLastWin32Error(ERROR_INVALID_HANDLE);
return FALSE;
}
DestMode = PalDestGDI->Mode;
PALETTE_UnlockPalette(DestPalette);
}
/* KB41464 details how to convert between mono and color */ /* KB41464 details how to convert between mono and color */
if (DCDest->w.bitsPerPixel == 1) if (DCDest->w.bitsPerPixel == DCSrc->w.bitsPerPixel == 1)
{
XlateObj = (XLATEOBJ*)IntEngCreateMonoXlate(SourceMode, DestPalette,
SourcePalette, DCSrc->w.backgroundColor);
}
else if (DCSrc->w.bitsPerPixel == 1)
{
ULONG Colors[2];
Colors[0] = DCSrc->w.textColor;
Colors[1] = DCSrc->w.backgroundColor;
Mono = PALETTE_AllocPaletteIndexedRGB(2, (RGBQUAD*)Colors);
if (NULL != Mono)
{
XlateObj = (XLATEOBJ*)IntEngCreateXlate(DestMode, PAL_INDEXED, DestPalette, Mono);
}
else
{ {
XlateObj = NULL; XlateObj = NULL;
} }
else
{
if (DCDest->w.bitsPerPixel == 1)
{
XlateObj = IntEngCreateMonoXlate(0, DestPalette, SourcePalette, DCSrc->w.backgroundColor);
}
else if (DCSrc->w.bitsPerPixel == 1)
{
XlateObj = IntEngCreateSrcMonoXlate(DestPalette, DCSrc->w.backgroundColor, DCSrc->w.textColor);
} }
else else
{ {
XlateObj = (XLATEOBJ*)IntEngCreateXlate(DestMode, SourceMode, DestPalette, SourcePalette); XlateObj = IntEngCreateXlate(0, 0, DestPalette, SourcePalette);
} }
if (NULL == XlateObj) if (NULL == XlateObj)
{ {
if (NULL != Mono)
{
EngDeletePalette(Mono);
}
if (UsesSource && hDCSrc != hDCDest) if (UsesSource && hDCSrc != hDCDest)
{ {
DC_UnlockDc(hDCSrc); DC_UnlockDc(hDCSrc);
@ -224,22 +177,19 @@ NtGdiBitBlt(
return FALSE; return FALSE;
} }
} }
}
/* Perform the bitblt operation */ /* Perform the bitblt operation */
Status = IntEngBitBlt(BitmapDest, BitmapSrc, NULL, DCDest->CombinedClip, XlateObj, Status = IntEngBitBlt(BitmapDest, BitmapSrc, NULL, DCDest->CombinedClip, XlateObj,
&DestRect, &SourcePoint, NULL, &BrushObj->BrushObject, &BrushOrigin, ROP); &DestRect, &SourcePoint, NULL, BrushObj ? &BrushInst.BrushObject : NULL, &BrushOrigin, ROP);
if (UsesSource) if (UsesSource && XlateObj != NULL)
EngDeleteXlate(XlateObj); EngDeleteXlate(XlateObj);
BITMAPOBJ_UnlockBitmap(DCDest->w.hBitmap); BITMAPOBJ_UnlockBitmap(DCDest->w.hBitmap);
if (UsesSource && DCSrc->w.hBitmap != DCDest->w.hBitmap) if (UsesSource && DCSrc->w.hBitmap != DCDest->w.hBitmap)
{ {
BITMAPOBJ_UnlockBitmap(DCSrc->w.hBitmap); BITMAPOBJ_UnlockBitmap(DCSrc->w.hBitmap);
} }
if (NULL != Mono)
{
EngDeletePalette(Mono);
}
if (UsesPattern) if (UsesPattern)
{ {
BRUSHOBJ_UnlockBrush(DCDest->w.hBrush); BRUSHOBJ_UnlockBrush(DCDest->w.hBrush);
@ -547,6 +497,7 @@ NtGdiExtFloodFill(
UINT FillType) UINT FillType)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
return FALSE;
} }
BOOL STDCALL BOOL STDCALL
@ -588,8 +539,6 @@ NtGdiGetPixel(HDC hDC, INT XPos, INT YPos)
BITMAPOBJ *BitmapObject; BITMAPOBJ *BitmapObject;
SURFOBJ *SurfaceObject; SURFOBJ *SurfaceObject;
HPALETTE Pal = 0; HPALETTE Pal = 0;
PPALGDI PalGDI;
USHORT PalMode;
XLATEOBJ *XlateObj; XLATEOBJ *XlateObj;
dc = DC_LockDc (hDC); dc = DC_LockDc (hDC);
@ -608,14 +557,8 @@ NtGdiGetPixel(HDC hDC, INT XPos, INT YPos)
{ {
if ( dc->w.hPalette != 0 ) if ( dc->w.hPalette != 0 )
Pal = dc->w.hPalette; Pal = dc->w.hPalette;
PalGDI = PALETTE_LockPalette(Pal);
if ( PalGDI )
{
PalMode = PalGDI->Mode;
PALETTE_UnlockPalette(Pal);
/* FIXME: Verify if it shouldn't be PAL_BGR! */ /* FIXME: Verify if it shouldn't be PAL_BGR! */
XlateObj = (XLATEOBJ*)IntEngCreateXlate ( PAL_RGB, PalMode, NULL, Pal ); XlateObj = (XLATEOBJ*)IntEngCreateXlate ( PAL_RGB, 0, NULL, Pal );
if ( XlateObj ) if ( XlateObj )
{ {
// check if this DC has a DIB behind it... // check if this DC has a DIB behind it...
@ -628,7 +571,6 @@ NtGdiGetPixel(HDC hDC, INT XPos, INT YPos)
EngDeleteXlate(XlateObj); EngDeleteXlate(XlateObj);
} }
} }
}
BITMAPOBJ_UnlockBitmap(dc->w.hBitmap); BITMAPOBJ_UnlockBitmap(dc->w.hBitmap);
} }
DC_UnlockDc(hDC); DC_UnlockDc(hDC);
@ -897,6 +839,7 @@ NtGdiPlgBlt(
INT yMask) INT yMask)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
return FALSE;
} }
LONG STDCALL LONG STDCALL
@ -1049,10 +992,8 @@ NtGdiStretchBlt(
RECTL DestRect; RECTL DestRect;
RECTL SourceRect; RECTL SourceRect;
BOOL Status; BOOL Status;
PPALGDI PalDestGDI, PalSourceGDI;
XLATEOBJ *XlateObj = NULL; XLATEOBJ *XlateObj = NULL;
HPALETTE SourcePalette = 0, DestPalette = 0; HPALETTE SourcePalette = 0, DestPalette = 0;
ULONG SourceMode, DestMode;
PGDIBRUSHOBJ BrushObj; PGDIBRUSHOBJ BrushObj;
BOOL UsesSource = ((ROP & 0xCC0000) >> 2) != (ROP & 0x330000); BOOL UsesSource = ((ROP & 0xCC0000) >> 2) != (ROP & 0x330000);
BOOL UsesPattern = ((ROP & 0xF00000) >> 4) != (ROP & 0x0F0000); BOOL UsesPattern = ((ROP & 0xF00000) >> 4) != (ROP & 0x0F0000);
@ -1154,43 +1095,8 @@ NtGdiStretchBlt(
if (DCSrc->w.hPalette != 0) if (DCSrc->w.hPalette != 0)
SourcePalette = DCSrc->w.hPalette; SourcePalette = DCSrc->w.hPalette;
PalSourceGDI = PALETTE_LockPalette(SourcePalette);
if (NULL == PalSourceGDI)
{
if (UsesSource && hDCSrc != hDCDest)
{
DC_UnlockDc(hDCSrc);
}
DC_UnlockDc(hDCDest);
SetLastWin32Error(ERROR_INVALID_HANDLE);
return FALSE;
}
SourceMode = PalSourceGDI->Mode;
PALETTE_UnlockPalette(SourcePalette);
if (DestPalette == SourcePalette)
{
DestMode = SourceMode;
}
else
{
PalDestGDI = PALETTE_LockPalette(DestPalette);
if (NULL == PalDestGDI)
{
if (UsesSource && hDCSrc != hDCDest)
{
DC_UnlockDc(hDCSrc);
}
DC_UnlockDc(hDCDest);
SetLastWin32Error(ERROR_INVALID_HANDLE);
return FALSE;
}
DestMode = PalDestGDI->Mode;
PALETTE_UnlockPalette(DestPalette);
}
/* FIXME: Use the same logic for create XLATEOBJ as in NtGdiBitBlt. */ /* FIXME: Use the same logic for create XLATEOBJ as in NtGdiBitBlt. */
XlateObj = (XLATEOBJ*)IntEngCreateXlate(DestMode, SourceMode, DestPalette, SourcePalette); XlateObj = (XLATEOBJ*)IntEngCreateXlate(0, 0, DestPalette, SourcePalette);
if (NULL == XlateObj) if (NULL == XlateObj)
{ {
if (UsesSource && hDCSrc != hDCDest) if (UsesSource && hDCSrc != hDCDest)

View file

@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
* *
* $Id: brush.c,v 1.39 2004/07/03 17:40:27 navaraf Exp $ * $Id: brush.c,v 1.40 2004/07/14 20:48:57 navaraf Exp $
*/ */
#include <w32k.h> #include <w32k.h>
@ -45,6 +45,56 @@ Brush_InternalDelete( PGDIBRUSHOBJ pBrush )
return TRUE; return TRUE;
} }
XLATEOBJ* FASTCALL
IntGdiCreateBrushXlate(PDC Dc, GDIBRUSHOBJ *BrushObj, BOOLEAN *Failed)
{
XLATEOBJ *Result = NULL;
if (BrushObj->flAttrs & GDIBRUSH_IS_NULL)
{
Result = NULL;
*Failed = FALSE;
}
else if (BrushObj->flAttrs & GDIBRUSH_IS_SOLID)
{
Result = IntEngCreateXlate(0, PAL_RGB, Dc->w.hPalette, NULL);
*Failed = FALSE;
}
else
{
BITMAPOBJ *Pattern = BITMAPOBJ_LockBitmap(BrushObj->hbmPattern);
if (Pattern == NULL)
return NULL;
/* Special case: 1bpp pattern */
if (Pattern->SurfObj.iBitmapFormat == BMF_1BPP)
{
if (Dc->w.bitsPerPixel != 1)
Result = IntEngCreateSrcMonoXlate(Dc->w.hPalette, Dc->w.textColor, Dc->w.backgroundColor);
}
BITMAPOBJ_UnlockBitmap(BrushObj->hbmPattern);
*Failed = FALSE;
}
return Result;
}
VOID FASTCALL
IntGdiInitBrushInstance(GDIBRUSHINST *BrushInst, PGDIBRUSHOBJ BrushObj, XLATEOBJ *XlateObj)
{
if (BrushObj->flAttrs & GDIBRUSH_IS_NULL)
BrushInst->BrushObject.iSolidColor = 0;
else if (BrushObj->flAttrs & GDIBRUSH_IS_SOLID)
BrushInst->BrushObject.iSolidColor = XLATEOBJ_iXlate(XlateObj, BrushObj->BrushAttr.lbColor);
else
BrushInst->BrushObject.iSolidColor = 0xFFFFFFFF;
BrushInst->BrushObject.pvRbrush = BrushObj->ulRealization;
BrushInst->BrushObject.flColorType = 0;
BrushInst->GdiBrushObject = BrushObj;
BrushInst->XlateObject = XlateObj;
}
HBRUSH FASTCALL HBRUSH FASTCALL
IntGdiCreateBrushIndirect(PLOGBRUSH LogBrush) IntGdiCreateBrushIndirect(PLOGBRUSH LogBrush)
{ {
@ -55,7 +105,8 @@ IntGdiCreateBrushIndirect(PLOGBRUSH LogBrush)
switch (LogBrush->lbStyle) switch (LogBrush->lbStyle)
{ {
case BS_HATCHED: case BS_HATCHED:
if(!(hPattern = NtGdiCreateBitmap(8, 8, 1, 1, HatchBrushes[LogBrush->lbHatch]))) hPattern = NtGdiCreateBitmap(8, 8, 1, 1, HatchBrushes[LogBrush->lbHatch]);
if (hPattern == NULL)
{ {
SetLastWin32Error(ERROR_NOT_ENOUGH_MEMORY); SetLastWin32Error(ERROR_NOT_ENOUGH_MEMORY);
return NULL; return NULL;
@ -63,7 +114,8 @@ IntGdiCreateBrushIndirect(PLOGBRUSH LogBrush)
break; break;
case BS_PATTERN: case BS_PATTERN:
if(!(hPattern = BITMAPOBJ_CopyBitmap((HBITMAP)LogBrush->lbHatch))) hPattern = BITMAPOBJ_CopyBitmap((HBITMAP)LogBrush->lbHatch);
if (hPattern == NULL)
{ {
SetLastWin32Error(ERROR_NOT_ENOUGH_MEMORY); SetLastWin32Error(ERROR_NOT_ENOUGH_MEMORY);
return NULL; return NULL;
@ -89,7 +141,6 @@ IntGdiCreateBrushIndirect(PLOGBRUSH LogBrush)
case BS_SOLID: case BS_SOLID:
BrushObject->flAttrs |= GDIBRUSH_IS_SOLID; BrushObject->flAttrs |= GDIBRUSH_IS_SOLID;
BrushObject->BrushAttr.lbColor = LogBrush->lbColor & 0xFFFFFF; BrushObject->BrushAttr.lbColor = LogBrush->lbColor & 0xFFFFFF;
BrushObject->BrushObject.iSolidColor = BrushObject->BrushAttr.lbColor;
/* FIXME: Fill in the rest of fields!!! */ /* FIXME: Fill in the rest of fields!!! */
break; break;
@ -97,13 +148,11 @@ IntGdiCreateBrushIndirect(PLOGBRUSH LogBrush)
BrushObject->flAttrs |= GDIBRUSH_IS_HATCH; BrushObject->flAttrs |= GDIBRUSH_IS_HATCH;
BrushObject->hbmPattern = hPattern; BrushObject->hbmPattern = hPattern;
BrushObject->BrushAttr.lbColor = LogBrush->lbColor & 0xFFFFFF; BrushObject->BrushAttr.lbColor = LogBrush->lbColor & 0xFFFFFF;
BrushObject->BrushObject.iSolidColor = 0xFFFFFFFF;
break; break;
case BS_PATTERN: case BS_PATTERN:
BrushObject->flAttrs |= GDIBRUSH_IS_BITMAP; BrushObject->flAttrs |= GDIBRUSH_IS_BITMAP;
BrushObject->hbmPattern = hPattern; BrushObject->hbmPattern = hPattern;
BrushObject->BrushObject.iSolidColor = 0xFFFFFFFF;
/* FIXME: Fill in the rest of fields!!! */ /* FIXME: Fill in the rest of fields!!! */
break; break;
@ -128,6 +177,7 @@ IntPatBlt(
{ {
RECTL DestRect; RECTL DestRect;
BITMAPOBJ *BitmapObj; BITMAPOBJ *BitmapObj;
GDIBRUSHINST BrushInst;
POINTL BrushOrigin; POINTL BrushOrigin;
BOOL ret = TRUE; BOOL ret = TRUE;
@ -166,6 +216,8 @@ IntPatBlt(
BrushOrigin.x = BrushObj->ptOrigin.x + dc->w.DCOrgX; BrushOrigin.x = BrushObj->ptOrigin.x + dc->w.DCOrgX;
BrushOrigin.y = BrushObj->ptOrigin.y + dc->w.DCOrgY; BrushOrigin.y = BrushObj->ptOrigin.y + dc->w.DCOrgY;
IntGdiInitBrushInstance(&BrushInst, BrushObj, dc->XlateBrush);
ret = IntEngBitBlt( ret = IntEngBitBlt(
BitmapObj, BitmapObj,
NULL, NULL,
@ -175,7 +227,7 @@ IntPatBlt(
&DestRect, &DestRect,
NULL, NULL,
NULL, NULL,
&BrushObj->BrushObject, &BrushInst.BrushObject,
&BrushOrigin, &BrushOrigin,
ROP); ROP);
} }

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
/* $Id: cliprgn.c,v 1.41 2004/07/07 16:34:33 navaraf Exp $ */ /* $Id: cliprgn.c,v 1.42 2004/07/14 20:48:58 navaraf Exp $ */
#include <w32k.h> #include <w32k.h>
int FASTCALL int FASTCALL
@ -220,6 +220,7 @@ int STDCALL NtGdiGetMetaRgn(HDC hDC,
HRGN hrgn) HRGN hrgn)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
return 0;
} }
int STDCALL NtGdiExcludeClipRect(HDC hDC, int STDCALL NtGdiExcludeClipRect(HDC hDC,
@ -328,6 +329,7 @@ int STDCALL NtGdiOffsetClipRgn(HDC hDC,
int YOffset) int YOffset)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
return 0;
} }
BOOL STDCALL NtGdiPtVisible(HDC hDC, BOOL STDCALL NtGdiPtVisible(HDC hDC,
@ -389,6 +391,7 @@ BOOL STDCALL NtGdiSelectClipPath(HDC hDC,
int Mode) int Mode)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
return FALSE;
} }
INT STDCALL INT STDCALL
@ -400,6 +403,7 @@ NtGdiSelectClipRgn(HDC hDC, HRGN hRgn)
int STDCALL NtGdiSetMetaRgn(HDC hDC) int STDCALL NtGdiSetMetaRgn(HDC hDC)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
return 0;
} }
/* EOF */ /* EOF */

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
/* $Id: color.c,v 1.49 2004/07/04 17:09:45 navaraf Exp $ */ /* $Id: color.c,v 1.50 2004/07/14 20:48:58 navaraf Exp $ */
#include <w32k.h> #include <w32k.h>
// FIXME: Use PXLATEOBJ logicalToSystem instead of int *mapping // FIXME: Use PXLATEOBJ logicalToSystem instead of int *mapping
@ -136,6 +136,7 @@ BOOL STDCALL NtGdiGetColorAdjustment(HDC hDC,
LPCOLORADJUSTMENT ca) LPCOLORADJUSTMENT ca)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
return FALSE;
} }
unsigned short GetNumberOfBits(unsigned int dwMask) unsigned short GetNumberOfBits(unsigned int dwMask)
@ -422,6 +423,7 @@ BOOL STDCALL NtGdiResizePalette(HPALETTE hpal,
return TRUE; */ return TRUE; */
UNIMPLEMENTED; UNIMPLEMENTED;
return FALSE;
} }
/*! /*!
@ -479,6 +481,7 @@ BOOL STDCALL NtGdiSetColorAdjustment(HDC hDC,
CONST LPCOLORADJUSTMENT ca) CONST LPCOLORADJUSTMENT ca)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
return FALSE;
} }
UINT STDCALL NtGdiSetPaletteEntries(HPALETTE hpal, UINT STDCALL NtGdiSetPaletteEntries(HPALETTE hpal,
@ -515,12 +518,14 @@ UINT STDCALL
NtGdiSetSystemPaletteUse(HDC hDC, UINT Usage) NtGdiSetSystemPaletteUse(HDC hDC, UINT Usage)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
return 0;
} }
BOOL STDCALL BOOL STDCALL
NtGdiUnrealizeObject(HGDIOBJ hgdiobj) NtGdiUnrealizeObject(HGDIOBJ hgdiobj)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
return FALSE;
} }
BOOL STDCALL BOOL STDCALL

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
/* $Id: coord.c,v 1.25 2004/06/18 15:18:54 navaraf Exp $ /* $Id: coord.c,v 1.26 2004/07/14 20:48:58 navaraf Exp $
* *
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel
@ -482,6 +482,7 @@ NtGdiScaleViewportExtEx(HDC hDC,
LPSIZE Size) LPSIZE Size)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
return FALSE;
} }
BOOL BOOL
@ -494,6 +495,7 @@ NtGdiScaleWindowExtEx(HDC hDC,
LPSIZE Size) LPSIZE Size)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
return FALSE;
} }
int int

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
/* $Id: dc.c,v 1.143 2004/07/03 17:40:27 navaraf Exp $ /* $Id: dc.c,v 1.144 2004/07/14 20:48:58 navaraf Exp $
* *
* DC.C - Device context functions * DC.C - Device context functions
* *
@ -120,6 +120,7 @@ BOOL STDCALL
NtGdiCancelDC(HDC hDC) NtGdiCancelDC(HDC hDC)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
return FALSE;
} }
HDC STDCALL HDC STDCALL
@ -869,6 +870,10 @@ NtGdiDeleteDC(HDC DCHandle)
{ {
NtGdiDeleteObject (DCToDelete->w.hFirstBitmap); NtGdiDeleteObject (DCToDelete->w.hFirstBitmap);
} }
if (DCToDelete->XlateBrush != NULL)
EngDeleteXlate(DCToDelete->XlateBrush);
if (DCToDelete->XlatePen != NULL)
EngDeleteXlate(DCToDelete->XlatePen);
} }
if (DCToDelete->w.hClipRgn) if (DCToDelete->w.hClipRgn)
{ {
@ -902,6 +907,7 @@ NtGdiDrawEscape(HDC hDC,
LPCSTR lpszInData) LPCSTR lpszInData)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
return 0;
} }
INT STDCALL INT STDCALL
@ -911,6 +917,7 @@ NtGdiEnumObjects(HDC hDC,
LPARAM lParam) LPARAM lParam)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
return 0;
} }
DC_GET_VAL( COLORREF, NtGdiGetBkColor, w.backgroundColor ) DC_GET_VAL( COLORREF, NtGdiGetBkColor, w.backgroundColor )
@ -1613,6 +1620,7 @@ HDC STDCALL
NtGdiResetDC(HDC hDC, CONST DEVMODEW *InitData) NtGdiResetDC(HDC hDC, CONST DEVMODEW *InitData)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
return 0;
} }
BOOL STDCALL BOOL STDCALL
@ -1741,12 +1749,10 @@ NtGdiSelectObject(HDC hDC, HGDIOBJ hGDIObj)
PGDIBRUSHOBJ pen; PGDIBRUSHOBJ pen;
PGDIBRUSHOBJ brush; PGDIBRUSHOBJ brush;
XLATEOBJ *XlateObj; XLATEOBJ *XlateObj;
PPALGDI PalGDI;
DWORD objectType; DWORD objectType;
COLORREF MonoColorMap[2];
ULONG NumColors = 0; ULONG NumColors = 0;
HRGN hVisRgn; HRGN hVisRgn;
USHORT Mode; BOOLEAN Failed;
if(!hDC || !hGDIObj) return NULL; if(!hDC || !hGDIObj) return NULL;
@ -1762,101 +1768,49 @@ NtGdiSelectObject(HDC hDC, HGDIOBJ hGDIObj)
switch (objectType) switch (objectType)
{ {
case GDI_OBJECT_TYPE_PEN: case GDI_OBJECT_TYPE_PEN:
objOrg = NULL;
/* Convert the color of the pen to the format of the DC */
PalGDI = PALETTE_LockPalette(dc->w.hPalette);
if (NULL != PalGDI)
{
Mode = PalGDI->Mode;
PALETTE_UnlockPalette(dc->w.hPalette);
XlateObj = (XLATEOBJ*)IntEngCreateXlate(Mode, PAL_RGB, dc->w.hPalette, NULL);
if (NULL != XlateObj)
{
pen = PENOBJ_LockPen((HPEN) hGDIObj); pen = PENOBJ_LockPen((HPEN) hGDIObj);
if (NULL != pen) if (pen == NULL)
{
if (pen->flAttrs & GDIBRUSH_IS_SOLID)
{
pen->BrushObject.iSolidColor =
XLATEOBJ_iXlate(XlateObj, pen->BrushAttr.lbColor);
}
else
{
pen->BrushObject.iSolidColor = 0xFFFFFFFF;
}
pen->crBack = XLATEOBJ_iXlate(XlateObj, dc->w.backgroundColor);
pen->crFore = XLATEOBJ_iXlate(XlateObj, dc->w.textColor);
PENOBJ_UnlockPen((HPEN) hGDIObj);
objOrg = (HGDIOBJ)dc->w.hPen;
dc->w.hPen = hGDIObj;
}
else
{ {
SetLastWin32Error(ERROR_INVALID_HANDLE); SetLastWin32Error(ERROR_INVALID_HANDLE);
break;
} }
EngDeleteXlate(XlateObj);
} XlateObj = IntGdiCreateBrushXlate(dc, pen, &Failed);
else PENOBJ_UnlockPen((HPEN) hGDIObj);
if (Failed)
{ {
SetLastWin32Error(ERROR_NO_SYSTEM_RESOURCES); SetLastWin32Error(ERROR_NO_SYSTEM_RESOURCES);
break;
} }
}
else objOrg = (HGDIOBJ)dc->w.hPen;
{ dc->w.hPen = hGDIObj;
SetLastWin32Error(ERROR_INVALID_HANDLE); if (dc->XlatePen != NULL)
} EngDeleteXlate(dc->XlatePen);
dc->XlatePen = XlateObj;
break; break;
case GDI_OBJECT_TYPE_BRUSH: case GDI_OBJECT_TYPE_BRUSH:
objOrg = NULL; brush = BRUSHOBJ_LockBrush((HPEN) hGDIObj);
/* Convert the color of the brush to the format of the DC */ if (brush == NULL)
PalGDI = PALETTE_LockPalette(dc->w.hPalette);
if (NULL != PalGDI)
{
Mode = PalGDI->Mode;
PALETTE_UnlockPalette(dc->w.hPalette);
XlateObj = (XLATEOBJ*)IntEngCreateXlate(Mode, PAL_RGB, dc->w.hPalette, NULL);
if (NULL != XlateObj)
{
brush = BRUSHOBJ_LockBrush((HBRUSH) hGDIObj);
if (NULL != brush)
{
if (brush->flAttrs & GDIBRUSH_IS_SOLID)
{
brush->BrushObject.iSolidColor =
XLATEOBJ_iXlate(XlateObj, brush->BrushAttr.lbColor);
}
else
{
brush->BrushObject.iSolidColor = 0xFFFFFFFF;
}
brush->crBack = XLATEOBJ_iXlate(XlateObj, dc->w.backgroundColor);
brush->crFore = XLATEOBJ_iXlate(XlateObj, ((brush->flAttrs & GDIBRUSH_IS_HATCH) ?
brush->BrushAttr.lbColor : dc->w.textColor));
/* according to the documentation of SetBrushOrgEx(), the origin is assigned to the
next brush selected into the DC, so we should set it here */
brush->ptOrigin.x = dc->w.brushOrgX;
brush->ptOrigin.y = dc->w.brushOrgY;
BRUSHOBJ_UnlockBrush((HBRUSH) hGDIObj);
objOrg = (HGDIOBJ)dc->w.hBrush;
dc->w.hBrush = (HBRUSH) hGDIObj;
}
else
{ {
SetLastWin32Error(ERROR_INVALID_HANDLE); SetLastWin32Error(ERROR_INVALID_HANDLE);
break;
} }
EngDeleteXlate(XlateObj);
} XlateObj = IntGdiCreateBrushXlate(dc, brush, &Failed);
else BRUSHOBJ_UnlockBrush((HPEN) hGDIObj);
if (Failed)
{ {
SetLastWin32Error(ERROR_NO_SYSTEM_RESOURCES); SetLastWin32Error(ERROR_NO_SYSTEM_RESOURCES);
break;
} }
}
else objOrg = (HGDIOBJ)dc->w.hBrush;
{ dc->w.hBrush = hGDIObj;
SetLastWin32Error(ERROR_INVALID_HANDLE); if (dc->XlateBrush != NULL)
} EngDeleteXlate(dc->XlateBrush);
dc->XlateBrush = XlateObj;
break; break;
case GDI_OBJECT_TYPE_FONT: case GDI_OBJECT_TYPE_FONT:
@ -1907,17 +1861,12 @@ NtGdiSelectObject(HDC hDC, HGDIOBJ hGDIObj)
else else
{ {
dc->w.bitsPerPixel = BitsPerFormat(pb->SurfObj.iBitmapFormat); dc->w.bitsPerPixel = BitsPerFormat(pb->SurfObj.iBitmapFormat);
if (1 == dc->w.bitsPerPixel)
{
MonoColorMap[0] = RGB(0, 0, 0);
MonoColorMap[1] = RGB(255, 255, 255);
dc->w.hPalette = PALETTE_AllocPaletteIndexedRGB(2, (RGBQUAD*)MonoColorMap);
}
else
{
dc->w.hPalette = dc->DevInfo->hpalDefault; dc->w.hPalette = dc->DevInfo->hpalDefault;
} }
}
/* Reselect brush and pen to regenerate the XLATEOBJs. */
NtGdiSelectObject ( hDC, dc->w.hBrush );
NtGdiSelectObject ( hDC, dc->w.hPen );
DC_UnlockDc ( hDC ); DC_UnlockDc ( hDC );
hVisRgn = NtGdiCreateRectRgn ( 0, 0, pb->SurfObj.sizlBitmap.cx, pb->SurfObj.sizlBitmap.cy ); hVisRgn = NtGdiCreateRectRgn ( 0, 0, pb->SurfObj.sizlBitmap.cx, pb->SurfObj.sizlBitmap.cy );
@ -2034,6 +1983,8 @@ DC_AllocDC(PUNICODE_STRING Driver)
NewDC->wndExtY = 1.0f; NewDC->wndExtY = 1.0f;
NewDC->vportExtX = 1.0f; NewDC->vportExtX = 1.0f;
NewDC->vportExtY = 1.0f; NewDC->vportExtY = 1.0f;
NewDC->w.textColor = 0;
NewDC->w.backgroundColor = 0xffffff;
NewDC->w.hFont = NtGdiGetStockObject(SYSTEM_FONT); NewDC->w.hFont = NtGdiGetStockObject(SYSTEM_FONT);
TextIntRealizeFont(NewDC->w.hFont); TextIntRealizeFont(NewDC->w.hFont);
@ -2183,89 +2134,20 @@ IntIsPrimarySurface(SURFOBJ *SurfObj)
COLORREF FASTCALL COLORREF FASTCALL
IntGetDCColor(HDC hDC, ULONG Object) IntGetDCColor(HDC hDC, ULONG Object)
{ {
COLORREF Result; /*
DC *dc; * The previous implementation was completly incorrect. It modified the
PPALGDI PalGDI; * brush that was currently selected into the device context, but in fact
PGDIBRUSHOBJ pen; * the DC pen/brush color should be stored directly in the device context
PGDIBRUSHOBJ brush; * (at address 0x2C of the user mode DC object memory on Windows 2K/XP).
XLATEOBJ *XlateObj; * The actual color is then used when DC_BRUSH/DC_PEN object is selected
HPALETTE Pal = 0; * into the device context and BRUSHOBJ for drawing is composed (belongs
USHORT Mode; * to IntGdiInitBrushInstance in the current ReactOS implementation). Also
ULONG iColor; * the implementation should be moved to user mode GDI32.dll when UM
* mapped GDI objects will be implemented.
*/
if(!(dc = DC_LockDc(hDC))) DPRINT("WIN32K:IntGetDCColor is unimplemented\n");
{ return 0xFFFFFF; /* The default DC color. */
SetLastWin32Error(ERROR_INVALID_HANDLE);
return CLR_INVALID;
}
switch(Object)
{
case OBJ_PEN:
{
if(!(pen = PENOBJ_LockPen(dc->w.hPen)))
{
DC_UnlockDc(hDC);
return CLR_INVALID;
}
if(!(pen->flAttrs & GDIBRUSH_IS_SOLID))
{
/* FIXME - just bail here? */
PENOBJ_UnlockPen(dc->w.hPen);
DC_UnlockDc(hDC);
return CLR_INVALID;
}
iColor = pen->BrushObject.iSolidColor;
PENOBJ_UnlockPen(dc->w.hPen);
break;
}
case OBJ_BRUSH:
{
if(!(brush = BRUSHOBJ_LockBrush(dc->w.hBrush)))
{
DC_UnlockDc(hDC);
return CLR_INVALID;
}
if(!(brush->flAttrs & GDIBRUSH_IS_SOLID))
{
/* FIXME - just bail here? */
BRUSHOBJ_UnlockBrush(dc->w.hBrush);
DC_UnlockDc(hDC);
return CLR_INVALID;
}
iColor = brush->BrushObject.iSolidColor;
BRUSHOBJ_UnlockBrush(dc->w.hBrush);
break;
}
default:
{
DC_UnlockDc(hDC);
SetLastWin32Error(ERROR_INVALID_PARAMETER);
return CLR_INVALID;
}
}
/* translate the color into RGB */
if(dc->w.hPalette)
Pal = dc->w.hPalette;
Result = CLR_INVALID;
if((PalGDI = PALETTE_LockPalette(dc->w.hPalette)))
{
Mode = PalGDI->Mode;
PALETTE_UnlockPalette(dc->w.hPalette);
XlateObj = (XLATEOBJ*)IntEngCreateXlate(PAL_RGB, Mode, NULL, Pal);
if(XlateObj)
{
Result = XLATEOBJ_iXlate(XlateObj, iColor);
EngDeleteXlate(XlateObj);
}
}
DC_UnlockDc(hDC);
return Result;
} }
/* /*
@ -2275,133 +2157,10 @@ IntGetDCColor(HDC hDC, ULONG Object)
COLORREF FASTCALL COLORREF FASTCALL
IntSetDCColor(HDC hDC, ULONG Object, COLORREF Color) IntSetDCColor(HDC hDC, ULONG Object, COLORREF Color)
{ {
COLORREF Result; /* See the comment in IntGetDCColor. */
DC *dc;
PPALGDI PalGDI;
PGDIBRUSHOBJ pen;
PGDIBRUSHOBJ brush;
XLATEOBJ *XlateObj;
HPALETTE Pal = 0;
USHORT Mode;
ULONG iColor;
if(Color == CLR_INVALID) DPRINT("WIN32K:IntSetDCColor is unimplemented\n");
{
SetLastWin32Error(ERROR_INVALID_PARAMETER);
return CLR_INVALID; return CLR_INVALID;
} }
if(!(dc = DC_LockDc(hDC)))
{
SetLastWin32Error(ERROR_INVALID_HANDLE);
return CLR_INVALID;
}
switch(Object)
{
case OBJ_PEN:
{
if(!(pen = PENOBJ_LockPen(dc->w.hPen)))
{
DC_UnlockDc(hDC);
return CLR_INVALID;
}
if(!(pen->flAttrs & GDIBRUSH_IS_SOLID))
{
/* FIXME - just bail here? */
PENOBJ_UnlockPen(dc->w.hPen);
DC_UnlockDc(hDC);
return CLR_INVALID;
}
/* save old color index, translate it to RGB later */
iColor = pen->BrushObject.iSolidColor;
if(!(PalGDI = PALETTE_LockPalette(dc->w.hPalette)))
{
PENOBJ_UnlockPen(dc->w.hPen);
DC_UnlockDc(hDC);
return CLR_INVALID;
}
Mode = PalGDI->Mode;
PALETTE_UnlockPalette(dc->w.hPalette);
if(!(XlateObj = (XLATEOBJ*)IntEngCreateXlate(Mode, PAL_RGB, dc->w.hPalette, NULL)))
{
PENOBJ_UnlockPen(dc->w.hPen);
DC_UnlockDc(hDC);
return CLR_INVALID;
}
pen->BrushObject.iSolidColor = XLATEOBJ_iXlate(XlateObj, (ULONG)Color);
EngDeleteXlate(XlateObj);
PENOBJ_UnlockPen(dc->w.hPen);
break;
}
case OBJ_BRUSH:
{
if(!(brush = BRUSHOBJ_LockBrush(dc->w.hBrush)))
{
DC_UnlockDc(hDC);
return CLR_INVALID;
}
if(!(brush->flAttrs & GDIBRUSH_IS_SOLID))
{
/* FIXME - just bail here? */
BRUSHOBJ_UnlockBrush(dc->w.hBrush);
DC_UnlockDc(hDC);
return CLR_INVALID;
}
/* save old color index, translate it to RGB later */
iColor = brush->BrushObject.iSolidColor;
if(!(PalGDI = PALETTE_LockPalette(dc->w.hPalette)))
{
PENOBJ_UnlockPen(dc->w.hPen);
DC_UnlockDc(hDC);
return CLR_INVALID;
}
Mode = PalGDI->Mode;
PALETTE_UnlockPalette(dc->w.hPalette);
if(!(XlateObj = (XLATEOBJ*)IntEngCreateXlate(Mode, PAL_RGB, dc->w.hPalette, NULL)))
{
PENOBJ_UnlockPen(dc->w.hPen);
DC_UnlockDc(hDC);
return CLR_INVALID;
}
brush->BrushObject.iSolidColor = XLATEOBJ_iXlate(XlateObj, (ULONG)Color);
EngDeleteXlate(XlateObj);
BRUSHOBJ_UnlockBrush(dc->w.hBrush);
break;
}
default:
{
DC_UnlockDc(hDC);
SetLastWin32Error(ERROR_INVALID_PARAMETER);
return CLR_INVALID;
}
}
/* translate the old color into RGB */
if(dc->w.hPalette)
Pal = dc->w.hPalette;
Result = CLR_INVALID;
if((PalGDI = PALETTE_LockPalette(dc->w.hPalette)))
{
Mode = PalGDI->Mode;
PALETTE_UnlockPalette(dc->w.hPalette);
XlateObj = (XLATEOBJ*)IntEngCreateXlate(PAL_RGB, Mode, NULL, Pal);
if(XlateObj)
{
Result = XLATEOBJ_iXlate(XlateObj, iColor);
EngDeleteXlate(XlateObj);
}
}
DC_UnlockDc(hDC);
return Result;
}
/* EOF */ /* EOF */

View file

@ -16,24 +16,24 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
/* $Id: fillshap.c,v 1.51 2004/07/03 13:55:36 navaraf Exp $ */ /* $Id: fillshap.c,v 1.52 2004/07/14 20:48:58 navaraf Exp $ */
#include <w32k.h> #include <w32k.h>
/* /*
* a couple macros to fill a single pixel or a line * a couple macros to fill a single pixel or a line
*/ */
#define PUTPIXEL(x,y,brushObj) \ #define PUTPIXEL(x,y,BrushInst) \
ret = ret && IntEngLineTo(BitmapObj, \ ret = ret && IntEngLineTo(BitmapObj, \
dc->CombinedClip, \ dc->CombinedClip, \
&brushObj->BrushObject, \ &BrushInst.BrushObject, \
x, y, (x)+1, y, \ x, y, (x)+1, y, \
&RectBounds, \ &RectBounds, \
dc->w.ROPmode); dc->w.ROPmode);
#define PUTLINE(x1,y1,x2,y2,brushObj) \ #define PUTLINE(x1,y1,x2,y2,BrushInst) \
ret = ret && IntEngLineTo(BitmapObj, \ ret = ret && IntEngLineTo(BitmapObj, \
dc->CombinedClip, \ dc->CombinedClip, \
&brushObj->BrushObject, \ &BrushInst.BrushObject, \
x1, y1, x2, y2, \ x1, y1, x2, y2, \
&RectBounds, \ &RectBounds, \
dc->w.ROPmode); dc->w.ROPmode);
@ -45,6 +45,7 @@ IntGdiPolygon(PDC dc,
{ {
BITMAPOBJ *BitmapObj; BITMAPOBJ *BitmapObj;
PGDIBRUSHOBJ PenBrushObj, FillBrushObj; PGDIBRUSHOBJ PenBrushObj, FillBrushObj;
GDIBRUSHINST PenBrushInst, FillBrushInst;
BOOL ret = FALSE; // default to failure BOOL ret = FALSE; // default to failure
RECTL DestRect; RECTL DestRect;
int CurrentPoint; int CurrentPoint;
@ -88,11 +89,15 @@ IntGdiPolygon(PDC dc,
FillBrushObj = BRUSHOBJ_LockBrush(dc->w.hBrush); FillBrushObj = BRUSHOBJ_LockBrush(dc->w.hBrush);
ASSERT(FillBrushObj); ASSERT(FillBrushObj);
if (!(FillBrushObj->flAttrs & GDIBRUSH_IS_NULL)) if (!(FillBrushObj->flAttrs & GDIBRUSH_IS_NULL))
ret = FillPolygon ( dc, BitmapObj, &FillBrushObj->BrushObject, dc->w.ROPmode, UnsafePoints, Count, DestRect ); {
IntGdiInitBrushInstance(&FillBrushInst, FillBrushObj, dc->XlateBrush);
ret = FillPolygon ( dc, BitmapObj, &FillBrushInst.BrushObject, dc->w.ROPmode, UnsafePoints, Count, DestRect );
}
BRUSHOBJ_UnlockBrush(dc->w.hBrush); BRUSHOBJ_UnlockBrush(dc->w.hBrush);
/* get BRUSHOBJ from current pen. */ /* get BRUSHOBJ from current pen. */
PenBrushObj = PENOBJ_LockPen(dc->w.hPen); PenBrushObj = PENOBJ_LockPen(dc->w.hPen);
IntGdiInitBrushInstance(&PenBrushInst, PenBrushObj, dc->XlatePen);
// Draw the Polygon Edges with the current pen ( if not a NULL pen ) // Draw the Polygon Edges with the current pen ( if not a NULL pen )
if (!(PenBrushObj->flAttrs & GDIBRUSH_IS_NULL)) if (!(PenBrushObj->flAttrs & GDIBRUSH_IS_NULL))
@ -114,7 +119,7 @@ IntGdiPolygon(PDC dc,
//DPRINT("Polygon Making line from (%d,%d) to (%d,%d)\n", From.x, From.y, To.x, To.y ); //DPRINT("Polygon Making line from (%d,%d) to (%d,%d)\n", From.x, From.y, To.x, To.y );
ret = IntEngLineTo(BitmapObj, ret = IntEngLineTo(BitmapObj,
dc->CombinedClip, dc->CombinedClip,
&PenBrushObj->BrushObject, &PenBrushInst.BrushObject,
From.x, From.x,
From.y, From.y,
To.x, To.x,
@ -173,6 +178,7 @@ NtGdiChord(HDC hDC,
int YRadial2) int YRadial2)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
return FALSE;
} }
/* /*
@ -206,6 +212,7 @@ NtGdiEllipse(
int RadiusX, RadiusY; int RadiusX, RadiusY;
int Temp; int Temp;
PGDIBRUSHOBJ FillBrush, PenBrush; PGDIBRUSHOBJ FillBrush, PenBrush;
GDIBRUSHINST FillBrushInst, PenBrushInst;
BITMAPOBJ *BitmapObj; BITMAPOBJ *BitmapObj;
RECTL RectBounds; RECTL RectBounds;
PDC dc; PDC dc;
@ -252,6 +259,9 @@ NtGdiEllipse(
BitmapObj = BITMAPOBJ_LockBitmap(dc->w.hBitmap); BitmapObj = BITMAPOBJ_LockBitmap(dc->w.hBitmap);
ASSERT(BitmapObj); ASSERT(BitmapObj);
IntGdiInitBrushInstance(&FillBrushInst, FillBrush, dc->XlateBrush);
IntGdiInitBrushInstance(&PenBrushInst, PenBrush, dc->XlatePen);
nLeftRect += dc->w.DCOrgX; nLeftRect += dc->w.DCOrgX;
nRightRect += dc->w.DCOrgX - 1; nRightRect += dc->w.DCOrgX - 1;
nTopRect += dc->w.DCOrgY; nTopRect += dc->w.DCOrgY;
@ -319,10 +329,10 @@ NtGdiEllipse(
if ((A > da) && (A < db)) if ((A > da) && (A < db))
{ {
PUTLINE(CenterX - D, CenterY + A, CenterX + D, CenterY + A, FillBrush); PUTLINE(CenterX - D, CenterY + A, CenterX + D, CenterY + A, FillBrushInst);
if (A) if (A)
{ {
PUTLINE(CenterX - D, CenterY - A, CenterX + D, CenterY - A, FillBrush); PUTLINE(CenterX - D, CenterY - A, CenterX + D, CenterY - A, FillBrushInst);
} }
da = A; da = A;
} }
@ -333,8 +343,8 @@ NtGdiEllipse(
if ((B < db) && (B > da)) if ((B < db) && (B > da))
{ {
PUTLINE(CenterX - C, CenterY + B, CenterX + C, CenterY + B, FillBrush); PUTLINE(CenterX - C, CenterY + B, CenterX + C, CenterY + B, FillBrushInst);
PUTLINE(CenterX - C, CenterY - B, CenterX + C, CenterY - B, FillBrush); PUTLINE(CenterX - C, CenterY - B, CenterX + C, CenterY - B, FillBrushInst);
db = B; db = B;
} }
@ -344,27 +354,27 @@ NtGdiEllipse(
if (Cond1) if (Cond1)
{ {
PUTPIXEL(CenterX + C, CenterY + B, PenBrush); PUTPIXEL(CenterX + C, CenterY + B, PenBrushInst);
if (C) if (C)
PUTPIXEL(CenterX - C, CenterY + B, PenBrush); PUTPIXEL(CenterX - C, CenterY + B, PenBrushInst);
if (B) if (B)
{ {
PUTPIXEL(CenterX + C, CenterY - B, PenBrush); PUTPIXEL(CenterX + C, CenterY - B, PenBrushInst);
if (C) if (C)
PUTPIXEL(CenterX - C, CenterY - B, PenBrush); PUTPIXEL(CenterX - C, CenterY - B, PenBrushInst);
} }
} }
if (Cond2) if (Cond2)
{ {
PUTPIXEL(CenterX + D, CenterY + A, PenBrush); PUTPIXEL(CenterX + D, CenterY + A, PenBrushInst);
if (D) if (D)
PUTPIXEL(CenterX - D, CenterY + A, PenBrush); PUTPIXEL(CenterX - D, CenterY + A, PenBrushInst);
if (A) if (A)
{ {
PUTPIXEL(CenterX + D, CenterY - A, PenBrush); PUTPIXEL(CenterX + D, CenterY - A, PenBrushInst);
if (D) if (D)
PUTPIXEL(CenterX - D, CenterY - A, PenBrush); PUTPIXEL(CenterX - D, CenterY - A, PenBrushInst);
} }
} }
} while (B > A); } while (B > A);
@ -922,6 +932,7 @@ IntRectangle(PDC dc,
{ {
BITMAPOBJ *BitmapObj = BITMAPOBJ_LockBitmap(dc->w.hBitmap); BITMAPOBJ *BitmapObj = BITMAPOBJ_LockBitmap(dc->w.hBitmap);
PGDIBRUSHOBJ PenBrushObj, FillBrushObj; PGDIBRUSHOBJ PenBrushObj, FillBrushObj;
GDIBRUSHINST PenBrushInst, FillBrushInst;
BOOL ret = FALSE; // default to failure BOOL ret = FALSE; // default to failure
RECTL DestRect; RECTL DestRect;
@ -945,6 +956,7 @@ IntRectangle(PDC dc,
DestRect.bottom = BottomRect; DestRect.bottom = BottomRect;
FillBrushObj = BRUSHOBJ_LockBrush(dc->w.hBrush); FillBrushObj = BRUSHOBJ_LockBrush(dc->w.hBrush);
IntGdiInitBrushInstance(&FillBrushInst, FillBrushObj, dc->XlateBrush);
if ( FillBrushObj ) if ( FillBrushObj )
{ {
@ -958,7 +970,7 @@ IntRectangle(PDC dc,
&DestRect, &DestRect,
NULL, NULL,
NULL, NULL,
&FillBrushObj->BrushObject, &FillBrushInst.BrushObject,
NULL, NULL,
PATCOPY); PATCOPY);
} }
@ -975,6 +987,8 @@ IntRectangle(PDC dc,
return FALSE; return FALSE;
} }
IntGdiInitBrushInstance(&PenBrushInst, PenBrushObj, dc->XlatePen);
// Draw the rectangle with the current pen // Draw the rectangle with the current pen
ret = TRUE; // change default to success ret = TRUE; // change default to success
@ -983,28 +997,28 @@ IntRectangle(PDC dc,
{ {
ret = ret && IntEngLineTo(BitmapObj, ret = ret && IntEngLineTo(BitmapObj,
dc->CombinedClip, dc->CombinedClip,
&PenBrushObj->BrushObject, &PenBrushInst.BrushObject,
LeftRect, TopRect, RightRect, TopRect, LeftRect, TopRect, RightRect, TopRect,
&DestRect, // Bounding rectangle &DestRect, // Bounding rectangle
dc->w.ROPmode); // MIX dc->w.ROPmode); // MIX
ret = ret && IntEngLineTo(BitmapObj, ret = ret && IntEngLineTo(BitmapObj,
dc->CombinedClip, dc->CombinedClip,
&PenBrushObj->BrushObject, &PenBrushInst.BrushObject,
RightRect, TopRect, RightRect, BottomRect, RightRect, TopRect, RightRect, BottomRect,
&DestRect, // Bounding rectangle &DestRect, // Bounding rectangle
dc->w.ROPmode); // MIX dc->w.ROPmode); // MIX
ret = ret && IntEngLineTo(BitmapObj, ret = ret && IntEngLineTo(BitmapObj,
dc->CombinedClip, dc->CombinedClip,
&PenBrushObj->BrushObject, &PenBrushInst.BrushObject,
RightRect, BottomRect, LeftRect, BottomRect, RightRect, BottomRect, LeftRect, BottomRect,
&DestRect, // Bounding rectangle &DestRect, // Bounding rectangle
dc->w.ROPmode); // MIX dc->w.ROPmode); // MIX
ret = ret && IntEngLineTo(BitmapObj, ret = ret && IntEngLineTo(BitmapObj,
dc->CombinedClip, dc->CombinedClip,
&PenBrushObj->BrushObject, &PenBrushInst.BrushObject,
LeftRect, BottomRect, LeftRect, TopRect, LeftRect, BottomRect, LeftRect, TopRect,
&DestRect, // Bounding rectangle &DestRect, // Bounding rectangle
dc->w.ROPmode); // MIX */ dc->w.ROPmode); // MIX */
@ -1059,6 +1073,7 @@ IntRoundRect(
{ {
BITMAPOBJ *BitmapObj; BITMAPOBJ *BitmapObj;
PGDIBRUSHOBJ PenBrushObj, FillBrushObj; PGDIBRUSHOBJ PenBrushObj, FillBrushObj;
GDIBRUSHINST FillBrushInst, PenBrushInst;
RECTL RectBounds; RECTL RectBounds;
int i, col, row, width, height, x1, x1start, x2, x2start, y1, y2; int i, col, row, width, height, x1, x1start, x2, x2start, y1, y2;
int xradius, yradius; int xradius, yradius;
@ -1108,6 +1123,9 @@ IntRoundRect(
PenBrushObj = NULL; PenBrushObj = NULL;
} }
IntGdiInitBrushInstance(&FillBrushInst, FillBrushObj, dc->XlateBrush);
IntGdiInitBrushInstance(&PenBrushInst, PenBrushObj, dc->XlatePen);
right--; right--;
bottom--; bottom--;
@ -1148,20 +1166,20 @@ IntRoundRect(
if ( d >= 0 ) if ( d >= 0 )
{ {
if ( FillBrushObj ) if ( FillBrushObj )
PUTLINE ( x1, y1, x2, y1, FillBrushObj ); PUTLINE ( x1, y1, x2, y1, FillBrushInst );
if ( first ) if ( first )
{ {
if ( PenBrushObj ) if ( PenBrushObj )
{ {
if ( x1start > x1 ) if ( x1start > x1 )
{ {
PUTLINE ( x1, y1, x1start, y1, PenBrushObj ); PUTLINE ( x1, y1, x1start, y1, PenBrushInst );
PUTLINE ( x2start+1, y2, x2+1, y2, PenBrushObj ); PUTLINE ( x2start+1, y2, x2+1, y2, PenBrushInst );
} }
else else
{ {
PUTPIXEL ( x1, y1, PenBrushObj ); PUTPIXEL ( x1, y1, PenBrushInst );
PUTPIXEL ( x2, y2, PenBrushObj ); PUTPIXEL ( x2, y2, PenBrushInst );
} }
} }
first = FALSE; first = FALSE;
@ -1169,18 +1187,18 @@ IntRoundRect(
else else
{ {
if ( FillBrushObj ) if ( FillBrushObj )
PUTLINE ( x1, y2, x2, y2, FillBrushObj ); PUTLINE ( x1, y2, x2, y2, FillBrushInst );
if ( PenBrushObj ) if ( PenBrushObj )
{ {
if ( x1start >= x1 ) if ( x1start >= x1 )
{ {
PUTLINE ( x1, y1, x1start+1, y1, PenBrushObj ); PUTLINE ( x1, y1, x1start+1, y1, PenBrushInst );
PUTLINE ( x2start, y2, x2+1, y2, PenBrushObj ); PUTLINE ( x2start, y2, x2+1, y2, PenBrushInst );
} }
else else
{ {
PUTPIXEL ( x1, y1, PenBrushObj ); PUTPIXEL ( x1, y1, PenBrushInst );
PUTPIXEL ( x2, y2, PenBrushObj ); PUTPIXEL ( x2, y2, PenBrushInst );
} }
} }
} }
@ -1188,13 +1206,13 @@ IntRoundRect(
{ {
if ( x1start > x1 ) if ( x1start > x1 )
{ {
PUTLINE ( x1, y2, x1start+1, y2, PenBrushObj ); PUTLINE ( x1, y2, x1start+1, y2, PenBrushInst );
PUTLINE ( x2start, y1, x2+1, y1, PenBrushObj ); PUTLINE ( x2start, y1, x2+1, y1, PenBrushInst );
} }
else else
{ {
PUTPIXEL ( x1, y2, PenBrushObj ); PUTPIXEL ( x1, y2, PenBrushInst );
PUTPIXEL ( x2, y1, PenBrushObj ); PUTPIXEL ( x2, y1, PenBrushInst );
} }
} }
x1start = x1-1; x1start = x1-1;
@ -1224,15 +1242,15 @@ IntRoundRect(
{ {
if ( FillBrushObj ) if ( FillBrushObj )
{ {
PUTLINE ( x1, y1, x2, y1, FillBrushObj ); PUTLINE ( x1, y1, x2, y1, FillBrushInst );
PUTLINE ( x1, y2, x2, y2, FillBrushObj ); PUTLINE ( x1, y2, x2, y2, FillBrushInst );
} }
if ( PenBrushObj ) if ( PenBrushObj )
{ {
PUTPIXEL ( x2, y1, PenBrushObj ); PUTPIXEL ( x2, y1, PenBrushInst );
PUTPIXEL ( x1, y2, PenBrushObj ); PUTPIXEL ( x1, y2, PenBrushInst );
PUTPIXEL ( x2, y2, PenBrushObj ); PUTPIXEL ( x2, y2, PenBrushInst );
PUTPIXEL ( x1, y1, PenBrushObj ); PUTPIXEL ( x1, y1, PenBrushInst );
} }
if ( d <= 0 ) if ( d <= 0 )
@ -1247,22 +1265,22 @@ IntRoundRect(
if ( FillBrushObj ) if ( FillBrushObj )
{ {
PUTLINE ( left, y1, right, y1, FillBrushObj ); PUTLINE ( left, y1, right, y1, FillBrushInst );
PUTLINE ( left, y2, right, y2, FillBrushObj ); PUTLINE ( left, y2, right, y2, FillBrushInst );
} }
if ( PenBrushObj ) if ( PenBrushObj )
{ {
if ( x1 > (left+1) ) if ( x1 > (left+1) )
{ {
PUTLINE ( left, y1, x1, y1, PenBrushObj ); PUTLINE ( left, y1, x1, y1, PenBrushInst );
PUTLINE ( x2+1, y1, right, y1, PenBrushObj ); PUTLINE ( x2+1, y1, right, y1, PenBrushInst );
PUTLINE ( left+1, y2, x1, y2, PenBrushObj ); PUTLINE ( left+1, y2, x1, y2, PenBrushInst );
PUTLINE ( x2+1, y2, right+1, y2, PenBrushObj ); PUTLINE ( x2+1, y2, right+1, y2, PenBrushInst );
} }
else else
{ {
PUTPIXEL ( left, y1, PenBrushObj ); PUTPIXEL ( left, y1, PenBrushInst );
PUTPIXEL ( right, y2, PenBrushObj ); PUTPIXEL ( right, y2, PenBrushInst );
} }
} }
@ -1274,15 +1292,15 @@ IntRoundRect(
if ( FillBrushObj ) if ( FillBrushObj )
{ {
for ( i = y1+1; i < y2; i++ ) for ( i = y1+1; i < y2; i++ )
PUTLINE ( left, i, right, i, FillBrushObj ); PUTLINE ( left, i, right, i, FillBrushInst );
} }
if ( PenBrushObj ) if ( PenBrushObj )
{ {
PUTLINE ( x1, top, x2, top, PenBrushObj ); PUTLINE ( x1, top, x2, top, PenBrushInst );
PUTLINE ( right, y1, right, y2, PenBrushObj ); PUTLINE ( right, y1, right, y2, PenBrushInst );
PUTLINE ( x2, bottom, x1, bottom, PenBrushObj ); PUTLINE ( x2, bottom, x1, bottom, PenBrushInst );
PUTLINE ( left, y2, left, y1, PenBrushObj ); PUTLINE ( left, y2, left, y1, PenBrushInst );
} }
BITMAPOBJ_UnlockBitmap(dc->w.hBitmap); BITMAPOBJ_UnlockBitmap(dc->w.hBitmap);

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
/* $Id: icm.c,v 1.10 2004/05/10 17:07:20 weiden Exp $ */ /* $Id: icm.c,v 1.11 2004/07/14 20:48:58 navaraf Exp $ */
#include <w32k.h> #include <w32k.h>
BOOL BOOL
@ -27,6 +27,7 @@ NtGdiCheckColorsInGamut(HDC hDC,
UINT Count) UINT Count)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
return FALSE;
} }
BOOL BOOL
@ -36,6 +37,7 @@ NtGdiColorMatchToTarget(HDC hDC,
DWORD Action) DWORD Action)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
return FALSE;
} }
HCOLORSPACE HCOLORSPACE
@ -43,6 +45,7 @@ STDCALL
NtGdiCreateColorSpace(LPLOGCOLORSPACEW LogColorSpace) NtGdiCreateColorSpace(LPLOGCOLORSPACEW LogColorSpace)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
return 0;
} }
BOOL BOOL
@ -50,6 +53,7 @@ STDCALL
NtGdiDeleteColorSpace(HCOLORSPACE hColorSpace) NtGdiDeleteColorSpace(HCOLORSPACE hColorSpace)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
return FALSE;
} }
INT INT
@ -81,6 +85,7 @@ NtGdiGetDeviceGammaRamp(HDC hDC,
LPVOID Ramp) LPVOID Ramp)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
return FALSE;
} }
BOOL BOOL
@ -90,6 +95,7 @@ NtGdiGetICMProfile(HDC hDC,
LPWSTR Filename) LPWSTR Filename)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
return FALSE;
} }
BOOL BOOL
@ -99,6 +105,7 @@ NtGdiGetLogColorSpace(HCOLORSPACE hColorSpace,
DWORD Size) DWORD Size)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
return FALSE;
} }
HCOLORSPACE HCOLORSPACE
@ -107,6 +114,7 @@ NtGdiSetColorSpace(HDC hDC,
HCOLORSPACE hColorSpace) HCOLORSPACE hColorSpace)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
return 0;
} }
BOOL BOOL
@ -115,6 +123,7 @@ NtGdiSetDeviceGammaRamp(HDC hDC,
LPVOID Ramp) LPVOID Ramp)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
return FALSE;
} }
INT INT
@ -145,6 +154,7 @@ NtGdiSetICMProfile(HDC hDC,
LPWSTR Filename) LPWSTR Filename)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
return FALSE;
} }
BOOL BOOL
@ -155,6 +165,7 @@ NtGdiUpdateICMRegKey(DWORD Reserved,
UINT Command) UINT Command)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
return FALSE;
} }
/* EOF */ /* EOF */

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
/* $Id: line.c,v 1.36 2004/07/03 22:36:01 navaraf Exp $ */ /* $Id: line.c,v 1.37 2004/07/14 20:48:58 navaraf Exp $ */
#include <w32k.h> #include <w32k.h>
// Some code from the WINE project source (www.winehq.com) // Some code from the WINE project source (www.winehq.com)
@ -54,6 +54,7 @@ IntGdiLineTo(DC *dc,
BITMAPOBJ *BitmapObj; BITMAPOBJ *BitmapObj;
BOOL Ret = TRUE; BOOL Ret = TRUE;
PGDIBRUSHOBJ PenBrushObj; PGDIBRUSHOBJ PenBrushObj;
GDIBRUSHINST PenBrushInst;
RECTL Bounds; RECTL Bounds;
POINT Points[2]; POINT Points[2];
@ -101,9 +102,10 @@ IntGdiLineTo(DC *dc,
if (!(PenBrushObj->flAttrs & GDIBRUSH_IS_NULL)) if (!(PenBrushObj->flAttrs & GDIBRUSH_IS_NULL))
{ {
IntGdiInitBrushInstance(&PenBrushInst, PenBrushObj, dc->XlatePen);
Ret = IntEngLineTo(BitmapObj, Ret = IntEngLineTo(BitmapObj,
dc->CombinedClip, dc->CombinedClip,
&PenBrushObj->BrushObject, &PenBrushInst.BrushObject,
Points[0].x, Points[0].y, Points[0].x, Points[0].y,
Points[1].x, Points[1].y, Points[1].x, Points[1].y,
&Bounds, &Bounds,
@ -190,6 +192,7 @@ IntGdiPolyline(DC *dc,
{ {
BITMAPOBJ *BitmapObj; BITMAPOBJ *BitmapObj;
GDIBRUSHOBJ *PenBrushObj; GDIBRUSHOBJ *PenBrushObj;
GDIBRUSHINST PenBrushInst;
LPPOINT Points; LPPOINT Points;
BOOL Ret = TRUE; BOOL Ret = TRUE;
LONG i; LONG i;
@ -219,8 +222,9 @@ IntGdiPolyline(DC *dc,
Points[i].y += dc->w.DCOrgY; Points[i].y += dc->w.DCOrgY;
} }
IntGdiInitBrushInstance(&PenBrushInst, PenBrushObj, dc->XlatePen);
Ret = IntEngPolyline(BitmapObj, dc->CombinedClip, Ret = IntEngPolyline(BitmapObj, dc->CombinedClip,
&PenBrushObj->BrushObject, Points, Count, &PenBrushInst.BrushObject, Points, Count,
dc->w.ROPmode); dc->w.ROPmode);
BITMAPOBJ_UnlockBitmap(dc->w.hBitmap); BITMAPOBJ_UnlockBitmap(dc->w.hBitmap);
@ -337,6 +341,7 @@ NtGdiAngleArc(HDC hDC,
FLOAT SweepAngle) FLOAT SweepAngle)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
return FALSE;
} }
BOOL BOOL
@ -611,6 +616,7 @@ NtGdiPolyDraw(HDC hDC,
int Count) int Count)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
return FALSE;
} }
BOOL BOOL

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
/* $Id: metafile.c,v 1.10 2004/05/10 17:07:20 weiden Exp $ */ /* $Id: metafile.c,v 1.11 2004/07/14 20:48:58 navaraf Exp $ */
#include <w32k.h> #include <w32k.h>
HENHMETAFILE HENHMETAFILE
@ -24,6 +24,7 @@ STDCALL
NtGdiCloseEnhMetaFile(HDC hDC) NtGdiCloseEnhMetaFile(HDC hDC)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
return 0;
} }
HMETAFILE HMETAFILE
@ -31,6 +32,7 @@ STDCALL
NtGdiCloseMetaFile(HDC hDC) NtGdiCloseMetaFile(HDC hDC)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
return 0;
} }
HENHMETAFILE HENHMETAFILE
@ -39,6 +41,7 @@ NtGdiCopyEnhMetaFile(HENHMETAFILE Src,
LPCWSTR File) LPCWSTR File)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
return 0;
} }
HMETAFILE HMETAFILE
@ -47,6 +50,7 @@ NtGdiCopyMetaFile(HMETAFILE Src,
LPCWSTR File) LPCWSTR File)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
return 0;
} }
HDC HDC
@ -57,6 +61,7 @@ NtGdiCreateEnhMetaFile(HDC hDCRef,
LPCWSTR Description) LPCWSTR Description)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
return 0;
} }
HDC HDC
@ -64,6 +69,7 @@ STDCALL
NtGdiCreateMetaFile(LPCWSTR File) NtGdiCreateMetaFile(LPCWSTR File)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
return 0;
} }
BOOL BOOL
@ -71,6 +77,7 @@ STDCALL
NtGdiDeleteEnhMetaFile(HENHMETAFILE emf) NtGdiDeleteEnhMetaFile(HENHMETAFILE emf)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
return FALSE;
} }
BOOL BOOL
@ -78,6 +85,7 @@ STDCALL
NtGdiDeleteMetaFile(HMETAFILE mf) NtGdiDeleteMetaFile(HMETAFILE mf)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
return FALSE;
} }
BOOL BOOL
@ -89,6 +97,7 @@ NtGdiEnumEnhMetaFile(HDC hDC,
CONST LPRECT Rect) CONST LPRECT Rect)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
return FALSE;
} }
BOOL BOOL
@ -99,6 +108,7 @@ NtGdiEnumMetaFile(HDC hDC,
LPARAM lParam) LPARAM lParam)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
return FALSE;
} }
BOOL BOOL
@ -108,6 +118,7 @@ NtGdiGdiComment(HDC hDC,
CONST LPBYTE Data) CONST LPBYTE Data)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
return FALSE;
} }
HENHMETAFILE HENHMETAFILE
@ -115,6 +126,7 @@ STDCALL
NtGdiGetEnhMetaFile(LPCWSTR MetaFile) NtGdiGetEnhMetaFile(LPCWSTR MetaFile)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
return 0;
} }
UINT UINT
@ -124,6 +136,7 @@ NtGdiGetEnhMetaFileBits(HENHMETAFILE hemf,
LPBYTE Buffer) LPBYTE Buffer)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
return 0;
} }
UINT UINT
@ -133,6 +146,7 @@ NtGdiGetEnhMetaFileDescription(HENHMETAFILE hemf,
LPWSTR Description) LPWSTR Description)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
return 0;
} }
UINT UINT
@ -142,6 +156,7 @@ NtGdiGetEnhMetaFileHeader(HENHMETAFILE hemf,
LPENHMETAHEADER emh) LPENHMETAHEADER emh)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
return 0;
} }
UINT UINT
@ -151,6 +166,7 @@ NtGdiGetEnhMetaFilePaletteEntries(HENHMETAFILE hemf,
LPPALETTEENTRY pe) LPPALETTEENTRY pe)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
return 0;
} }
HMETAFILE HMETAFILE
@ -158,6 +174,7 @@ STDCALL
NtGdiGetMetaFile(LPCWSTR MetaFile) NtGdiGetMetaFile(LPCWSTR MetaFile)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
return 0;
} }
UINT UINT
@ -167,6 +184,7 @@ NtGdiGetMetaFileBitsEx(HMETAFILE hmf,
LPVOID Data) LPVOID Data)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
return 0;
} }
UINT UINT
@ -178,6 +196,7 @@ NtGdiGetWinMetaFileBits(HENHMETAFILE hemf,
HDC Ref) HDC Ref)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
return 0;
} }
BOOL BOOL
@ -187,6 +206,7 @@ NtGdiPlayEnhMetaFile(HDC hDC,
CONST PRECT Rect) CONST PRECT Rect)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
return FALSE;
} }
BOOL BOOL
@ -197,6 +217,7 @@ NtGdiPlayEnhMetaFileRecord(HDC hDC,
UINT Handles) UINT Handles)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
return FALSE;
} }
BOOL BOOL
@ -205,6 +226,7 @@ NtGdiPlayMetaFile(HDC hDC,
HMETAFILE hmf) HMETAFILE hmf)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
return FALSE;
} }
BOOL BOOL
@ -215,6 +237,7 @@ NtGdiPlayMetaFileRecord(HDC hDC,
UINT Handles) UINT Handles)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
return FALSE;
} }
HENHMETAFILE HENHMETAFILE
@ -223,6 +246,7 @@ NtGdiSetEnhMetaFileBits(UINT BufSize,
CONST PBYTE Data) CONST PBYTE Data)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
return 0;
} }
HMETAFILE HMETAFILE
@ -231,6 +255,7 @@ NtGdiSetMetaFileBitsEx(UINT Size,
CONST PBYTE Data) CONST PBYTE Data)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
return 0;
} }
HENHMETAFILE HENHMETAFILE
@ -242,6 +267,7 @@ NtGdiSetWinMetaFileBits(UINT BufSize,
PVOID mfp) PVOID mfp)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
return 0;
} }
/* EOF */ /* EOF */

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
/* $Id: paint.c,v 1.11 2004/05/10 17:07:20 weiden Exp $ */ /* $Id: paint.c,v 1.12 2004/07/14 20:48:58 navaraf Exp $ */
#include <w32k.h> #include <w32k.h>
BOOL BOOL
@ -24,6 +24,7 @@ STDCALL
NtGdiGdiFlush(VOID) NtGdiGdiFlush(VOID)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
return FALSE;
} }
DWORD DWORD
@ -31,6 +32,7 @@ STDCALL
NtGdiGdiGetBatchLimit(VOID) NtGdiGdiGetBatchLimit(VOID)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
return 0;
} }
DWORD DWORD
@ -38,6 +40,7 @@ STDCALL
NtGdiGdiSetBatchLimit(DWORD Limit) NtGdiGdiSetBatchLimit(DWORD Limit)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
return 0;
} }
UINT UINT

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
/* $Id: path.c,v 1.23 2004/07/03 17:40:27 navaraf Exp $ */ /* $Id: path.c,v 1.24 2004/07/14 20:48:58 navaraf Exp $ */
#include <w32k.h> #include <w32k.h>
#include <win32k/float.h> #include <win32k/float.h>
@ -43,6 +43,7 @@ STDCALL
NtGdiAbortPath(HDC hDC) NtGdiAbortPath(HDC hDC)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
return FALSE;
} }
BOOL BOOL
@ -50,6 +51,7 @@ STDCALL
NtGdiBeginPath(HDC hDC) NtGdiBeginPath(HDC hDC)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
return FALSE;
} }
BOOL BOOL
@ -81,6 +83,7 @@ STDCALL
NtGdiEndPath(HDC hDC) NtGdiEndPath(HDC hDC)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
return FALSE;
} }
BOOL BOOL
@ -88,6 +91,7 @@ STDCALL
NtGdiFillPath(HDC hDC) NtGdiFillPath(HDC hDC)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
return FALSE;
} }
BOOL BOOL
@ -95,6 +99,7 @@ STDCALL
NtGdiFlattenPath(HDC hDC) NtGdiFlattenPath(HDC hDC)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
return FALSE;
} }
@ -104,6 +109,7 @@ NtGdiGetMiterLimit(HDC hDC,
PFLOAT Limit) PFLOAT Limit)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
return FALSE;
} }
INT INT
@ -114,6 +120,7 @@ NtGdiGetPath(HDC hDC,
INT nSize) INT nSize)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
return 0;
} }
HRGN HRGN
@ -121,6 +128,7 @@ STDCALL
NtGdiPathToRegion(HDC hDC) NtGdiPathToRegion(HDC hDC)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
return 0;
} }
BOOL BOOL
@ -130,6 +138,7 @@ NtGdiSetMiterLimit(HDC hDC,
PFLOAT OldLimit) PFLOAT OldLimit)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
return FALSE;
} }
BOOL BOOL
@ -137,6 +146,7 @@ STDCALL
NtGdiStrokeAndFillPath(HDC hDC) NtGdiStrokeAndFillPath(HDC hDC)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
return FALSE;
} }
BOOL BOOL
@ -144,6 +154,7 @@ STDCALL
NtGdiStrokePath(HDC hDC) NtGdiStrokePath(HDC hDC)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
return FALSE;
} }
BOOL BOOL
@ -151,6 +162,7 @@ STDCALL
NtGdiWidenPath(HDC hDC) NtGdiWidenPath(HDC hDC)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
return FALSE;
} }
/*********************************************************************** /***********************************************************************

View file

@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
* *
* $Id: pen.c,v 1.15 2004/05/10 17:07:20 weiden Exp $ * $Id: pen.c,v 1.16 2004/07/14 20:48:58 navaraf Exp $
*/ */
#include <w32k.h> #include <w32k.h>
@ -45,7 +45,6 @@ IntGdiCreatePenIndirect(PLOGPEN LogPen)
PenObject->ptPenWidth = LogPen->lopnWidth; PenObject->ptPenWidth = LogPen->lopnWidth;
PenObject->ulPenStyle = LogPen->lopnStyle; PenObject->ulPenStyle = LogPen->lopnStyle;
PenObject->BrushAttr.lbColor = LogPen->lopnColor; PenObject->BrushAttr.lbColor = LogPen->lopnColor;
PenObject->BrushObject.iSolidColor = LogPen->lopnColor;
PenObject->flAttrs = GDIBRUSH_IS_OLDSTYLEPEN; PenObject->flAttrs = GDIBRUSH_IS_OLDSTYLEPEN;
switch (LogPen->lopnStyle) switch (LogPen->lopnStyle)
{ {
@ -114,6 +113,7 @@ NtGdiExtCreatePen(
CONST PDWORD Style) CONST PDWORD Style)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
return 0;
} }
/* EOF */ /* EOF */

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
/* $Id: print.c,v 1.19 2004/07/03 13:55:37 navaraf Exp $ */ /* $Id: print.c,v 1.20 2004/07/14 20:48:58 navaraf Exp $ */
#include <w32k.h> #include <w32k.h>
INT INT
@ -24,6 +24,7 @@ STDCALL
NtGdiAbortDoc(HDC hDC) NtGdiAbortDoc(HDC hDC)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
return 0;
} }
INT INT
@ -31,6 +32,7 @@ STDCALL
NtGdiEndDoc(HDC hDC) NtGdiEndDoc(HDC hDC)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
return 0;
} }
INT INT
@ -38,6 +40,7 @@ STDCALL
NtGdiEndPage(HDC hDC) NtGdiEndPage(HDC hDC)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
return 0;
} }
INT INT
@ -49,6 +52,7 @@ NtGdiEscape(HDC hDC,
LPVOID OutData) LPVOID OutData)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
return 0;
} }
INT INT
@ -184,6 +188,7 @@ NtGdiSetAbortProc(HDC hDC,
ABORTPROC AbortProc) ABORTPROC AbortProc)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
return 0;
} }
INT INT
@ -192,6 +197,7 @@ NtGdiStartDoc(HDC hDC,
CONST LPDOCINFOW di) CONST LPDOCINFOW di)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
return 0;
} }
INT INT
@ -199,5 +205,6 @@ STDCALL
NtGdiStartPage(HDC hDC) NtGdiStartPage(HDC hDC)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
return 0;
} }
/* EOF */ /* EOF */

View file

@ -113,7 +113,7 @@ SOFTWARE.
* the y-x-banding that's so nice to have... * the y-x-banding that's so nice to have...
*/ */
/* $Id: region.c,v 1.61 2004/07/03 17:40:27 navaraf Exp $ */ /* $Id: region.c,v 1.62 2004/07/14 20:48:58 navaraf Exp $ */
#include <w32k.h> #include <w32k.h>
#include <win32k/float.h> #include <win32k/float.h>
@ -2396,6 +2396,7 @@ NtGdiPaintRgn(HDC hDC,
CLIPOBJ* ClipRegion; CLIPOBJ* ClipRegion;
BOOL bRet = FALSE; BOOL bRet = FALSE;
PGDIBRUSHOBJ pBrush; PGDIBRUSHOBJ pBrush;
GDIBRUSHINST BrushInst;
POINTL BrushOrigin; POINTL BrushOrigin;
BITMAPOBJ *BitmapObj; BITMAPOBJ *BitmapObj;
@ -2432,13 +2433,15 @@ NtGdiPaintRgn(HDC hDC,
ASSERT( ClipRegion ); ASSERT( ClipRegion );
pBrush = BRUSHOBJ_LockBrush(dc->w.hBrush); pBrush = BRUSHOBJ_LockBrush(dc->w.hBrush);
ASSERT(pBrush); ASSERT(pBrush);
IntGdiInitBrushInstance(&BrushInst, pBrush, dc->XlateBrush);
BrushOrigin.x = dc->w.brushOrgX; BrushOrigin.x = dc->w.brushOrgX;
BrushOrigin.y = dc->w.brushOrgY; BrushOrigin.y = dc->w.brushOrgY;
BitmapObj = BITMAPOBJ_LockBitmap(dc->w.hBitmap); BitmapObj = BITMAPOBJ_LockBitmap(dc->w.hBitmap);
bRet = IntEngPaint(BitmapObj, bRet = IntEngPaint(BitmapObj,
ClipRegion, ClipRegion,
&pBrush->BrushObject, &BrushInst.BrushObject,
&BrushOrigin, &BrushOrigin,
0xFFFF);//FIXME:don't know what to put here 0xFFFF);//FIXME:don't know what to put here

View file

@ -22,7 +22,7 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
/* $Id: text.c,v 1.104 2004/07/11 02:10:48 navaraf Exp $ */ /* $Id: text.c,v 1.105 2004/07/14 20:48:58 navaraf Exp $ */
#include <w32k.h> #include <w32k.h>
#include <ft2build.h> #include <ft2build.h>
@ -648,6 +648,7 @@ NtGdiCreateScalableFontResource(DWORD Hidden,
LPCWSTR CurrentPath) LPCWSTR CurrentPath)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
return FALSE;
} }
/************************************************************************* /*************************************************************************
@ -1494,6 +1495,7 @@ NtGdiEnumFonts(HDC hDC,
LPARAM lParam) LPARAM lParam)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
return 0;
} }
BOOL STDCALL BOOL STDCALL
@ -1525,8 +1527,10 @@ NtGdiExtTextOut(
POINTL SourcePoint, BrushOrigin; POINTL SourcePoint, BrushOrigin;
HBRUSH hBrushFg = NULL; HBRUSH hBrushFg = NULL;
PGDIBRUSHOBJ BrushFg = NULL; PGDIBRUSHOBJ BrushFg = NULL;
GDIBRUSHINST BrushFgInst;
HBRUSH hBrushBg = NULL; HBRUSH hBrushBg = NULL;
PGDIBRUSHOBJ BrushBg = NULL; PGDIBRUSHOBJ BrushBg = NULL;
GDIBRUSHINST BrushBgInst;
HBITMAP HSourceGlyph; HBITMAP HSourceGlyph;
SURFOBJ *SourceGlyphSurf; SURFOBJ *SourceGlyphSurf;
SIZEL bitSize; SIZEL bitSize;
@ -1587,12 +1591,14 @@ NtGdiExtTextOut(
XlateObj = (XLATEOBJ*)IntEngCreateXlate(Mode, PAL_RGB, dc->w.hPalette, NULL); XlateObj = (XLATEOBJ*)IntEngCreateXlate(Mode, PAL_RGB, dc->w.hPalette, NULL);
hBrushFg = NtGdiCreateSolidBrush(XLATEOBJ_iXlate(XlateObj, dc->w.textColor)); hBrushFg = NtGdiCreateSolidBrush(XLATEOBJ_iXlate(XlateObj, dc->w.textColor));
BrushFg = BRUSHOBJ_LockBrush(hBrushFg); BrushFg = BRUSHOBJ_LockBrush(hBrushFg);
IntGdiInitBrushInstance(&BrushFgInst, BrushFg, NULL);
if ((fuOptions & ETO_OPAQUE) || dc->w.backgroundMode == OPAQUE) if ((fuOptions & ETO_OPAQUE) || dc->w.backgroundMode == OPAQUE)
{ {
hBrushBg = NtGdiCreateSolidBrush(XLATEOBJ_iXlate(XlateObj, dc->w.backgroundColor)); hBrushBg = NtGdiCreateSolidBrush(XLATEOBJ_iXlate(XlateObj, dc->w.backgroundColor));
if (hBrushBg) if (hBrushBg)
{ {
BrushBg = BRUSHOBJ_LockBrush(hBrushBg); BrushBg = BRUSHOBJ_LockBrush(hBrushBg);
IntGdiInitBrushInstance(&BrushBgInst, BrushBg, NULL);
} }
else else
{ {
@ -1625,7 +1631,7 @@ NtGdiExtTextOut(
&DestRect, &DestRect,
&SourcePoint, &SourcePoint,
&SourcePoint, &SourcePoint,
&BrushBg->BrushObject, &BrushBgInst.BrushObject,
&BrushOrigin, &BrushOrigin,
PATCOPY); PATCOPY);
fuOptions &= ~ETO_OPAQUE; fuOptions &= ~ETO_OPAQUE;
@ -1839,7 +1845,7 @@ NtGdiExtTextOut(
&DestRect, &DestRect,
&SourcePoint, &SourcePoint,
&SourcePoint, &SourcePoint,
&BrushBg->BrushObject, &BrushBgInst.BrushObject,
&BrushOrigin, &BrushOrigin,
PATCOPY); PATCOPY);
BackgroundLeft = DestRect.right; BackgroundLeft = DestRect.right;
@ -1878,7 +1884,7 @@ NtGdiExtTextOut(
&DestRect, &DestRect,
&SourcePoint, &SourcePoint,
(PPOINTL)&MaskRect, (PPOINTL)&MaskRect,
&BrushFg->BrushObject, &BrushFgInst.BrushObject,
&BrushOrigin); &BrushOrigin);
EngUnlockSurface(SourceGlyphSurf); EngUnlockSurface(SourceGlyphSurf);
@ -1944,6 +1950,7 @@ NtGdiGetAspectRatioFilterEx(HDC hDC,
LPSIZE AspectRatio) LPSIZE AspectRatio)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
return FALSE;
} }
BOOL BOOL
@ -1965,6 +1972,7 @@ NtGdiGetCharABCWidthsFloat(HDC hDC,
LPABCFLOAT abcF) LPABCFLOAT abcF)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
return FALSE;
} }
DWORD DWORD
@ -1977,6 +1985,7 @@ NtGdiGetCharacterPlacement(HDC hDC,
DWORD Flags) DWORD Flags)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
return 0;
} }
BOOL BOOL
@ -2090,6 +2099,7 @@ NtGdiGetCharWidthFloat(HDC hDC,
PFLOAT Buffer) PFLOAT Buffer)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
return FALSE;
} }
DWORD DWORD
@ -2097,6 +2107,7 @@ STDCALL
NtGdiGetFontLanguageInfo(HDC hDC) NtGdiGetFontLanguageInfo(HDC hDC)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
return 0;
} }
DWORD DWORD
@ -2110,8 +2121,7 @@ NtGdiGetGlyphOutline(HDC hDC,
CONST LPMAT2 mat2) CONST LPMAT2 mat2)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
return 0;
} }
DWORD DWORD
@ -2121,6 +2131,7 @@ NtGdiGetKerningPairs(HDC hDC,
LPKERNINGPAIR krnpair) LPKERNINGPAIR krnpair)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
return 0;
} }
UINT UINT
@ -2130,6 +2141,7 @@ NtGdiGetOutlineTextMetrics(HDC hDC,
LPOUTLINETEXTMETRICW otm) LPOUTLINETEXTMETRICW otm)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
return 0;
} }
BOOL BOOL
@ -2138,6 +2150,7 @@ NtGdiGetRasterizerCaps(LPRASTERIZER_STATUS rs,
UINT Size) UINT Size)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
return FALSE;
} }
UINT UINT
@ -2145,6 +2158,7 @@ STDCALL
NtGdiGetTextCharset(HDC hDC) NtGdiGetTextCharset(HDC hDC)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
return 0;
} }
UINT UINT
@ -2154,6 +2168,7 @@ NtGdiGetTextCharsetInfo(HDC hDC,
DWORD Flags) DWORD Flags)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
return 0;
} }
static BOOL static BOOL
@ -2625,6 +2640,7 @@ NtGdiPolyTextOut(HDC hDC,
int Count) int Count)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
return FALSE;
} }
BOOL BOOL
@ -2632,6 +2648,7 @@ STDCALL
NtGdiRemoveFontResource(LPCWSTR FileName) NtGdiRemoveFontResource(LPCWSTR FileName)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
return FALSE;
} }
DWORD DWORD
@ -2640,6 +2657,7 @@ NtGdiSetMapperFlags(HDC hDC,
DWORD Flag) DWORD Flag)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
return 0;
} }
UINT UINT
@ -2692,6 +2710,7 @@ NtGdiSetTextJustification(HDC hDC,
int BreakCount) int BreakCount)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
return FALSE;
} }
BOOL STDCALL BOOL STDCALL

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
/* $Id: wingl.c,v 1.8 2004/05/10 17:07:20 weiden Exp $ */ /* $Id: wingl.c,v 1.9 2004/07/14 20:48:58 navaraf Exp $ */
#include <w32k.h> #include <w32k.h>
INT INT
@ -25,6 +25,7 @@ NtGdiChoosePixelFormat(HDC hDC,
CONST PPIXELFORMATDESCRIPTOR pfd) CONST PPIXELFORMATDESCRIPTOR pfd)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
return 0;
} }
@ -36,6 +37,7 @@ NtGdiDescribePixelFormat(HDC hDC,
LPPIXELFORMATDESCRIPTOR pfd) LPPIXELFORMATDESCRIPTOR pfd)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
return 0;
} }
UINT UINT
@ -45,6 +47,7 @@ NtGdiGetEnhMetaFilePixelFormat(HENHMETAFILE hEMF,
CONST PPIXELFORMATDESCRIPTOR pfd) CONST PPIXELFORMATDESCRIPTOR pfd)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
return 0;
} }
INT INT
@ -52,6 +55,7 @@ STDCALL
NtGdiGetPixelFormat(HDC hDC) NtGdiGetPixelFormat(HDC hDC)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
return 0;
} }
BOOL BOOL
@ -61,6 +65,7 @@ NtGdiSetPixelFormat(HDC hDC,
CONST PPIXELFORMATDESCRIPTOR pfd) CONST PPIXELFORMATDESCRIPTOR pfd)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
return FALSE;
} }
BOOL BOOL
@ -68,6 +73,7 @@ STDCALL
NtGdiSwapBuffers(HDC hDC) NtGdiSwapBuffers(HDC hDC)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
return FALSE;
} }
/* EOF */ /* EOF */