Cleanup in win32k/dib:

- Replace old headers with new ones, programmers added according to svn blame info
- Apply consistent 2pt indentation because of the many indentation levels in this code; getting rid of a tab and 2/3/4pt mixture 
- Rename universal StretchBlt file to reflect content

svn path=/trunk/; revision=42339
This commit is contained in:
Gregor Schneider 2009-08-02 15:49:17 +00:00
parent 54817d5b14
commit 3283ffdef8
17 changed files with 2137 additions and 2274 deletions

View file

@ -1,22 +1,11 @@
/*
* ReactOS W32 Subsystem
* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 ReactOS Team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
* PROJECT: Win32 subsystem
* LICENSE: See COPYING in the top level directory
* FILE: subsystems/win32/win32k/dib/dib.c
* PURPOSE: ROP handling, function pointer arrays, misc
* PROGRAMMERS: Ge van Geldorp
*/
/* $Id$ */
#include <w32k.h>
@ -104,7 +93,7 @@ DIB_DoRop(ULONG Rop, ULONG Dest, ULONG Source, ULONG Pattern)
ULONG ResultNibble;
ULONG Result;
ULONG i;
static const ULONG ExpandDest[16] =
static const ULONG ExpandDest[16] =
{
0x55555555 /* 0000 */,
0x555555AA /* 0001 */,

View file

@ -1,20 +1,11 @@
/*
* ReactOS W32 Subsystem
* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 ReactOS Team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
* PROJECT: Win32 subsystem
* LICENSE: See COPYING in the top level directory
* FILE: subsystems/win32/win32k/dib/dib16bpp.c
* PURPOSE: Device Independant Bitmap functions, 16bpp
* PROGRAMMERS: Jason Filby
* Thomas Bluemel
* Gregor Anich
*/
#include <w32k.h>

View file

@ -1,22 +1,11 @@
/*
* ReactOS W32 Subsystem
* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 ReactOS Team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
* PROJECT: Win32 subsystem
* LICENSE: See COPYING in the top level directory
* FILE: subsystems/win32/win32k/dib/dib1bpp.c
* PURPOSE: Device Independant Bitmap functions, 1bpp
* PROGRAMMERS: Jason Filby
*/
/* $Id$ */
#include <w32k.h>
#define NDEBUG
@ -44,7 +33,8 @@ DIB_1BPP_GetPixel(SURFOBJ *SurfObj, LONG x, LONG y)
VOID
DIB_1BPP_HLine(SURFOBJ *SurfObj, LONG x1, LONG x2, LONG y, ULONG c)
{
while(x1 < x2) {
while(x1 < x2)
{
DIB_1BPP_PutPixel(SurfObj, x1, y, c);
x1++;
}
@ -53,7 +43,8 @@ DIB_1BPP_HLine(SURFOBJ *SurfObj, LONG x1, LONG x2, LONG y, ULONG c)
VOID
DIB_1BPP_VLine(SURFOBJ *SurfObj, LONG x, LONG y1, LONG y2, ULONG c)
{
while(y1 < y2) {
while(y1 < y2)
{
DIB_1BPP_PutPixel(SurfObj, x, y1, c);
y1++;
}
@ -475,8 +466,7 @@ DIB_1BPP_ColorFill(SURFOBJ* DestSurface, RECTL* DestRect, ULONG color)
{
DIB_1BPP_HLine(DestSurface, DestRect->left, DestRect->right, DestY, color);
}
return TRUE;
return TRUE;
}
BOOLEAN

View file

@ -1,22 +1,12 @@
/*
* ReactOS W32 Subsystem
* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 ReactOS Team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
* PROJECT: Win32 subsystem
* LICENSE: See COPYING in the top level directory
* FILE: subsystems/win32/win32k/dib/dib24bpp.c
* PURPOSE: Device Independant Bitmap functions, 24bpp
* PROGRAMMERS: Jason Filby
* Thomas Bluemel
* Gregor Anich
*/
/* $Id$ */
#include <w32k.h>
@ -47,7 +37,8 @@ DIB_24BPP_VLine(SURFOBJ *SurfObj, LONG x, LONG y1, LONG y2, ULONG c)
LONG lDelta = SurfObj->lDelta;
c &= 0xFFFFFF;
while(y1++ < y2) {
while(y1++ < y2)
{
*(PUSHORT)(addr) = c & 0xFFFF;
*(addr + 2) = c >> 16;

View file

@ -1,22 +1,11 @@
/*
* ReactOS W32 Subsystem
* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 ReactOS Team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
* PROJECT: Win32 subsystem
* LICENSE: See COPYING in the top level directory
* FILE: subsystems/win32/win32k/dib/dib24bppc.c
* PURPOSE: C language equivalents of asm optimised 24bpp functions
* PROGRAMMERS: Jason Filby
* Magnus Olsen
*/
/* $Id$ */
#include <w32k.h>
@ -29,7 +18,6 @@ DIB_24BPP_HLine(SURFOBJ *SurfObj, LONG x1, LONG x2, LONG y, ULONG c)
PBYTE addr = (PBYTE)SurfObj->pvScan0 + y * SurfObj->lDelta + (x1 << 1) + x1;
ULONG Count = x2 - x1;
if (Count < 8)
{
/* For small fills, don't bother doing anything fancy */

View file

@ -1,22 +1,12 @@
/*
* ReactOS W32 Subsystem
* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 ReactOS Team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
* PROJECT: Win32 subsystem
* LICENSE: See COPYING in the top level directory
* FILE: subsystems/win32/win32k/dib/dib32bpp.c
* PURPOSE: Device Independant Bitmap functions, 32bpp
* PROGRAMMERS: Jason Filby
* Thomas Bluemel
* Gregor Anich
*/
/* $Id$ */
#include <w32k.h>
@ -41,12 +31,9 @@ DIB_32BPP_GetPixel(SURFOBJ *SurfObj, LONG x, LONG y)
return (ULONG)(*addr);
}
VOID
DIB_32BPP_VLine(SURFOBJ *SurfObj, LONG x, LONG y1, LONG y2, ULONG c)
{
PBYTE byteaddr = (PBYTE)SurfObj->pvScan0 + y1 * SurfObj->lDelta;
PDWORD addr = (PDWORD)byteaddr + x;
LONG lDelta = SurfObj->lDelta >> 2; // >> 2 == / sizeof(DWORD)
@ -57,7 +44,6 @@ DIB_32BPP_VLine(SURFOBJ *SurfObj, LONG x, LONG y1, LONG y2, ULONG c)
*addr = (DWORD)c;
addr += lDelta;
}
}
BOOLEAN

View file

@ -1,22 +1,11 @@
/*
* ReactOS W32 Subsystem
* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 2004, 2005, 2006 ReactOS Team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
* PROJECT: Win32 subsystem
* LICENSE: See COPYING in the top level directory
* FILE: subsystems/win32/win32k/dib/dib32bppc.c
* PURPOSE: C language equivalents of asm optimised 32bpp functions
* PROGRAMMERS: Jason Filby
* Magnus Olsen
*/
/* $Id: */
#include <w32k.h>

View file

@ -1,22 +1,11 @@
/*
* ReactOS W32 Subsystem
* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 ReactOS Team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
* PROJECT: Win32 subsystem
* LICENSE: See COPYING in the top level directory
* FILE: subsystems/win32/win32k/dib/dib4bpp.c
* PURPOSE: Device Independant Bitmap functions, 4bpp
* PROGRAMMERS: Jason Filby
*/
/* $Id$ */
#include <w32k.h>
@ -43,7 +32,8 @@ DIB_4BPP_HLine(SURFOBJ *SurfObj, LONG x1, LONG x2, LONG y, ULONG c)
PBYTE addr = (PBYTE)SurfObj->pvScan0 + (x1>>1) + y * SurfObj->lDelta;
LONG cx = x1;
while(cx < x2) {
while(cx < x2)
{
*addr = (*addr & notmask[x1&1]) | (c << ((1-(x1&1))<<2));
if((++x1 & 1) == 0)
++addr;
@ -58,7 +48,8 @@ DIB_4BPP_VLine(SURFOBJ *SurfObj, LONG x, LONG y1, LONG y2, ULONG c)
int lDelta = SurfObj->lDelta;
addr += (x>>1) + y1 * lDelta;
while(y1++ < y2) {
while(y1++ < y2)
{
*addr = (*addr & notmask[x&1]) | (c << ((1-(x&1))<<2));
addr += lDelta;
}
@ -90,7 +81,9 @@ DIB_4BPP_BitBltSrcCopy(PBLTINFO BltInfo)
if(DIB_1BPP_GetPixel(BltInfo->SourceSurface, sx, sy) == 0)
{
DIB_4BPP_PutPixel(BltInfo->DestSurface, i, j, XLATEOBJ_iXlate(BltInfo->XlateSourceToDest, 0));
} else {
}
else
{
DIB_4BPP_PutPixel(BltInfo->DestSurface, i, j, XLATEOBJ_iXlate(BltInfo->XlateSourceToDest, 1));
}
sx++;
@ -367,12 +360,11 @@ DIB_4BPP_ColorFill(SURFOBJ* DestSurface, RECTL* DestRect, ULONG color)
{
ULONG DestY;
for (DestY = DestRect->top; DestY< DestRect->bottom; DestY++)
for (DestY = DestRect->top; DestY < DestRect->bottom; DestY++)
{
DIB_4BPP_HLine(DestSurface, DestRect->left, DestRect->right, DestY, color);
}
return TRUE;
return TRUE;
}
BOOLEAN

View file

@ -1,22 +1,12 @@
/*
* ReactOS W32 Subsystem
* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 ReactOS Team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
* PROJECT: Win32 subsystem
* LICENSE: See COPYING in the top level directory
* FILE: subsystems/win32/win32k/dib/dib8bpp.c
* PURPOSE: Device Independant Bitmap functions, 8bpp
* PROGRAMMERS: Jason Filby
* Thomas Bluemel
* Gregor Anich
*/
/* $Id$ */
#include <w32k.h>
@ -53,7 +43,8 @@ DIB_8BPP_VLine(SURFOBJ *SurfObj, LONG x, LONG y1, LONG y2, ULONG c)
LONG lDelta = SurfObj->lDelta;
byteaddr = addr;
while(y1++ < y2) {
while(y1++ < y2)
{
*addr = c;
addr += lDelta;
@ -83,7 +74,9 @@ DIB_8BPP_BitBltSrcCopy(PBLTINFO BltInfo)
if(DIB_1BPP_GetPixel(BltInfo->SourceSurface, sx, sy) == 0)
{
DIB_8BPP_PutPixel(BltInfo->DestSurface, i, j, XLATEOBJ_iXlate(BltInfo->XlateSourceToDest, 0));
} else {
}
else
{
DIB_8BPP_PutPixel(BltInfo->DestSurface, i, j, XLATEOBJ_iXlate(BltInfo->XlateSourceToDest, 1));
}
sx++;
@ -261,7 +254,6 @@ DIB_8BPP_ColorFill(SURFOBJ* DestSurface, RECTL* DestRect, ULONG color)
{
DIB_8BPP_HLine(DestSurface, DestRect->left, DestRect->right, DestY, color);
}
return TRUE;
}

View file

@ -1,182 +0,0 @@
/*
* ReactOS W32 Subsystem
* Copyright (C) 2009 ReactOS Team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <w32k.h>
#define NDEBUG
#include <debug.h>
BOOLEAN DIB_XXBPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf, SURFOBJ *MaskSurf,
SURFOBJ *PatternSurface,
RECTL *DestRect, RECTL *SourceRect,
POINTL *MaskOrigin, BRUSHOBJ *Brush,
POINTL *BrushOrigin, XLATEOBJ *ColorTranslation,
XLATEOBJ *XlatePatternToDest, ROP4 ROP)
{
LONG sx = 0;
LONG sy = 0;
LONG DesX;
LONG DesY;
LONG DstHeight;
LONG DstWidth;
LONG SrcHeight;
LONG SrcWidth;
ULONG Color;
ULONG Dest, Source = 0, Pattern = 0;
ULONG xxBPPMask;
BOOLEAN CanDraw;
PFN_DIB_GetPixel fnSource_GetPixel = NULL;
PFN_DIB_GetPixel fnDest_GetPixel = NULL;
PFN_DIB_PutPixel fnDest_PutPixel = NULL;
PFN_DIB_GetPixel fnPattern_GetPixel = NULL;
PFN_DIB_GetPixel fnMask_GetPixel = NULL;
LONG PatternX = 0, PatternY = 0;
BOOL UsesSource = ROP4_USES_SOURCE(ROP);
BOOL UsesPattern = ROP4_USES_PATTERN(ROP);
fnDest_GetPixel = DibFunctionsForBitmapFormat[DestSurf->iBitmapFormat].DIB_GetPixel;
fnDest_PutPixel = DibFunctionsForBitmapFormat[DestSurf->iBitmapFormat].DIB_PutPixel;
DPRINT("Dest BPP: %u, dstRect: (%d,%d)-(%d,%d)\n",
BitsPerFormat(DestSurf->iBitmapFormat), DestRect->left, DestRect->top, DestRect->right, DestRect->bottom);
if (UsesSource)
{
fnSource_GetPixel = DibFunctionsForBitmapFormat[SourceSurf->iBitmapFormat].DIB_GetPixel;
DPRINT("Source BPP: %u, srcRect: (%d,%d)-(%d,%d)\n",
BitsPerFormat(SourceSurf->iBitmapFormat), SourceRect->left, SourceRect->top, SourceRect->right, SourceRect->bottom);
}
if (MaskSurf)
{
fnMask_GetPixel = DibFunctionsForBitmapFormat[MaskSurf->iBitmapFormat].DIB_GetPixel;
}
DstHeight = DestRect->bottom - DestRect->top;
DstWidth = DestRect->right - DestRect->left;
SrcHeight = SourceRect->bottom - SourceRect->top;
SrcWidth = SourceRect->right - SourceRect->left;
/* FIXME : MaskOrigin? */
switch(DestSurf->iBitmapFormat)
{
case BMF_1BPP: xxBPPMask = 0x1; break;
case BMF_4BPP: xxBPPMask = 0xF; break;
case BMF_8BPP: xxBPPMask = 0xFF; break;
case BMF_16BPP: xxBPPMask = 0xFFFF; break;
case BMF_24BPP: xxBPPMask = 0xFFFFFF; break;
default:
xxBPPMask = 0xFFFFFFFF;
}
if (UsesPattern)
{
if (PatternSurface)
{
PatternY = (DestRect->top - BrushOrigin->y) % PatternSurface->sizlBitmap.cy;
if (PatternY < 0)
{
PatternY += PatternSurface->sizlBitmap.cy;
}
fnPattern_GetPixel = DibFunctionsForBitmapFormat[PatternSurface->iBitmapFormat].DIB_GetPixel;
}
else
{
if (Brush)
Pattern = Brush->iSolidColor;
}
}
for (DesY = DestRect->top; DesY < DestRect->bottom; DesY++)
{
if (PatternSurface)
{
PatternX = (DestRect->left - BrushOrigin->x) % PatternSurface->sizlBitmap.cx;
if (PatternX < 0)
{
PatternX += PatternSurface->sizlBitmap.cx;
}
}
if (UsesSource)
sy = SourceRect->top+(DesY - DestRect->top) * SrcHeight / DstHeight;
for (DesX = DestRect->left; DesX < DestRect->right; DesX++)
{
CanDraw = TRUE;
if (fnMask_GetPixel)
{
sx = SourceRect->left+(DesX - DestRect->left) * SrcWidth / DstWidth;
if (sx < 0 || sy < 0 ||
MaskSurf->sizlBitmap.cx < sx || MaskSurf->sizlBitmap.cy < sy ||
fnMask_GetPixel(MaskSurf, sx, sy) != 0)
{
CanDraw = FALSE;
}
}
if (UsesSource && CanDraw)
{
sx = SourceRect->left+(DesX - DestRect->left) * SrcWidth / DstWidth;
if (sx >= 0 && sy >= 0 &&
SourceSurf->sizlBitmap.cx > sx && SourceSurf->sizlBitmap.cy > sy)
{
Source = XLATEOBJ_iXlate(ColorTranslation, fnSource_GetPixel(SourceSurf, sx, sy));
}
else
{
Source = 0;
CanDraw = (ROP3_TO_ROP4(SRCCOPY) != ROP);
}
}
if (CanDraw)
{
if (PatternSurface)
{
Pattern = XLATEOBJ_iXlate(XlatePatternToDest, fnPattern_GetPixel(PatternSurface, PatternX, PatternY));
PatternX++;
PatternX %= PatternSurface->sizlBitmap.cx;
}
Dest = fnDest_GetPixel(DestSurf, DesX, DesY);
Color = DIB_DoRop(ROP, Dest, Source, Pattern) & xxBPPMask;
fnDest_PutPixel(DestSurf, DesX, DesY, Color);
}
}
if (PatternSurface)
{
PatternY++;
PatternY %= PatternSurface->sizlBitmap.cy;
}
}
return TRUE;
}
/* EOF */

View file

@ -1,10 +1,10 @@
/*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS win32 subsystem
* PURPOSE: Flood filling support
* FILE: subsystems/win32/win32k/dib/floodfill.c
* PROGRAMMER: Gregor Schneider, <grschneider AT gmail DOT com>
*/
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS win32 subsystem
* PURPOSE: Flood filling support
* FILE: subsystems/win32/win32k/dib/floodfill.c
* PROGRAMMER: Gregor Schneider, <grschneider AT gmail DOT com>
*/
#include <w32k.h>

View file

@ -1,22 +1,10 @@
/*
* ReactOS W32 Subsystem
* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 2004, 2005, 2006 ReactOS Team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
* PROJECT: Win32 subsystem
* LICENSE: See COPYING in the top level directory
* FILE: subsystems/win32/win32k/dib/i386/dib24bpp_hline.c
* PURPOSE: ASM optimised 24bpp HLine
* PROGRAMMERS: Magnus Olsen
*/
/* $Id: */
.globl _DIB_24BPP_HLine
.intel_syntax noprefix

View file

@ -1,23 +1,11 @@
/*
* ReactOS W32 Subsystem
* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 2004, 2005, 2006 ReactOS Team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
* PROJECT: Win32 subsystem
* LICENSE: See COPYING in the top level directory
* FILE: subsystems/win32/win32k/dib/i386/dib32bpp_colorfill.c
* PURPOSE: ASM optimised 32bpp ColorFill
* PROGRAMMERS: Magnus Olsen
*/
/* $Id: */
.globl _DIB_32BPP_ColorFill
.intel_syntax noprefix

View file

@ -1,22 +1,10 @@
/*
* ReactOS W32 Subsystem
* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 2004, 2005, 2006 ReactOS Team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
* PROJECT: Win32 subsystem
* LICENSE: See COPYING in the top level directory
* FILE: subsystems/win32/win32k/dib/i386/dib32bpp_hline.c
* PURPOSE: ASM optimised 32bpp HLine
* PROGRAMMERS: Magnus Olsen
*/
/* $Id: */
.globl _DIB_32BPP_HLine
.intel_syntax noprefix

View file

@ -0,0 +1,173 @@
/*
* PROJECT: Win32 subsystem
* LICENSE: See COPYING in the top level directory
* FILE: subsystems/win32/win32k/dib/stretchblt.c
* PURPOSE: StretchBlt implementation suitable for all bit depths
* PROGRAMMERS: Magnus Olsen
* Evgeniy Boltik
* Gregor Schneider
*/
#include <w32k.h>
#define NDEBUG
#include <debug.h>
BOOLEAN DIB_XXBPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf, SURFOBJ *MaskSurf,
SURFOBJ *PatternSurface,
RECTL *DestRect, RECTL *SourceRect,
POINTL *MaskOrigin, BRUSHOBJ *Brush,
POINTL *BrushOrigin, XLATEOBJ *ColorTranslation,
XLATEOBJ *XlatePatternToDest, ROP4 ROP)
{
LONG sx = 0;
LONG sy = 0;
LONG DesX;
LONG DesY;
LONG DstHeight;
LONG DstWidth;
LONG SrcHeight;
LONG SrcWidth;
ULONG Color;
ULONG Dest, Source = 0, Pattern = 0;
ULONG xxBPPMask;
BOOLEAN CanDraw;
PFN_DIB_GetPixel fnSource_GetPixel = NULL;
PFN_DIB_GetPixel fnDest_GetPixel = NULL;
PFN_DIB_PutPixel fnDest_PutPixel = NULL;
PFN_DIB_GetPixel fnPattern_GetPixel = NULL;
PFN_DIB_GetPixel fnMask_GetPixel = NULL;
LONG PatternX = 0, PatternY = 0;
BOOL UsesSource = ROP4_USES_SOURCE(ROP);
BOOL UsesPattern = ROP4_USES_PATTERN(ROP);
fnDest_GetPixel = DibFunctionsForBitmapFormat[DestSurf->iBitmapFormat].DIB_GetPixel;
fnDest_PutPixel = DibFunctionsForBitmapFormat[DestSurf->iBitmapFormat].DIB_PutPixel;
DPRINT("Dest BPP: %u, dstRect: (%d,%d)-(%d,%d)\n",
BitsPerFormat(DestSurf->iBitmapFormat), DestRect->left, DestRect->top, DestRect->right, DestRect->bottom);
if (UsesSource)
{
fnSource_GetPixel = DibFunctionsForBitmapFormat[SourceSurf->iBitmapFormat].DIB_GetPixel;
DPRINT("Source BPP: %u, srcRect: (%d,%d)-(%d,%d)\n",
BitsPerFormat(SourceSurf->iBitmapFormat), SourceRect->left, SourceRect->top, SourceRect->right, SourceRect->bottom);
}
if (MaskSurf)
{
fnMask_GetPixel = DibFunctionsForBitmapFormat[MaskSurf->iBitmapFormat].DIB_GetPixel;
}
DstHeight = DestRect->bottom - DestRect->top;
DstWidth = DestRect->right - DestRect->left;
SrcHeight = SourceRect->bottom - SourceRect->top;
SrcWidth = SourceRect->right - SourceRect->left;
/* FIXME : MaskOrigin? */
switch(DestSurf->iBitmapFormat)
{
case BMF_1BPP: xxBPPMask = 0x1; break;
case BMF_4BPP: xxBPPMask = 0xF; break;
case BMF_8BPP: xxBPPMask = 0xFF; break;
case BMF_16BPP: xxBPPMask = 0xFFFF; break;
case BMF_24BPP: xxBPPMask = 0xFFFFFF; break;
default:
xxBPPMask = 0xFFFFFFFF;
}
if (UsesPattern)
{
if (PatternSurface)
{
PatternY = (DestRect->top - BrushOrigin->y) % PatternSurface->sizlBitmap.cy;
if (PatternY < 0)
{
PatternY += PatternSurface->sizlBitmap.cy;
}
fnPattern_GetPixel = DibFunctionsForBitmapFormat[PatternSurface->iBitmapFormat].DIB_GetPixel;
}
else
{
if (Brush)
Pattern = Brush->iSolidColor;
}
}
for (DesY = DestRect->top; DesY < DestRect->bottom; DesY++)
{
if (PatternSurface)
{
PatternX = (DestRect->left - BrushOrigin->x) % PatternSurface->sizlBitmap.cx;
if (PatternX < 0)
{
PatternX += PatternSurface->sizlBitmap.cx;
}
}
if (UsesSource)
sy = SourceRect->top+(DesY - DestRect->top) * SrcHeight / DstHeight;
for (DesX = DestRect->left; DesX < DestRect->right; DesX++)
{
CanDraw = TRUE;
if (fnMask_GetPixel)
{
sx = SourceRect->left+(DesX - DestRect->left) * SrcWidth / DstWidth;
if (sx < 0 || sy < 0 ||
MaskSurf->sizlBitmap.cx < sx || MaskSurf->sizlBitmap.cy < sy ||
fnMask_GetPixel(MaskSurf, sx, sy) != 0)
{
CanDraw = FALSE;
}
}
if (UsesSource && CanDraw)
{
sx = SourceRect->left+(DesX - DestRect->left) * SrcWidth / DstWidth;
if (sx >= 0 && sy >= 0 &&
SourceSurf->sizlBitmap.cx > sx && SourceSurf->sizlBitmap.cy > sy)
{
Source = XLATEOBJ_iXlate(ColorTranslation, fnSource_GetPixel(SourceSurf, sx, sy));
}
else
{
Source = 0;
CanDraw = (ROP3_TO_ROP4(SRCCOPY) != ROP);
}
}
if (CanDraw)
{
if (PatternSurface)
{
Pattern = XLATEOBJ_iXlate(XlatePatternToDest, fnPattern_GetPixel(PatternSurface, PatternX, PatternY));
PatternX++;
PatternX %= PatternSurface->sizlBitmap.cx;
}
Dest = fnDest_GetPixel(DestSurf, DesX, DesY);
Color = DIB_DoRop(ROP, Dest, Source, Pattern) & xxBPPMask;
fnDest_PutPixel(DestSurf, DesX, DesY, Color);
}
}
if (PatternSurface)
{
PatternY++;
PatternY %= PatternSurface->sizlBitmap.cy;
}
}
return TRUE;
}
/* EOF */

View file

@ -29,9 +29,9 @@
<file>dib16bpp.c</file>
<file>dib24bpp.c</file>
<file>dib32bpp.c</file>
<file>dibXXbpp.c</file>
<file>dib.c</file>
<file>floodfill.c</file>
<file>stretchblt.c</file>
<if property="ARCH" value="i386">
<directory name="i386">