Jacek Caban : gdi32: Store arc direction in DC_ATTR.
Alexandre Julliard
julliard at winehq.org
Wed Jul 28 15:37:41 CDT 2021
Module: wine
Branch: master
Commit: 85e934e4b8f8578dc9486cc39a481e31418b4ce5
URL: https://source.winehq.org/git/wine.git/?a=commit;h=85e934e4b8f8578dc9486cc39a481e31418b4ce5
Author: Jacek Caban <jacek at codeweavers.com>
Date: Wed Jul 28 11:40:15 2021 +0200
gdi32: Store arc direction in DC_ATTR.
Signed-off-by: Jacek Caban <jacek at codeweavers.com>
Signed-off-by: Huw Davies <huw at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/gdi32/dc.c | 25 ++++---------------------
dlls/gdi32/dibdrv/graphics.c | 8 ++++----
dlls/gdi32/gdidc.c | 9 +++++++++
dlls/gdi32/ntgdi_private.h | 1 -
dlls/gdi32/path.c | 14 +++++++-------
include/ntgdi.h | 1 +
6 files changed, 25 insertions(+), 33 deletions(-)
diff --git a/dlls/gdi32/dc.c b/dlls/gdi32/dc.c
index 71d27c03e4f..55b48b2be5f 100644
--- a/dlls/gdi32/dc.c
+++ b/dlls/gdi32/dc.c
@@ -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 );
}
diff --git a/dlls/gdi32/dibdrv/graphics.c b/dlls/gdi32/dibdrv/graphics.c
index 3eb9c5184a4..30ffad70b02 100644
--- a/dlls/gdi32/dibdrv/graphics.c
+++ b/dlls/gdi32/dibdrv/graphics.c
@@ -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++)
{
diff --git a/dlls/gdi32/gdidc.c b/dlls/gdi32/gdidc.c
index 3a4e6e48899..7f8af0552bf 100644
--- a/dlls/gdi32/gdidc.c
+++ b/dlls/gdi32/gdidc.c
@@ -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.@)
*/
diff --git a/dlls/gdi32/ntgdi_private.h b/dlls/gdi32/ntgdi_private.h
index 110fc622d03..0f01102ed9d 100644
--- a/dlls/gdi32/ntgdi_private.h
+++ b/dlls/gdi32/ntgdi_private.h
@@ -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 */
diff --git a/dlls/gdi32/path.c b/dlls/gdi32/path.c
index ff3ab04480c..8761723f62e 100644
--- a/dlls/gdi32/path.c
+++ b/dlls/gdi32/path.c
@@ -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 );
}
diff --git a/include/ntgdi.h b/include/ntgdi.h
index c1221d7995b..ba9d1fe7a00 100644
--- a/include/ntgdi.h
+++ b/include/ntgdi.h
@@ -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;
More information about the wine-cvs
mailing list