1996-11-17 19:59:11 +01:00
|
|
|
/*
|
|
|
|
* GDI bit-blit operations
|
|
|
|
*
|
|
|
|
* Copyright 1993, 1994 Alexandre Julliard
|
2002-03-10 00:29:33 +01:00
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library 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
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
1996-11-17 19:59:11 +01:00
|
|
|
*/
|
|
|
|
|
2000-11-05 03:05:07 +01:00
|
|
|
#include "gdi.h"
|
2002-03-10 00:29:33 +01:00
|
|
|
#include "wine/debug.h"
|
1996-11-17 19:59:11 +01:00
|
|
|
|
2002-03-10 00:29:33 +01:00
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(bitblt);
|
1999-04-19 16:56:29 +02:00
|
|
|
|
1996-11-17 19:59:11 +01:00
|
|
|
|
|
|
|
/***********************************************************************
|
2001-07-02 21:59:40 +02:00
|
|
|
* PatBlt (GDI.29)
|
1996-11-17 19:59:11 +01:00
|
|
|
*/
|
1997-08-24 18:00:30 +02:00
|
|
|
BOOL16 WINAPI PatBlt16( HDC16 hdc, INT16 left, INT16 top,
|
|
|
|
INT16 width, INT16 height, DWORD rop)
|
1996-11-17 19:59:11 +01:00
|
|
|
{
|
2000-08-19 23:38:55 +02:00
|
|
|
return PatBlt( hdc, left, top, width, height, rop );
|
1996-11-17 19:59:11 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
2001-02-15 00:11:17 +01:00
|
|
|
* PatBlt (GDI32.@)
|
1996-11-17 19:59:11 +01:00
|
|
|
*/
|
1999-02-26 12:11:13 +01:00
|
|
|
BOOL WINAPI PatBlt( HDC hdc, INT left, INT top,
|
|
|
|
INT width, INT height, DWORD rop)
|
1996-11-17 19:59:11 +01:00
|
|
|
{
|
2000-08-22 22:01:47 +02:00
|
|
|
DC * dc = DC_GetDCUpdate( hdc );
|
2000-08-19 23:38:55 +02:00
|
|
|
BOOL bRet = FALSE;
|
1996-11-17 19:59:11 +01:00
|
|
|
|
2000-08-19 23:38:55 +02:00
|
|
|
if (!dc) return FALSE;
|
|
|
|
|
|
|
|
if (dc->funcs->pPatBlt)
|
|
|
|
{
|
|
|
|
TRACE("%04x %d,%d %dx%d %06lx\n", hdc, left, top, width, height, rop );
|
2002-03-28 23:22:05 +01:00
|
|
|
bRet = dc->funcs->pPatBlt( dc->physDev, left, top, width, height, rop );
|
2000-08-19 23:38:55 +02:00
|
|
|
}
|
|
|
|
GDI_ReleaseObj( hdc );
|
|
|
|
return bRet;
|
1996-11-17 19:59:11 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
2001-07-02 21:59:40 +02:00
|
|
|
* BitBlt (GDI.34)
|
1996-11-17 19:59:11 +01:00
|
|
|
*/
|
1997-08-24 18:00:30 +02:00
|
|
|
BOOL16 WINAPI BitBlt16( HDC16 hdcDst, INT16 xDst, INT16 yDst, INT16 width,
|
|
|
|
INT16 height, HDC16 hdcSrc, INT16 xSrc, INT16 ySrc,
|
|
|
|
DWORD rop )
|
1996-11-17 19:59:11 +01:00
|
|
|
{
|
2000-08-19 23:38:55 +02:00
|
|
|
return BitBlt( hdcDst, xDst, yDst, width, height, hdcSrc, xSrc, ySrc, rop );
|
1996-11-17 19:59:11 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
2001-02-15 00:11:17 +01:00
|
|
|
* BitBlt (GDI32.@)
|
1996-11-17 19:59:11 +01:00
|
|
|
*/
|
1999-02-26 12:11:13 +01:00
|
|
|
BOOL WINAPI BitBlt( HDC hdcDst, INT xDst, INT yDst, INT width,
|
2000-08-19 23:38:55 +02:00
|
|
|
INT height, HDC hdcSrc, INT xSrc, INT ySrc, DWORD rop )
|
1996-11-17 19:59:11 +01:00
|
|
|
{
|
2000-08-19 23:38:55 +02:00
|
|
|
BOOL ret = FALSE;
|
1996-11-17 19:59:11 +01:00
|
|
|
DC *dcDst, *dcSrc;
|
|
|
|
|
2000-08-19 23:38:55 +02:00
|
|
|
if ((dcSrc = DC_GetDCUpdate( hdcSrc ))) GDI_ReleaseObj( hdcSrc );
|
|
|
|
/* FIXME: there is a race condition here */
|
|
|
|
if ((dcDst = DC_GetDCUpdate( hdcDst )))
|
|
|
|
{
|
|
|
|
dcSrc = DC_GetDCPtr( hdcSrc );
|
|
|
|
TRACE("hdcSrc=%04x %d,%d %d bpp->hdcDest=%04x %d,%d %dx%dx%d rop=%06lx\n",
|
2000-11-05 03:05:07 +01:00
|
|
|
hdcSrc, xSrc, ySrc, dcSrc ? dcSrc->bitsPerPixel : 0,
|
|
|
|
hdcDst, xDst, yDst, width, height, dcDst->bitsPerPixel, rop);
|
2000-08-19 23:38:55 +02:00
|
|
|
if (dcDst->funcs->pBitBlt)
|
2002-03-28 23:22:05 +01:00
|
|
|
ret = dcDst->funcs->pBitBlt( dcDst->physDev, xDst, yDst, width, height,
|
2002-04-02 05:00:00 +02:00
|
|
|
dcSrc ? dcSrc->physDev : NULL, xSrc, ySrc, rop );
|
2000-08-19 23:38:55 +02:00
|
|
|
if (dcSrc) GDI_ReleaseObj( hdcSrc );
|
|
|
|
GDI_ReleaseObj( hdcDst );
|
|
|
|
}
|
|
|
|
return ret;
|
1996-11-17 19:59:11 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
2001-07-02 21:59:40 +02:00
|
|
|
* StretchBlt (GDI.35)
|
1996-11-17 19:59:11 +01:00
|
|
|
*/
|
1997-08-24 18:00:30 +02:00
|
|
|
BOOL16 WINAPI StretchBlt16( HDC16 hdcDst, INT16 xDst, INT16 yDst,
|
|
|
|
INT16 widthDst, INT16 heightDst,
|
|
|
|
HDC16 hdcSrc, INT16 xSrc, INT16 ySrc,
|
|
|
|
INT16 widthSrc, INT16 heightSrc, DWORD rop )
|
1996-11-17 19:59:11 +01:00
|
|
|
{
|
2000-08-19 23:38:55 +02:00
|
|
|
return StretchBlt( hdcDst, xDst, yDst, widthDst, heightDst,
|
|
|
|
hdcSrc, xSrc, ySrc, widthSrc, heightSrc, rop );
|
1996-11-17 19:59:11 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
2001-02-15 00:11:17 +01:00
|
|
|
* StretchBlt (GDI32.@)
|
1996-11-17 19:59:11 +01:00
|
|
|
*/
|
1999-02-26 12:11:13 +01:00
|
|
|
BOOL WINAPI StretchBlt( HDC hdcDst, INT xDst, INT yDst,
|
|
|
|
INT widthDst, INT heightDst,
|
|
|
|
HDC hdcSrc, INT xSrc, INT ySrc,
|
2002-06-01 01:06:46 +02:00
|
|
|
INT widthSrc, INT heightSrc,
|
2000-08-19 23:38:55 +02:00
|
|
|
DWORD rop )
|
1996-11-17 19:59:11 +01:00
|
|
|
{
|
2000-08-19 23:38:55 +02:00
|
|
|
BOOL ret = FALSE;
|
1996-11-17 19:59:11 +01:00
|
|
|
DC *dcDst, *dcSrc;
|
|
|
|
|
2000-08-19 23:38:55 +02:00
|
|
|
if ((dcSrc = DC_GetDCUpdate( hdcSrc ))) GDI_ReleaseObj( hdcSrc );
|
|
|
|
/* FIXME: there is a race condition here */
|
|
|
|
if ((dcDst = DC_GetDCUpdate( hdcDst )))
|
|
|
|
{
|
|
|
|
dcSrc = DC_GetDCPtr( hdcSrc );
|
|
|
|
|
|
|
|
TRACE("%04x %d,%d %dx%dx%d -> %04x %d,%d %dx%dx%d rop=%06lx\n",
|
|
|
|
hdcSrc, xSrc, ySrc, widthSrc, heightSrc,
|
2000-11-05 03:05:07 +01:00
|
|
|
dcSrc ? dcSrc->bitsPerPixel : 0, hdcDst, xDst, yDst,
|
|
|
|
widthDst, heightDst, dcDst->bitsPerPixel, rop );
|
2000-08-19 23:38:55 +02:00
|
|
|
|
|
|
|
if (dcSrc) {
|
|
|
|
if (dcDst->funcs->pStretchBlt)
|
2002-03-28 23:22:05 +01:00
|
|
|
ret = dcDst->funcs->pStretchBlt( dcDst->physDev, xDst, yDst, widthDst, heightDst,
|
|
|
|
dcSrc->physDev, xSrc, ySrc, widthSrc, heightSrc,
|
|
|
|
rop );
|
2000-08-19 23:38:55 +02:00
|
|
|
GDI_ReleaseObj( hdcSrc );
|
|
|
|
}
|
|
|
|
GDI_ReleaseObj( hdcDst );
|
|
|
|
}
|
|
|
|
return ret;
|
1996-11-17 19:59:11 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* FastWindowFrame (GDI.400)
|
|
|
|
*/
|
1999-02-26 12:11:13 +01:00
|
|
|
BOOL16 WINAPI FastWindowFrame16( HDC16 hdc, const RECT16 *rect,
|
1997-08-24 18:00:30 +02:00
|
|
|
INT16 width, INT16 height, DWORD rop )
|
1996-11-17 19:59:11 +01:00
|
|
|
{
|
1999-02-26 12:11:13 +01:00
|
|
|
HBRUSH hbrush = SelectObject( hdc, GetStockObject( GRAY_BRUSH ) );
|
|
|
|
PatBlt( hdc, rect->left, rect->top,
|
1996-11-17 19:59:11 +01:00
|
|
|
rect->right - rect->left - width, height, rop );
|
1999-02-26 12:11:13 +01:00
|
|
|
PatBlt( hdc, rect->left, rect->top + height, width,
|
1996-11-17 19:59:11 +01:00
|
|
|
rect->bottom - rect->top - height, rop );
|
1999-09-04 16:25:55 +02:00
|
|
|
PatBlt( hdc, rect->left + width, rect->bottom - 1,
|
1996-11-17 19:59:11 +01:00
|
|
|
rect->right - rect->left - width, -height, rop );
|
1999-09-04 16:25:55 +02:00
|
|
|
PatBlt( hdc, rect->right - 1, rect->top, -width,
|
1996-11-17 19:59:11 +01:00
|
|
|
rect->bottom - rect->top - height, rop );
|
1999-02-26 12:11:13 +01:00
|
|
|
SelectObject( hdc, hbrush );
|
1996-11-17 19:59:11 +01:00
|
|
|
return TRUE;
|
2000-08-19 23:38:55 +02:00
|
|
|
|
1996-11-17 19:59:11 +01:00
|
|
|
}
|
2000-08-19 23:38:55 +02:00
|
|
|
|
|
|
|
|
1998-12-15 16:38:36 +01:00
|
|
|
/***********************************************************************
|
2001-02-15 00:11:17 +01:00
|
|
|
* MaskBlt [GDI32.@]
|
1998-12-15 16:38:36 +01:00
|
|
|
*/
|
1999-02-26 12:11:13 +01:00
|
|
|
BOOL WINAPI MaskBlt(HDC hdcDest, INT nXDest, INT nYDest,
|
|
|
|
INT nWidth, INT nHeight, HDC hdcSource,
|
|
|
|
INT nXSrc, INT nYSrc, HBITMAP hbmMask,
|
|
|
|
INT xMask, INT yMask, DWORD dwRop)
|
1998-12-15 16:38:36 +01:00
|
|
|
{
|
2000-08-19 23:38:55 +02:00
|
|
|
FIXME("(%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%ld): stub\n",
|
1998-12-15 16:38:36 +01:00
|
|
|
hdcDest,nXDest,nYDest,nWidth,nHeight,hdcSource,nXSrc,nYSrc,
|
|
|
|
hbmMask,xMask,yMask,dwRop);
|
|
|
|
return 1;
|
|
|
|
}
|
2002-06-01 01:06:46 +02:00
|
|
|
|
1998-12-15 16:38:36 +01:00
|
|
|
/*********************************************************************
|
2001-02-15 00:11:17 +01:00
|
|
|
* PlgBlt [GDI32.@]
|
1998-12-15 16:38:36 +01:00
|
|
|
*
|
|
|
|
*/
|
1999-02-26 12:11:13 +01:00
|
|
|
BOOL WINAPI PlgBlt( HDC hdcDest, const POINT *lpPoint,
|
|
|
|
HDC hdcSrc, INT nXDest, INT nYDest, INT nWidth,
|
|
|
|
INT nHeight, HBITMAP hbmMask, INT xMask, INT yMask)
|
1998-12-15 16:38:36 +01:00
|
|
|
{
|
2000-08-19 23:38:55 +02:00
|
|
|
FIXME("PlgBlt, stub\n");
|
1998-12-15 16:38:36 +01:00
|
|
|
return 1;
|
|
|
|
}
|
2002-06-01 01:06:46 +02:00
|
|
|
|