1996-11-17 19:59:11 +01:00
|
|
|
/*
|
|
|
|
* GDI bit-blit operations
|
|
|
|
*
|
|
|
|
* Copyright 1993, 1994 Alexandre Julliard
|
|
|
|
*/
|
|
|
|
|
1996-12-22 19:27:48 +01:00
|
|
|
#include "dc.h"
|
1999-05-02 16:32:27 +02:00
|
|
|
#include "debugtools.h"
|
1996-11-17 19:59:11 +01:00
|
|
|
|
1999-04-19 16:56:29 +02:00
|
|
|
DECLARE_DEBUG_CHANNEL(bitblt)
|
|
|
|
DECLARE_DEBUG_CHANNEL(bitmap)
|
|
|
|
DECLARE_DEBUG_CHANNEL(gdi)
|
|
|
|
|
1996-11-17 19:59:11 +01:00
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* PatBlt16 (GDI.29)
|
|
|
|
*/
|
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
|
|
|
{
|
1996-12-22 19:27:48 +01:00
|
|
|
DC * dc = DC_GetDCPtr( hdc );
|
1996-11-17 19:59:11 +01:00
|
|
|
if (!dc || !dc->funcs->pPatBlt) return FALSE;
|
|
|
|
|
1999-05-02 16:32:27 +02:00
|
|
|
TRACE_(bitblt)("%04x %d,%d %dx%d %06lx\n",
|
1996-11-17 19:59:11 +01:00
|
|
|
hdc, left, top, width, height, rop );
|
|
|
|
return dc->funcs->pPatBlt( dc, left, top, width, height, rop );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* PatBlt32 (GDI32.260)
|
|
|
|
*/
|
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
|
|
|
{
|
1996-12-22 19:27:48 +01:00
|
|
|
DC * dc = DC_GetDCPtr( hdc );
|
1996-11-17 19:59:11 +01:00
|
|
|
if (!dc || !dc->funcs->pPatBlt) return FALSE;
|
|
|
|
|
1999-05-02 16:32:27 +02:00
|
|
|
TRACE_(bitblt)("%04x %d,%d %dx%d %06lx\n",
|
1996-11-17 19:59:11 +01:00
|
|
|
hdc, left, top, width, height, rop );
|
|
|
|
return dc->funcs->pPatBlt( dc, left, top, width, height, rop );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* BitBlt16 (GDI.34)
|
|
|
|
*/
|
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
|
|
|
{
|
|
|
|
DC *dcDst, *dcSrc;
|
|
|
|
|
1996-12-22 19:27:48 +01:00
|
|
|
if (!(dcDst = DC_GetDCPtr( hdcDst ))) return FALSE;
|
1996-11-17 19:59:11 +01:00
|
|
|
if (!dcDst->funcs->pBitBlt) return FALSE;
|
1996-12-22 19:27:48 +01:00
|
|
|
dcSrc = DC_GetDCPtr( hdcSrc );
|
1996-11-17 19:59:11 +01:00
|
|
|
|
1999-05-02 16:32:27 +02:00
|
|
|
TRACE_(bitblt)("hdcSrc=%04x %d,%d %d bpp -> hdcDest=%04x %d,%d %dx%dx%d rop=%06lx\n",
|
1998-03-15 21:29:56 +01:00
|
|
|
hdcSrc, xSrc, ySrc, dcSrc ? dcSrc->w.bitsPerPixel : 0,
|
|
|
|
hdcDst, xDst, yDst, width, height, dcDst->w.bitsPerPixel, rop);
|
1996-11-17 19:59:11 +01:00
|
|
|
return dcDst->funcs->pBitBlt( dcDst, xDst, yDst, width, height,
|
|
|
|
dcSrc, xSrc, ySrc, rop );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* BitBlt32 (GDI32.10)
|
|
|
|
*/
|
1999-02-26 12:11:13 +01:00
|
|
|
BOOL WINAPI BitBlt( HDC hdcDst, INT xDst, INT yDst, INT width,
|
|
|
|
INT height, HDC hdcSrc, INT xSrc, INT ySrc,
|
1997-08-24 18:00:30 +02:00
|
|
|
DWORD rop )
|
1996-11-17 19:59:11 +01:00
|
|
|
{
|
|
|
|
DC *dcDst, *dcSrc;
|
|
|
|
|
1996-12-22 19:27:48 +01:00
|
|
|
if (!(dcDst = DC_GetDCPtr( hdcDst ))) return FALSE;
|
1996-11-17 19:59:11 +01:00
|
|
|
if (!dcDst->funcs->pBitBlt) return FALSE;
|
1996-12-22 19:27:48 +01:00
|
|
|
dcSrc = DC_GetDCPtr( hdcSrc );
|
1996-11-17 19:59:11 +01:00
|
|
|
|
1999-05-02 16:32:27 +02:00
|
|
|
TRACE_(bitblt)("hdcSrc=%04x %d,%d %d bpp -> hdcDest=%04x %d,%d %dx%dx%d rop=%06lx\n",
|
1998-03-15 21:29:56 +01:00
|
|
|
hdcSrc, xSrc, ySrc, dcSrc ? dcSrc->w.bitsPerPixel : 0,
|
|
|
|
hdcDst, xDst, yDst, width, height, dcDst->w.bitsPerPixel, rop);
|
1996-11-17 19:59:11 +01:00
|
|
|
return dcDst->funcs->pBitBlt( dcDst, xDst, yDst, width, height,
|
|
|
|
dcSrc, xSrc, ySrc, rop );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* StretchBlt16 (GDI.35)
|
|
|
|
*/
|
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
|
|
|
{
|
|
|
|
DC *dcDst, *dcSrc;
|
|
|
|
|
1996-12-22 19:27:48 +01:00
|
|
|
if (!(dcDst = DC_GetDCPtr( hdcDst ))) return FALSE;
|
1996-11-17 19:59:11 +01:00
|
|
|
if (!dcDst->funcs->pStretchBlt) return FALSE;
|
1996-12-22 19:27:48 +01:00
|
|
|
dcSrc = DC_GetDCPtr( hdcSrc );
|
|
|
|
|
1999-05-02 16:32:27 +02:00
|
|
|
TRACE_(bitblt)("%04x %d,%d %dx%dx%d -> %04x %d,%d %dx%dx%d rop=%06lx\n",
|
1998-03-15 21:29:56 +01:00
|
|
|
hdcSrc, xSrc, ySrc, widthSrc, heightSrc,
|
|
|
|
dcSrc ? dcSrc->w.bitsPerPixel : 0, hdcDst, xDst, yDst,
|
|
|
|
widthDst, heightDst, dcDst->w.bitsPerPixel, rop );
|
1996-11-17 19:59:11 +01:00
|
|
|
return dcDst->funcs->pStretchBlt( dcDst, xDst, yDst, widthDst, heightDst,
|
|
|
|
dcSrc, xSrc, ySrc, widthSrc, heightSrc,
|
|
|
|
rop );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* StretchBlt32 (GDI32.350)
|
|
|
|
*/
|
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,
|
|
|
|
INT widthSrc, INT heightSrc, DWORD rop )
|
1996-11-17 19:59:11 +01:00
|
|
|
{
|
|
|
|
DC *dcDst, *dcSrc;
|
|
|
|
|
1996-12-22 19:27:48 +01:00
|
|
|
if (!(dcDst = DC_GetDCPtr( hdcDst ))) return FALSE;
|
1996-11-17 19:59:11 +01:00
|
|
|
if (!dcDst->funcs->pStretchBlt) return FALSE;
|
1996-12-22 19:27:48 +01:00
|
|
|
dcSrc = DC_GetDCPtr( hdcSrc );
|
|
|
|
|
1999-05-02 16:32:27 +02:00
|
|
|
TRACE_(bitblt)("%04x %d,%d %dx%dx%d -> %04x %d,%d %dx%dx%d rop=%06lx\n",
|
1998-03-15 21:29:56 +01:00
|
|
|
hdcSrc, xSrc, ySrc, widthSrc, heightSrc,
|
|
|
|
dcSrc ? dcSrc->w.bitsPerPixel : 0, hdcDst, xDst, yDst,
|
|
|
|
widthDst, heightDst, dcDst->w.bitsPerPixel, rop );
|
1996-11-17 19:59:11 +01:00
|
|
|
return dcDst->funcs->pStretchBlt( dcDst, xDst, yDst, widthDst, heightDst,
|
|
|
|
dcSrc, xSrc, ySrc, widthSrc, heightSrc,
|
|
|
|
rop );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* 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-02-26 12:11:13 +01:00
|
|
|
PatBlt( hdc, rect->left + width, rect->bottom,
|
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->right, 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;
|
|
|
|
}
|
1998-12-15 16:38:36 +01:00
|
|
|
/***********************************************************************
|
|
|
|
* MaskBlt32 [GDI32.252]
|
|
|
|
*/
|
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
|
|
|
{
|
1999-05-02 16:32:27 +02:00
|
|
|
FIXME_(bitmap)("(%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;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*********************************************************************
|
|
|
|
* PlgBlt [GDI.267]
|
|
|
|
*
|
|
|
|
*/
|
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
|
|
|
{
|
1999-05-02 16:32:27 +02:00
|
|
|
FIXME_(gdi)("PlgBlt, stub\n");
|
1998-12-15 16:38:36 +01:00
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|