gdi32: Store arc direction in DC_ATTR.
Signed-off-by: Jacek Caban <jacek@codeweavers.com> Signed-off-by: Huw Davies <huw@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
454b0fcb1e
commit
85e934e4b8
|
@ -102,7 +102,7 @@ static void set_initial_dc_state( DC *dc )
|
|||
dc->attr->graphics_mode = GM_COMPATIBLE;
|
||||
dc->attr->cur_pos.x = 0;
|
||||
dc->attr->cur_pos.y = 0;
|
||||
dc->ArcDirection = AD_COUNTERCLOCKWISE;
|
||||
dc->attr->arc_direction = AD_COUNTERCLOCKWISE;
|
||||
dc->xformWorld2Wnd.eM11 = 1.0f;
|
||||
dc->xformWorld2Wnd.eM12 = 0.0f;
|
||||
dc->xformWorld2Wnd.eM21 = 0.0f;
|
||||
|
@ -409,7 +409,6 @@ INT CDECL nulldrv_SaveDC( PHYSDEV dev )
|
|||
newdc->breakExtra = dc->breakExtra;
|
||||
newdc->breakRem = dc->breakRem;
|
||||
newdc->MapMode = dc->MapMode;
|
||||
newdc->ArcDirection = dc->ArcDirection;
|
||||
newdc->xformWorld2Wnd = dc->xformWorld2Wnd;
|
||||
newdc->xformWorld2Vport = dc->xformWorld2Vport;
|
||||
newdc->xformVport2World = dc->xformVport2World;
|
||||
|
@ -486,7 +485,7 @@ BOOL CDECL nulldrv_RestoreDC( PHYSDEV dev, INT level )
|
|||
dc->MapMode = dcs->MapMode;
|
||||
dc->attr->graphics_mode = dcs->attr->graphics_mode;
|
||||
dc->attr->cur_pos = dcs->attr->cur_pos;
|
||||
dc->ArcDirection = dcs->ArcDirection;
|
||||
dc->attr->arc_direction = dcs->attr->arc_direction;
|
||||
dc->xformWorld2Wnd = dcs->xformWorld2Wnd;
|
||||
dc->xformWorld2Vport = dcs->xformWorld2Vport;
|
||||
dc->xformVport2World = dcs->xformVport2World;
|
||||
|
@ -991,22 +990,6 @@ INT WINAPI SetGraphicsMode( HDC hdc, INT mode )
|
|||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* GetArcDirection (GDI32.@)
|
||||
*/
|
||||
INT WINAPI GetArcDirection( HDC hdc )
|
||||
{
|
||||
INT ret = 0;
|
||||
DC * dc = get_dc_ptr( hdc );
|
||||
if (dc)
|
||||
{
|
||||
ret = dc->ArcDirection;
|
||||
release_dc_ptr( dc );
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* SetArcDirection (GDI32.@)
|
||||
*/
|
||||
|
@ -1027,8 +1010,8 @@ INT WINAPI SetArcDirection( HDC hdc, INT dir )
|
|||
dir = physdev->funcs->pSetArcDirection( physdev, dir );
|
||||
if (dir)
|
||||
{
|
||||
ret = dc->ArcDirection;
|
||||
dc->ArcDirection = dir;
|
||||
ret = dc->attr->arc_direction;
|
||||
dc->attr->arc_direction = dir;
|
||||
}
|
||||
release_dc_ptr( dc );
|
||||
}
|
||||
|
|
|
@ -347,9 +347,9 @@ static BOOL draw_arc( PHYSDEV dev, INT left, INT top, INT right, INT bottom,
|
|||
{
|
||||
points[0] = dc->attr->cur_pos;
|
||||
lp_to_dp( dc, points, 1 );
|
||||
count = 1 + get_arc_points( dc->ArcDirection, &rect, pt[0], pt[1], points + 1 );
|
||||
count = 1 + get_arc_points( dc->attr->arc_direction, &rect, pt[0], pt[1], points + 1 );
|
||||
}
|
||||
else count = get_arc_points( dc->ArcDirection, &rect, pt[0], pt[1], points );
|
||||
else count = get_arc_points( dc->attr->arc_direction, &rect, pt[0], pt[1], points );
|
||||
|
||||
if (extra_lines == 2)
|
||||
{
|
||||
|
@ -1396,7 +1396,7 @@ BOOL CDECL dibdrv_Rectangle( PHYSDEV dev, INT left, INT top, INT right, INT bott
|
|||
rect.bottom--;
|
||||
reset_dash_origin(pdev);
|
||||
|
||||
if (dc->ArcDirection == AD_CLOCKWISE)
|
||||
if (dc->attr->arc_direction == AD_CLOCKWISE)
|
||||
{
|
||||
/* 4 pts going clockwise starting from bottom-right */
|
||||
pts[0].x = pts[3].x = rect.right;
|
||||
|
@ -1493,7 +1493,7 @@ BOOL CDECL dibdrv_RoundRect( PHYSDEV dev, INT left, INT top, INT right, INT bott
|
|||
|
||||
count = ellipse_first_quadrant( ellipse_width, ellipse_height, points );
|
||||
|
||||
if (dc->ArcDirection == AD_CLOCKWISE)
|
||||
if (dc->attr->arc_direction == AD_CLOCKWISE)
|
||||
{
|
||||
for (i = 0; i < count; i++)
|
||||
{
|
||||
|
|
|
@ -124,6 +124,15 @@ INT WINAPI GetGraphicsMode( HDC hdc )
|
|||
return dc_attr ? dc_attr->graphics_mode : 0;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* GetArcDirection (GDI32.@)
|
||||
*/
|
||||
INT WINAPI GetArcDirection( HDC hdc )
|
||||
{
|
||||
DC_ATTR *dc_attr = get_dc_attr( hdc );
|
||||
return dc_attr ? dc_attr->arc_direction : 0;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* GetLayout (GDI32.@)
|
||||
*/
|
||||
|
|
|
@ -129,7 +129,6 @@ typedef struct tagDC
|
|||
INT breakRem; /* breakTotalExtra % breakCount */
|
||||
INT MapMode;
|
||||
ABORTPROC pAbortProc; /* AbortProc for Printing */
|
||||
INT ArcDirection;
|
||||
XFORM xformWorld2Wnd; /* World-to-window transformation */
|
||||
XFORM xformWorld2Vport; /* World-to-viewport transformation */
|
||||
XFORM xformVport2World; /* Inverse of the above transformation */
|
||||
|
|
|
@ -893,7 +893,7 @@ static BOOL CDECL pathdrv_Rectangle( PHYSDEV dev, INT x1, INT y1, INT x2, INT y2
|
|||
points[2].x = corners[0].x;
|
||||
points[2].y = corners[1].y;
|
||||
points[3] = corners[1];
|
||||
if (dc->ArcDirection == AD_CLOCKWISE) reverse_points( points, 4 );
|
||||
if (dc->attr->arc_direction == AD_CLOCKWISE) reverse_points( points, 4 );
|
||||
|
||||
if (!(type = add_points( physdev->path, points, 4, PT_LINETO ))) return FALSE;
|
||||
type[0] = PT_MOVETO;
|
||||
|
@ -968,7 +968,7 @@ static BOOL CDECL pathdrv_RoundRect( PHYSDEV dev, INT x1, INT y1, INT x2, INT y2
|
|||
points[15].x = corners[1].x;
|
||||
points[15].y = corners[1].y - GDI_ROUND( height );
|
||||
|
||||
if (dc->ArcDirection == AD_CLOCKWISE) reverse_points( points, 16 );
|
||||
if (dc->attr->arc_direction == AD_CLOCKWISE) reverse_points( points, 16 );
|
||||
if (!(type = add_points( physdev->path, points, 16, PT_BEZIERTO ))) return FALSE;
|
||||
type[0] = PT_MOVETO;
|
||||
type[4] = type[8] = type[12] = PT_LINETO;
|
||||
|
@ -1026,7 +1026,7 @@ static BOOL CDECL pathdrv_Ellipse( PHYSDEV dev, INT x1, INT y1, INT x2, INT y2 )
|
|||
points[12].x = corners[1].x;
|
||||
points[12].y = corners[1].y - GDI_ROUND( height );
|
||||
|
||||
if (dc->ArcDirection == AD_CLOCKWISE) reverse_points( points, 13 );
|
||||
if (dc->attr->arc_direction == AD_CLOCKWISE) reverse_points( points, 13 );
|
||||
if (!(type = add_points( physdev->path, points, 13, PT_BEZIERTO ))) return FALSE;
|
||||
type[0] = PT_MOVETO;
|
||||
close_figure( physdev->path );
|
||||
|
@ -1206,7 +1206,7 @@ static BOOL CDECL pathdrv_Arc( PHYSDEV dev, INT left, INT top, INT right, INT bo
|
|||
{
|
||||
DC *dc = get_physdev_dc( dev );
|
||||
return PATH_Arc( dev, left, top, right, bottom, xstart, ystart, xend, yend,
|
||||
dc->ArcDirection, 0 );
|
||||
dc->attr->arc_direction, 0 );
|
||||
}
|
||||
|
||||
|
||||
|
@ -1218,7 +1218,7 @@ static BOOL CDECL pathdrv_ArcTo( PHYSDEV dev, INT left, INT top, INT right, INT
|
|||
{
|
||||
DC *dc = get_physdev_dc( dev );
|
||||
return PATH_Arc( dev, left, top, right, bottom, xstart, ystart, xend, yend,
|
||||
dc->ArcDirection, -1 );
|
||||
dc->attr->arc_direction, -1 );
|
||||
}
|
||||
|
||||
|
||||
|
@ -1230,7 +1230,7 @@ static BOOL CDECL pathdrv_Chord( PHYSDEV dev, INT left, INT top, INT right, INT
|
|||
{
|
||||
DC *dc = get_physdev_dc( dev );
|
||||
return PATH_Arc( dev, left, top, right, bottom, xstart, ystart, xend, yend,
|
||||
dc->ArcDirection, 1 );
|
||||
dc->attr->arc_direction, 1 );
|
||||
}
|
||||
|
||||
|
||||
|
@ -1242,7 +1242,7 @@ static BOOL CDECL pathdrv_Pie( PHYSDEV dev, INT left, INT top, INT right, INT bo
|
|||
{
|
||||
DC *dc = get_physdev_dc( dev );
|
||||
return PATH_Arc( dev, left, top, right, bottom, xstart, ystart, xend, yend,
|
||||
dc->ArcDirection, 2 );
|
||||
dc->attr->arc_direction, 2 );
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -103,6 +103,7 @@ typedef struct DC_ATTR
|
|||
COLORREF text_color;
|
||||
POINT cur_pos;
|
||||
INT graphics_mode;
|
||||
INT arc_direction;
|
||||
DWORD layout;
|
||||
WORD text_align;
|
||||
WORD background_mode;
|
||||
|
|
Loading…
Reference in New Issue