Commit c00b2318 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

gdi32: Use get_dc_attr in SetROP2.

parent a0f40f2a
......@@ -1555,34 +1555,6 @@ INT WINAPI GetRelAbs( HDC hdc, DWORD dwIgnore )
/***********************************************************************
* SetROP2 (GDI32.@)
*/
INT WINAPI SetROP2( HDC hdc, INT mode )
{
INT ret = 0;
DC *dc;
if ((mode < R2_BLACK) || (mode > R2_WHITE))
{
SetLastError(ERROR_INVALID_PARAMETER);
return 0;
}
if ((dc = get_dc_ptr( hdc )))
{
PHYSDEV physdev = GET_DC_PHYSDEV( dc, pSetROP2 );
mode = physdev->funcs->pSetROP2( physdev, mode );
if (mode)
{
ret = dc->attr->rop_mode;
dc->attr->rop_mode = mode;
}
release_dc_ptr( dc );
}
return ret;
}
/***********************************************************************
* SetRelAbs (GDI32.@)
*/
INT WINAPI SetRelAbs( HDC hdc, INT mode )
......
......@@ -116,13 +116,13 @@ COLORREF CDECL EMFDRV_SetTextColor( PHYSDEV dev, COLORREF color )
return EMFDRV_WriteRecord( dev, &emr.emr ) ? color : CLR_INVALID;
}
INT CDECL EMFDRV_SetROP2( PHYSDEV dev, INT rop )
BOOL EMFDC_SetROP2( DC_ATTR *dc_attr, INT rop )
{
EMRSETROP2 emr;
emr.emr.iType = EMR_SETROP2;
emr.emr.nSize = sizeof(emr);
emr.iMode = rop;
return EMFDRV_WriteRecord( dev, &emr.emr ) ? rop : 0;
return EMFDRV_WriteRecord( dc_attr->emf, &emr.emr );
}
INT CDECL EMFDRV_SetPolyFillMode( PHYSDEV dev, INT mode )
......
......@@ -125,7 +125,6 @@ extern INT CDECL EMFDRV_SetMapMode( PHYSDEV dev, INT mode ) DECLSPEC_HIDDEN
extern DWORD CDECL EMFDRV_SetMapperFlags( PHYSDEV dev, DWORD flags ) DECLSPEC_HIDDEN;
extern COLORREF CDECL EMFDRV_SetPixel( PHYSDEV dev, INT x, INT y, COLORREF color ) DECLSPEC_HIDDEN;
extern INT CDECL EMFDRV_SetPolyFillMode( PHYSDEV dev, INT mode ) DECLSPEC_HIDDEN;
extern INT CDECL EMFDRV_SetROP2( PHYSDEV dev, INT rop ) DECLSPEC_HIDDEN;
extern INT CDECL EMFDRV_SetStretchBltMode( PHYSDEV dev, INT mode ) DECLSPEC_HIDDEN;
extern COLORREF CDECL EMFDRV_SetTextColor( PHYSDEV dev, COLORREF color ) DECLSPEC_HIDDEN;
extern BOOL CDECL EMFDRV_SetTextJustification( PHYSDEV dev, INT nBreakExtra, INT nBreakCount ) DECLSPEC_HIDDEN;
......
......@@ -141,7 +141,7 @@ static const struct gdi_dc_funcs emfdrv_driver =
EMFDRV_SetMapperFlags, /* pSetMapperFlags */
EMFDRV_SetPixel, /* pSetPixel */
EMFDRV_SetPolyFillMode, /* pSetPolyFillMode */
EMFDRV_SetROP2, /* pSetROP2 */
NULL, /* pSetROP2 */
NULL, /* pSetRelAbs */
EMFDRV_SetStretchBltMode, /* pSetStretchBltMode */
NULL, /* pSetTextAlign */
......
......@@ -68,6 +68,7 @@ extern BOOL METADC_RoundRect( HDC hdc, INT left, INT top, INT right, INT bottom,
INT ell_width, INT ell_height ) DECLSPEC_HIDDEN;
extern BOOL METADC_SetBkMode( HDC hdc, INT mode ) DECLSPEC_HIDDEN;
extern BOOL METADC_SetPixel( HDC hdc, INT x, INT y, COLORREF color ) DECLSPEC_HIDDEN;
extern BOOL METADC_SetROP2( HDC hdc, INT rop ) DECLSPEC_HIDDEN;
extern BOOL METADC_SetTextAlign( HDC hdc, UINT align ) DECLSPEC_HIDDEN;
/* enhanced metafiles */
......@@ -112,6 +113,7 @@ extern BOOL EMFDC_RoundRect( DC_ATTR *dc_attr, INT left, INT top, INT right, INT
INT ell_width, INT ell_height ) DECLSPEC_HIDDEN;
extern BOOL EMFDC_SetBkMode( DC_ATTR *dc_attr, INT mode ) DECLSPEC_HIDDEN;
extern BOOL EMFDC_SetPixel( DC_ATTR *dc_attr, INT x, INT y, COLORREF color ) DECLSPEC_HIDDEN;
extern BOOL EMFDC_SetROP2( DC_ATTR *dc_attr, INT rop ) DECLSPEC_HIDDEN;
extern BOOL EMFDC_SetTextAlign( DC_ATTR *dc_attr, UINT align ) DECLSPEC_HIDDEN;
#endif /* __WINE_GDI_PRIVATE_H */
......@@ -118,6 +118,29 @@ INT WINAPI GetROP2( HDC hdc )
}
/***********************************************************************
* SetROP2 (GDI32.@)
*/
INT WINAPI SetROP2( HDC hdc, INT mode )
{
DC_ATTR *dc_attr;
INT ret;
if ((mode < R2_BLACK) || (mode > R2_WHITE))
{
SetLastError(ERROR_INVALID_PARAMETER);
return 0;
}
if (is_meta_dc( hdc )) return METADC_SetROP2( hdc, mode );
if (!(dc_attr = get_dc_attr( hdc ))) return 0;
if (dc_attr->emf && !EMFDC_SetROP2( dc_attr, mode )) return 0;
ret = dc_attr->rop_mode;
dc_attr->rop_mode = mode;
return ret;
}
/***********************************************************************
* SetPixel (GDI32.@)
*/
COLORREF WINAPI SetPixel( HDC hdc, INT x, INT y, COLORREF color )
......
......@@ -50,9 +50,9 @@ COLORREF CDECL MFDRV_SetTextColor( PHYSDEV dev, COLORREF color )
return MFDRV_MetaParam2(dev, META_SETTEXTCOLOR, HIWORD(color), LOWORD(color)) ? color : CLR_INVALID;
}
INT CDECL MFDRV_SetROP2( PHYSDEV dev, INT rop )
BOOL METADC_SetROP2( HDC hdc, INT rop )
{
return MFDRV_MetaParam1( dev, META_SETROP2, (WORD)rop) ? rop : 0;
return metadc_param1( hdc, META_SETROP2, (WORD)rop );
}
INT CDECL MFDRV_SetRelAbs( PHYSDEV dev, INT mode )
......
......@@ -204,7 +204,7 @@ static const struct gdi_dc_funcs MFDRV_Funcs =
MFDRV_SetMapperFlags, /* pSetMapperFlags */
NULL, /* pSetPixel */
MFDRV_SetPolyFillMode, /* pSetPolyFillMode */
MFDRV_SetROP2, /* pSetROP2 */
NULL, /* pSetROP2 */
MFDRV_SetRelAbs, /* pSetRelAbs */
MFDRV_SetStretchBltMode, /* pSetStretchBltMode */
NULL, /* pSetTextAlign */
......
......@@ -112,7 +112,6 @@ extern DWORD CDECL MFDRV_SetLayout( PHYSDEV dev, DWORD layout ) DECLSPEC_HIDD
extern INT CDECL MFDRV_SetMapMode( PHYSDEV dev, INT mode ) DECLSPEC_HIDDEN;
extern DWORD CDECL MFDRV_SetMapperFlags( PHYSDEV dev, DWORD flags ) DECLSPEC_HIDDEN;
extern INT CDECL MFDRV_SetPolyFillMode( PHYSDEV dev, INT mode ) DECLSPEC_HIDDEN;
extern INT CDECL MFDRV_SetROP2( PHYSDEV dev, INT rop ) DECLSPEC_HIDDEN;
extern INT CDECL MFDRV_SetRelAbs( PHYSDEV dev, INT mode ) DECLSPEC_HIDDEN;
extern INT CDECL MFDRV_SetStretchBltMode( PHYSDEV dev, INT mode ) DECLSPEC_HIDDEN;
extern INT CDECL MFDRV_SetTextCharacterExtra( PHYSDEV dev, INT extra ) DECLSPEC_HIDDEN;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment