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

gdi32: Move ROP mode to DC_ATTR.

parent ed1fbcf7
......@@ -82,7 +82,7 @@ static void set_initial_dc_state( DC *dc )
dc->miterLimit = 10.0f; /* 10.0 is the default, from MSDN */
dc->layout = 0;
dc->font_code_page = CP_ACP;
dc->ROPmode = R2_COPYPEN;
dc->attr->rop_mode = R2_COPYPEN;
dc->polyFillMode = ALTERNATE;
dc->stretchBltMode = BLACKONWHITE;
dc->relAbsMode = ABSOLUTE;
......@@ -399,7 +399,6 @@ INT CDECL nulldrv_SaveDC( PHYSDEV dev )
newdc->hFont = dc->hFont;
newdc->hBitmap = dc->hBitmap;
newdc->hPalette = dc->hPalette;
newdc->ROPmode = dc->ROPmode;
newdc->polyFillMode = dc->polyFillMode;
newdc->stretchBltMode = dc->stretchBltMode;
newdc->relAbsMode = dc->relAbsMode;
......@@ -472,7 +471,7 @@ BOOL CDECL nulldrv_RestoreDC( PHYSDEV dev, INT level )
if (!PATH_RestorePath( dc, dcs )) return FALSE;
dc->layout = dcs->layout;
dc->ROPmode = dcs->ROPmode;
dc->attr->rop_mode = dcs->attr->rop_mode;
dc->polyFillMode = dcs->polyFillMode;
dc->stretchBltMode = dcs->stretchBltMode;
dc->relAbsMode = dcs->relAbsMode;
......@@ -1556,22 +1555,6 @@ INT WINAPI GetRelAbs( HDC hdc, DWORD dwIgnore )
/***********************************************************************
* GetROP2 (GDI32.@)
*/
INT WINAPI GetROP2( HDC hdc )
{
INT ret = 0;
DC * dc = get_dc_ptr( hdc );
if (dc)
{
ret = dc->ROPmode;
release_dc_ptr( dc );
}
return ret;
}
/***********************************************************************
* SetROP2 (GDI32.@)
*/
INT WINAPI SetROP2( HDC hdc, INT mode )
......@@ -1590,8 +1573,8 @@ INT WINAPI SetROP2( HDC hdc, INT mode )
mode = physdev->funcs->pSetROP2( physdev, mode );
if (mode)
{
ret = dc->ROPmode;
dc->ROPmode = mode;
ret = dc->attr->rop_mode;
dc->attr->rop_mode = mode;
}
release_dc_ptr( dc );
}
......
......@@ -73,7 +73,7 @@ static BOOL brush_rect( dibdrv_physdev *pdev, dib_brush *brush, const RECT *rect
if (!get_clipped_rects( &pdev->dib, rect, clip, &clipped_rects )) return TRUE;
ret = brush->rects( pdev, brush, &pdev->dib, clipped_rects.count, clipped_rects.rects,
&dc->brush_org, dc->ROPmode );
&dc->brush_org, dc->attr->rop_mode );
free_clipped_rects( &clipped_rects );
return ret;
}
......@@ -1590,7 +1590,7 @@ COLORREF CDECL dibdrv_SetPixel( PHYSDEV dev, INT x, INT y, COLORREF color )
color = pdev->dib.funcs->pixel_to_colorref( &pdev->dib, pixel );
if (!get_clipped_rects( &pdev->dib, &rect, pdev->clip, &clipped_rects )) return color;
fill_with_pixel( dc, &pdev->dib, pixel, clipped_rects.count, clipped_rects.rects, dc->ROPmode );
fill_with_pixel( dc, &pdev->dib, pixel, clipped_rects.count, clipped_rects.rects, dc->attr->rop_mode );
free_clipped_rects( &clipped_rects );
return color;
}
......
......@@ -819,7 +819,7 @@ static BOOL solid_pen_lines(dibdrv_physdev *pdev, int num, POINT *pts, BOOL clos
DWORD color, and, xor;
color = get_pixel_color( dc, &pdev->dib, pdev->pen_brush.colorref, TRUE );
calc_and_xor_masks( dc->ROPmode, color, &and, &xor );
calc_and_xor_masks( dc->attr->rop_mode, color, &and, &xor );
for (i = 0; i < num - 1; i++)
if (!solid_pen_line( pdev, pts + i, pts + i + 1, and, xor ))
......@@ -1229,7 +1229,7 @@ static BOOL dashed_pen_lines(dibdrv_physdev *pdev, int num, POINT *pts, BOOL clo
}
else
{
get_color_masks( dc, &pdev->dib, dc->ROPmode, pdev->pen_brush.colorref,
get_color_masks( dc, &pdev->dib, dc->attr->rop_mode, pdev->pen_brush.colorref,
pdev->pen_is_ext ? TRANSPARENT : dc->attr->background_mode,
&pdev->dash_masks[1], &pdev->dash_masks[0] );
......
......@@ -109,6 +109,15 @@ BOOL WINAPI GetCurrentPositionEx( HDC hdc, POINT *point )
}
/***********************************************************************
* GetROP2 (GDI32.@)
*/
INT WINAPI GetROP2( HDC hdc )
{
DC_ATTR *dc_attr = get_dc_attr( hdc );
return dc_attr ? dc_attr->rop_mode : 0;
}
/***********************************************************************
* SetPixel (GDI32.@)
*/
COLORREF WINAPI SetPixel( HDC hdc, INT x, INT y, COLORREF color )
......
......@@ -117,7 +117,6 @@ typedef struct tagDC
const struct font_gamma_ramp *font_gamma_ramp;
UINT font_code_page;
WORD ROPmode;
WORD polyFillMode;
WORD stretchBltMode;
WORD relAbsMode;
......
......@@ -103,6 +103,7 @@ typedef struct DC_ATTR
INT graphics_mode;
WORD text_align;
WORD background_mode;
WORD rop_mode;
void *emf;
} DC_ATTR;
......
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