1996-11-17 18:59:11 +00:00
|
|
|
/*
|
|
|
|
* GDI bit-blit operations
|
|
|
|
*
|
|
|
|
* Copyright 1993, 1994 Alexandre Julliard
|
2002-03-09 23:29:33 +00: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 18:59:11 +00:00
|
|
|
*/
|
|
|
|
|
2000-11-05 02:05:07 +00:00
|
|
|
#include "gdi.h"
|
2002-03-09 23:29:33 +00:00
|
|
|
#include "wine/debug.h"
|
1996-11-17 18:59:11 +00:00
|
|
|
|
2002-03-09 23:29:33 +00:00
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(bitblt);
|
1999-04-19 14:56:29 +00:00
|
|
|
|
1996-11-17 18:59:11 +00:00
|
|
|
|
|
|
|
/***********************************************************************
|
2001-02-14 23:11:17 +00:00
|
|
|
* PatBlt (GDI32.@)
|
1996-11-17 18:59:11 +00:00
|
|
|
*/
|
1999-02-26 11:11:13 +00:00
|
|
|
BOOL WINAPI PatBlt( HDC hdc, INT left, INT top,
|
|
|
|
INT width, INT height, DWORD rop)
|
1996-11-17 18:59:11 +00:00
|
|
|
{
|
2000-08-22 20:01:47 +00:00
|
|
|
DC * dc = DC_GetDCUpdate( hdc );
|
2000-08-19 21:38:55 +00:00
|
|
|
BOOL bRet = FALSE;
|
1996-11-17 18:59:11 +00:00
|
|
|
|
2000-08-19 21:38:55 +00:00
|
|
|
if (!dc) return FALSE;
|
|
|
|
|
|
|
|
if (dc->funcs->pPatBlt)
|
|
|
|
{
|
2002-11-22 22:16:53 +00:00
|
|
|
TRACE("%p %d,%d %dx%d %06lx\n", hdc, left, top, width, height, rop );
|
2002-03-28 22:22:05 +00:00
|
|
|
bRet = dc->funcs->pPatBlt( dc->physDev, left, top, width, height, rop );
|
2000-08-19 21:38:55 +00:00
|
|
|
}
|
|
|
|
GDI_ReleaseObj( hdc );
|
|
|
|
return bRet;
|
1996-11-17 18:59:11 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
2001-02-14 23:11:17 +00:00
|
|
|
* BitBlt (GDI32.@)
|
1996-11-17 18:59:11 +00:00
|
|
|
*/
|
1999-02-26 11:11:13 +00:00
|
|
|
BOOL WINAPI BitBlt( HDC hdcDst, INT xDst, INT yDst, INT width,
|
2000-08-19 21:38:55 +00:00
|
|
|
INT height, HDC hdcSrc, INT xSrc, INT ySrc, DWORD rop )
|
1996-11-17 18:59:11 +00:00
|
|
|
{
|
2000-08-19 21:38:55 +00:00
|
|
|
BOOL ret = FALSE;
|
1996-11-17 18:59:11 +00:00
|
|
|
DC *dcDst, *dcSrc;
|
|
|
|
|
2000-08-19 21:38:55 +00: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 );
|
2002-11-22 22:16:53 +00:00
|
|
|
TRACE("hdcSrc=%p %d,%d %d bpp->hdcDest=%p %d,%d %dx%dx%d rop=%06lx\n",
|
2000-11-05 02:05:07 +00:00
|
|
|
hdcSrc, xSrc, ySrc, dcSrc ? dcSrc->bitsPerPixel : 0,
|
|
|
|
hdcDst, xDst, yDst, width, height, dcDst->bitsPerPixel, rop);
|
2000-08-19 21:38:55 +00:00
|
|
|
if (dcDst->funcs->pBitBlt)
|
2002-03-28 22:22:05 +00:00
|
|
|
ret = dcDst->funcs->pBitBlt( dcDst->physDev, xDst, yDst, width, height,
|
2002-04-02 03:00:00 +00:00
|
|
|
dcSrc ? dcSrc->physDev : NULL, xSrc, ySrc, rop );
|
2000-08-19 21:38:55 +00:00
|
|
|
if (dcSrc) GDI_ReleaseObj( hdcSrc );
|
|
|
|
GDI_ReleaseObj( hdcDst );
|
|
|
|
}
|
|
|
|
return ret;
|
1996-11-17 18:59:11 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
2001-02-14 23:11:17 +00:00
|
|
|
* StretchBlt (GDI32.@)
|
1996-11-17 18:59:11 +00:00
|
|
|
*/
|
1999-02-26 11:11:13 +00:00
|
|
|
BOOL WINAPI StretchBlt( HDC hdcDst, INT xDst, INT yDst,
|
|
|
|
INT widthDst, INT heightDst,
|
|
|
|
HDC hdcSrc, INT xSrc, INT ySrc,
|
2002-05-31 23:06:46 +00:00
|
|
|
INT widthSrc, INT heightSrc,
|
2000-08-19 21:38:55 +00:00
|
|
|
DWORD rop )
|
1996-11-17 18:59:11 +00:00
|
|
|
{
|
2000-08-19 21:38:55 +00:00
|
|
|
BOOL ret = FALSE;
|
1996-11-17 18:59:11 +00:00
|
|
|
DC *dcDst, *dcSrc;
|
|
|
|
|
2000-08-19 21:38:55 +00: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 );
|
|
|
|
|
2002-11-22 22:16:53 +00:00
|
|
|
TRACE("%p %d,%d %dx%dx%d -> %p %d,%d %dx%dx%d rop=%06lx\n",
|
2000-08-19 21:38:55 +00:00
|
|
|
hdcSrc, xSrc, ySrc, widthSrc, heightSrc,
|
2000-11-05 02:05:07 +00:00
|
|
|
dcSrc ? dcSrc->bitsPerPixel : 0, hdcDst, xDst, yDst,
|
|
|
|
widthDst, heightDst, dcDst->bitsPerPixel, rop );
|
2000-08-19 21:38:55 +00:00
|
|
|
|
|
|
|
if (dcSrc) {
|
|
|
|
if (dcDst->funcs->pStretchBlt)
|
2002-03-28 22:22:05 +00:00
|
|
|
ret = dcDst->funcs->pStretchBlt( dcDst->physDev, xDst, yDst, widthDst, heightDst,
|
|
|
|
dcSrc->physDev, xSrc, ySrc, widthSrc, heightSrc,
|
|
|
|
rop );
|
2000-08-19 21:38:55 +00:00
|
|
|
GDI_ReleaseObj( hdcSrc );
|
|
|
|
}
|
|
|
|
GDI_ReleaseObj( hdcDst );
|
|
|
|
}
|
|
|
|
return ret;
|
1996-11-17 18:59:11 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
1998-12-15 15:38:36 +00:00
|
|
|
/***********************************************************************
|
2001-02-14 23:11:17 +00:00
|
|
|
* MaskBlt [GDI32.@]
|
1998-12-15 15:38:36 +00:00
|
|
|
*/
|
1999-02-26 11:11:13 +00: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 15:38:36 +00:00
|
|
|
{
|
2002-11-22 22:16:53 +00:00
|
|
|
FIXME("(%p,%d,%d,%d,%d,%p,%d,%d,%p,%d,%d,%ld): stub\n",
|
1998-12-15 15:38:36 +00:00
|
|
|
hdcDest,nXDest,nYDest,nWidth,nHeight,hdcSource,nXSrc,nYSrc,
|
|
|
|
hbmMask,xMask,yMask,dwRop);
|
|
|
|
return 1;
|
|
|
|
}
|
2002-05-31 23:06:46 +00:00
|
|
|
|
1998-12-15 15:38:36 +00:00
|
|
|
/*********************************************************************
|
2001-02-14 23:11:17 +00:00
|
|
|
* PlgBlt [GDI32.@]
|
1998-12-15 15:38:36 +00:00
|
|
|
*
|
|
|
|
*/
|
1999-02-26 11:11:13 +00: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 15:38:36 +00:00
|
|
|
{
|
2000-08-19 21:38:55 +00:00
|
|
|
FIXME("PlgBlt, stub\n");
|
1998-12-15 15:38:36 +00:00
|
|
|
return 1;
|
|
|
|
}
|