gdi32: Add null driver entry points for the pixel format functions.

This commit is contained in:
Alexandre Julliard 2011-03-11 12:26:25 +01:00
parent d1db4c859c
commit 806d0c4f86
2 changed files with 61 additions and 45 deletions

View File

@ -323,6 +323,11 @@ static BOOL CDECL nulldrv_Arc( PHYSDEV dev, INT left, INT top, INT right, INT bo
return TRUE; return TRUE;
} }
static INT CDECL nulldrv_ChoosePixelFormat( PHYSDEV dev, const PIXELFORMATDESCRIPTOR *descr )
{
return 0;
}
static BOOL CDECL nulldrv_Chord( PHYSDEV dev, INT left, INT top, INT right, INT bottom, static BOOL CDECL nulldrv_Chord( PHYSDEV dev, INT left, INT top, INT right, INT bottom,
INT xstart, INT ystart, INT xend, INT yend ) INT xstart, INT ystart, INT xend, INT yend )
{ {
@ -334,6 +339,12 @@ static BOOL CDECL nulldrv_DeleteObject( PHYSDEV dev, HGDIOBJ obj )
return TRUE; return TRUE;
} }
static INT CDECL nulldrv_DescribePixelFormat( PHYSDEV dev, INT format,
UINT size, PIXELFORMATDESCRIPTOR * descr )
{
return 0;
}
static DWORD CDECL nulldrv_DeviceCapabilities( LPSTR buffer, LPCSTR device, LPCSTR port, static DWORD CDECL nulldrv_DeviceCapabilities( LPSTR buffer, LPCSTR device, LPCSTR port,
WORD cap, LPSTR output, DEVMODEA *devmode ) WORD cap, LPSTR output, DEVMODEA *devmode )
{ {
@ -382,6 +393,11 @@ static COLORREF CDECL nulldrv_GetPixel( PHYSDEV dev, INT x, INT y )
return 0; return 0;
} }
static INT CDECL nulldrv_GetPixelFormat( PHYSDEV dev )
{
return 0;
}
static BOOL CDECL nulldrv_LineTo( PHYSDEV dev, INT x, INT y ) static BOOL CDECL nulldrv_LineTo( PHYSDEV dev, INT x, INT y )
{ {
return TRUE; return TRUE;
@ -505,6 +521,11 @@ static COLORREF CDECL nulldrv_SetPixel( PHYSDEV dev, INT x, INT y, COLORREF colo
return color; return color;
} }
static BOOL CDECL nulldrv_SetPixelFormat( PHYSDEV dev, INT format, const PIXELFORMATDESCRIPTOR *descr )
{
return FALSE;
}
static INT CDECL nulldrv_SetPolyFillMode( PHYSDEV dev, INT mode ) static INT CDECL nulldrv_SetPolyFillMode( PHYSDEV dev, INT mode )
{ {
return mode; return mode;
@ -555,6 +576,11 @@ static INT CDECL nulldrv_StartPage( PHYSDEV dev )
return 1; return 1;
} }
static BOOL CDECL nulldrv_SwapBuffers( PHYSDEV dev )
{
return TRUE;
}
static BOOL CDECL nulldrv_wglCopyContext( HGLRC ctx_src, HGLRC ctx_dst, UINT mask ) static BOOL CDECL nulldrv_wglCopyContext( HGLRC ctx_src, HGLRC ctx_dst, UINT mask )
{ {
return FALSE; return FALSE;
@ -626,7 +652,7 @@ const DC_FUNCTIONS null_driver =
nulldrv_ArcTo, /* pArcTo */ nulldrv_ArcTo, /* pArcTo */
NULL, /* pBeginPath */ NULL, /* pBeginPath */
NULL, /* pBitBlt */ NULL, /* pBitBlt */
NULL, /* pChoosePixelFormat */ nulldrv_ChoosePixelFormat, /* pChoosePixelFormat */
nulldrv_Chord, /* pChord */ nulldrv_Chord, /* pChord */
NULL, /* pCloseFigure */ NULL, /* pCloseFigure */
NULL, /* pCreateBitmap */ NULL, /* pCreateBitmap */
@ -635,7 +661,7 @@ const DC_FUNCTIONS null_driver =
NULL, /* pDeleteBitmap */ NULL, /* pDeleteBitmap */
NULL, /* pDeleteDC */ NULL, /* pDeleteDC */
nulldrv_DeleteObject, /* pDeleteObject */ nulldrv_DeleteObject, /* pDeleteObject */
NULL, /* pDescribePixelFormat */ nulldrv_DescribePixelFormat, /* pDescribePixelFormat */
nulldrv_DeviceCapabilities, /* pDeviceCapabilities */ nulldrv_DeviceCapabilities, /* pDeviceCapabilities */
nulldrv_Ellipse, /* pEllipse */ nulldrv_Ellipse, /* pEllipse */
nulldrv_EndDoc, /* pEndDoc */ nulldrv_EndDoc, /* pEndDoc */
@ -662,7 +688,7 @@ const DC_FUNCTIONS null_driver =
NULL, /* pGetICMProfile */ NULL, /* pGetICMProfile */
NULL, /* pGetNearestColor */ NULL, /* pGetNearestColor */
nulldrv_GetPixel, /* pGetPixel */ nulldrv_GetPixel, /* pGetPixel */
NULL, /* pGetPixelFormat */ nulldrv_GetPixelFormat, /* pGetPixelFormat */
NULL, /* pGetSystemPaletteEntries */ NULL, /* pGetSystemPaletteEntries */
NULL, /* pGetTextExtentExPoint */ NULL, /* pGetTextExtentExPoint */
NULL, /* pGetTextMetrics */ NULL, /* pGetTextMetrics */
@ -715,7 +741,7 @@ const DC_FUNCTIONS null_driver =
nulldrv_SetMapMode, /* pSetMapMode */ nulldrv_SetMapMode, /* pSetMapMode */
nulldrv_SetMapperFlags, /* pSetMapperFlags */ nulldrv_SetMapperFlags, /* pSetMapperFlags */
nulldrv_SetPixel, /* pSetPixel */ nulldrv_SetPixel, /* pSetPixel */
NULL, /* pSetPixelFormat */ nulldrv_SetPixelFormat, /* pSetPixelFormat */
nulldrv_SetPolyFillMode, /* pSetPolyFillMode */ nulldrv_SetPolyFillMode, /* pSetPolyFillMode */
nulldrv_SetROP2, /* pSetROP2 */ nulldrv_SetROP2, /* pSetROP2 */
nulldrv_SetRelAbs, /* pSetRelAbs */ nulldrv_SetRelAbs, /* pSetRelAbs */
@ -735,7 +761,7 @@ const DC_FUNCTIONS null_driver =
NULL, /* pStretchDIBits */ NULL, /* pStretchDIBits */
NULL, /* pStrokeAndFillPath */ NULL, /* pStrokeAndFillPath */
NULL, /* pStrokePath */ NULL, /* pStrokePath */
NULL, /* pSwapBuffers */ nulldrv_SwapBuffers, /* pSwapBuffers */
NULL, /* pUnrealizePalette */ NULL, /* pUnrealizePalette */
NULL, /* pWidenPath */ NULL, /* pWidenPath */
nulldrv_wglCopyContext, /* pwglCopyContext */ nulldrv_wglCopyContext, /* pwglCopyContext */

View File

@ -545,12 +545,12 @@ INT WINAPI ChoosePixelFormat( HDC hdc, const PIXELFORMATDESCRIPTOR* ppfd )
TRACE("(%p,%p)\n",hdc,ppfd); TRACE("(%p,%p)\n",hdc,ppfd);
if (!dc) return 0; if (dc)
{
if (!dc->funcs->pChoosePixelFormat) FIXME(" :stub\n"); PHYSDEV physdev = GET_DC_PHYSDEV( dc, pChoosePixelFormat );
else ret = dc->funcs->pChoosePixelFormat(dc->physDev,ppfd); ret = physdev->funcs->pChoosePixelFormat( physdev, ppfd );
release_dc_ptr( dc ); release_dc_ptr( dc );
}
return ret; return ret;
} }
@ -576,13 +576,13 @@ BOOL WINAPI SetPixelFormat( HDC hdc, INT iPixelFormat,
TRACE("(%p,%d,%p)\n",hdc,iPixelFormat,ppfd); TRACE("(%p,%d,%p)\n",hdc,iPixelFormat,ppfd);
if (!dc) return 0; if (dc)
{
PHYSDEV physdev = GET_DC_PHYSDEV( dc, pSetPixelFormat );
update_dc( dc ); update_dc( dc );
if (!dc->funcs->pSetPixelFormat) FIXME(" :stub\n"); bRet = physdev->funcs->pSetPixelFormat( physdev, iPixelFormat, ppfd );
else bRet = dc->funcs->pSetPixelFormat(dc->physDev,iPixelFormat,ppfd);
release_dc_ptr( dc ); release_dc_ptr( dc );
}
return bRet; return bRet;
} }
@ -605,13 +605,13 @@ INT WINAPI GetPixelFormat( HDC hdc )
TRACE("(%p)\n",hdc); TRACE("(%p)\n",hdc);
if (!dc) return 0; if (dc)
{
PHYSDEV physdev = GET_DC_PHYSDEV( dc, pGetPixelFormat );
update_dc( dc ); update_dc( dc );
if (!dc->funcs->pGetPixelFormat) FIXME(" :stub\n"); ret = physdev->funcs->pGetPixelFormat( physdev );
else ret = dc->funcs->pGetPixelFormat(dc->physDev);
release_dc_ptr( dc ); release_dc_ptr( dc );
}
return ret; return ret;
} }
@ -638,19 +638,13 @@ INT WINAPI DescribePixelFormat( HDC hdc, INT iPixelFormat, UINT nBytes,
TRACE("(%p,%d,%d,%p): stub\n",hdc,iPixelFormat,nBytes,ppfd); TRACE("(%p,%d,%d,%p): stub\n",hdc,iPixelFormat,nBytes,ppfd);
if (!dc) return 0; if (dc)
update_dc( dc );
if (!dc->funcs->pDescribePixelFormat)
{ {
FIXME(" :stub\n"); PHYSDEV physdev = GET_DC_PHYSDEV( dc, pDescribePixelFormat );
ppfd->nSize = nBytes; update_dc( dc );
ppfd->nVersion = 1; ret = physdev->funcs->pDescribePixelFormat( physdev, iPixelFormat, nBytes, ppfd );
ret = 3;
}
else ret = dc->funcs->pDescribePixelFormat(dc->physDev,iPixelFormat,nBytes,ppfd);
release_dc_ptr( dc ); release_dc_ptr( dc );
}
return ret; return ret;
} }
@ -673,17 +667,13 @@ BOOL WINAPI SwapBuffers( HDC hdc )
TRACE("(%p)\n",hdc); TRACE("(%p)\n",hdc);
if (!dc) return TRUE; if (dc)
update_dc( dc );
if (!dc->funcs->pSwapBuffers)
{ {
FIXME(" :stub\n"); PHYSDEV physdev = GET_DC_PHYSDEV( dc, pSwapBuffers );
bRet = TRUE; update_dc( dc );
} bRet = physdev->funcs->pSwapBuffers( physdev );
else bRet = dc->funcs->pSwapBuffers(dc->physDev);
release_dc_ptr( dc ); release_dc_ptr( dc );
}
return bRet; return bRet;
} }