Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
f8040958
Commit
f8040958
authored
Oct 25, 2011
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Implement the Rectangle and RoundRect entry points in the path driver.
parent
364e2164
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
38 additions
and
83 deletions
+38
-83
gdi_private.h
dlls/gdi32/gdi_private.h
+0
-2
painting.c
dlls/gdi32/painting.c
+4
-14
path.c
dlls/gdi32/path.c
+34
-67
No files found.
dlls/gdi32/gdi_private.h
View file @
f8040958
...
...
@@ -325,7 +325,6 @@ extern void PATH_DestroyGdiPath(GdiPath *pPath) DECLSPEC_HIDDEN;
extern
BOOL
PATH_SavePath
(
DC
*
dst
,
DC
*
src
)
DECLSPEC_HIDDEN
;
extern
BOOL
PATH_RestorePath
(
DC
*
dst
,
DC
*
src
)
DECLSPEC_HIDDEN
;
extern
BOOL
PATH_Rectangle
(
DC
*
dc
,
INT
x1
,
INT
y1
,
INT
x2
,
INT
y2
)
DECLSPEC_HIDDEN
;
extern
BOOL
PATH_ExtTextOut
(
DC
*
dc
,
INT
x
,
INT
y
,
UINT
flags
,
const
RECT
*
lprc
,
LPCWSTR
str
,
UINT
count
,
const
INT
*
dx
)
DECLSPEC_HIDDEN
;
extern
BOOL
PATH_Ellipse
(
DC
*
dc
,
INT
x1
,
INT
y1
,
INT
x2
,
INT
y2
)
DECLSPEC_HIDDEN
;
...
...
@@ -339,7 +338,6 @@ extern BOOL PATH_Polyline(DC *dc, const POINT *pt, DWORD cbCount) DECLSPEC_HIDDE
extern
BOOL
PATH_Polygon
(
DC
*
dc
,
const
POINT
*
pt
,
DWORD
cbCount
)
DECLSPEC_HIDDEN
;
extern
BOOL
PATH_PolyPolyline
(
DC
*
dc
,
const
POINT
*
pt
,
const
DWORD
*
counts
,
DWORD
polylines
)
DECLSPEC_HIDDEN
;
extern
BOOL
PATH_PolyPolygon
(
DC
*
dc
,
const
POINT
*
pt
,
const
INT
*
counts
,
UINT
polygons
)
DECLSPEC_HIDDEN
;
extern
BOOL
PATH_RoundRect
(
DC
*
dc
,
INT
x1
,
INT
y1
,
INT
x2
,
INT
y2
,
INT
ell_width
,
INT
ell_height
)
DECLSPEC_HIDDEN
;
/* painting.c */
extern
POINT
*
GDI_Bezier
(
const
POINT
*
Points
,
INT
count
,
INT
*
nPtsOut
)
DECLSPEC_HIDDEN
;
...
...
dlls/gdi32/painting.c
View file @
f8040958
...
...
@@ -422,14 +422,9 @@ BOOL WINAPI Rectangle( HDC hdc, INT left, INT top,
if
(
dc
)
{
PHYSDEV
physdev
=
GET_DC_PHYSDEV
(
dc
,
pRectangle
);
update_dc
(
dc
);
if
(
PATH_IsPathOpen
(
dc
->
path
))
ret
=
PATH_Rectangle
(
dc
,
left
,
top
,
right
,
bottom
);
else
{
PHYSDEV
physdev
=
GET_DC_PHYSDEV
(
dc
,
pRectangle
);
ret
=
physdev
->
funcs
->
pRectangle
(
physdev
,
left
,
top
,
right
,
bottom
);
}
ret
=
physdev
->
funcs
->
pRectangle
(
physdev
,
left
,
top
,
right
,
bottom
);
release_dc_ptr
(
dc
);
}
return
ret
;
...
...
@@ -447,14 +442,9 @@ BOOL WINAPI RoundRect( HDC hdc, INT left, INT top, INT right,
if
(
dc
)
{
PHYSDEV
physdev
=
GET_DC_PHYSDEV
(
dc
,
pRoundRect
);
update_dc
(
dc
);
if
(
PATH_IsPathOpen
(
dc
->
path
))
ret
=
PATH_RoundRect
(
dc
,
left
,
top
,
right
,
bottom
,
ell_width
,
ell_height
);
else
{
PHYSDEV
physdev
=
GET_DC_PHYSDEV
(
dc
,
pRoundRect
);
ret
=
physdev
->
funcs
->
pRoundRect
(
physdev
,
left
,
top
,
right
,
bottom
,
ell_width
,
ell_height
);
}
ret
=
physdev
->
funcs
->
pRoundRect
(
physdev
,
left
,
top
,
right
,
bottom
,
ell_width
,
ell_height
);
release_dc_ptr
(
dc
);
}
return
ret
;
...
...
dlls/gdi32/path.c
View file @
f8040958
...
...
@@ -273,9 +273,9 @@ static BOOL PATH_AssignGdiPath(GdiPath *pPathDest, const GdiPath *pPathSrc)
/* PATH_CheckCorners
*
* Helper function for
PATH_RoundRect() and PATH_
Rectangle()
* Helper function for
RoundRect() and
Rectangle()
*/
static
BOOL
PATH_CheckCorners
(
DC
*
dc
,
POINT
corners
[],
INT
x1
,
INT
y1
,
INT
x2
,
INT
y2
)
static
void
PATH_CheckCorners
(
HDC
hdc
,
POINT
corners
[],
INT
x1
,
INT
y1
,
INT
x2
,
INT
y2
)
{
INT
temp
;
...
...
@@ -284,8 +284,7 @@ static BOOL PATH_CheckCorners(DC *dc, POINT corners[], INT x1, INT y1, INT x2, I
corners
[
0
].
y
=
y1
;
corners
[
1
].
x
=
x2
;
corners
[
1
].
y
=
y2
;
if
(
!
LPtoDP
(
dc
->
hSelf
,
corners
,
2
))
return
FALSE
;
LPtoDP
(
hdc
,
corners
,
2
);
/* Make sure first corner is top left and second corner is bottom right */
if
(
corners
[
0
].
x
>
corners
[
1
].
x
)
...
...
@@ -302,13 +301,11 @@ static BOOL PATH_CheckCorners(DC *dc, POINT corners[], INT x1, INT y1, INT x2, I
}
/* In GM_COMPATIBLE, don't include bottom and right edges */
if
(
dc
->
GraphicsMode
==
GM_COMPATIBLE
)
if
(
GetGraphicsMode
(
hdc
)
==
GM_COMPATIBLE
)
{
corners
[
1
].
x
--
;
corners
[
1
].
y
--
;
}
return
TRUE
;
}
/* PATH_AddFlatBezier
...
...
@@ -926,115 +923,85 @@ static BOOL pathdrv_LineTo( PHYSDEV dev, INT x, INT y )
return
PATH_AddEntry
(
physdev
->
path
,
&
point
,
PT_LINETO
);
}
/* PATH_RoundRect
*
* Should be called when a call to RoundRect is performed on a DC that has
* an open path. Returns TRUE if successful, else FALSE.
/*************************************************************
* pathdrv_RoundRect
*
* FIXME: it adds the same entries to the path as windows does, but there
* is an error in the bezier drawing code so that there are small pixel-size
* gaps when the resulting path is drawn by StrokePath()
*/
BOOL
PATH_RoundRect
(
DC
*
dc
,
INT
x1
,
INT
y1
,
INT
x2
,
INT
y2
,
INT
ell_width
,
INT
ell_height
)
static
BOOL
pathdrv_RoundRect
(
PHYSDEV
dev
,
INT
x1
,
INT
y1
,
INT
x2
,
INT
y2
,
INT
ell_width
,
INT
ell_height
)
{
GdiPath
*
pPath
=
&
dc
->
path
;
POINT
corners
[
2
],
pointTemp
;
FLOAT_POINT
ellCorners
[
2
];
/* Check that path is open */
if
(
pPath
->
state
!=
PATH_Open
)
return
FALSE
;
struct
path_physdev
*
physdev
=
get_path_physdev
(
dev
);
POINT
corners
[
2
],
pointTemp
;
FLOAT_POINT
ellCorners
[
2
];
if
(
!
PATH_CheckCorners
(
dc
,
corners
,
x1
,
y1
,
x2
,
y2
))
return
FALSE
;
PATH_CheckCorners
(
dev
->
hdc
,
corners
,
x1
,
y1
,
x2
,
y2
);
/* Add points to the roundrect path */
ellCorners
[
0
].
x
=
corners
[
1
].
x
-
ell_width
;
ellCorners
[
0
].
y
=
corners
[
0
].
y
;
ellCorners
[
1
].
x
=
corners
[
1
].
x
;
ellCorners
[
1
].
y
=
corners
[
0
].
y
+
ell_height
;
if
(
!
PATH_DoArcPart
(
p
P
ath
,
ellCorners
,
0
,
-
M_PI_2
,
PT_MOVETO
))
if
(
!
PATH_DoArcPart
(
p
hysdev
->
p
ath
,
ellCorners
,
0
,
-
M_PI_2
,
PT_MOVETO
))
return
FALSE
;
pointTemp
.
x
=
corners
[
0
].
x
+
ell_width
/
2
;
pointTemp
.
y
=
corners
[
0
].
y
;
if
(
!
PATH_AddEntry
(
p
P
ath
,
&
pointTemp
,
PT_LINETO
))
if
(
!
PATH_AddEntry
(
p
hysdev
->
p
ath
,
&
pointTemp
,
PT_LINETO
))
return
FALSE
;
ellCorners
[
0
].
x
=
corners
[
0
].
x
;
ellCorners
[
1
].
x
=
corners
[
0
].
x
+
ell_width
;
if
(
!
PATH_DoArcPart
(
p
P
ath
,
ellCorners
,
-
M_PI_2
,
-
M_PI
,
FALSE
))
if
(
!
PATH_DoArcPart
(
p
hysdev
->
p
ath
,
ellCorners
,
-
M_PI_2
,
-
M_PI
,
FALSE
))
return
FALSE
;
pointTemp
.
x
=
corners
[
0
].
x
;
pointTemp
.
y
=
corners
[
1
].
y
-
ell_height
/
2
;
if
(
!
PATH_AddEntry
(
p
P
ath
,
&
pointTemp
,
PT_LINETO
))
if
(
!
PATH_AddEntry
(
p
hysdev
->
p
ath
,
&
pointTemp
,
PT_LINETO
))
return
FALSE
;
ellCorners
[
0
].
y
=
corners
[
1
].
y
-
ell_height
;
ellCorners
[
1
].
y
=
corners
[
1
].
y
;
if
(
!
PATH_DoArcPart
(
p
P
ath
,
ellCorners
,
M_PI
,
M_PI_2
,
FALSE
))
if
(
!
PATH_DoArcPart
(
p
hysdev
->
p
ath
,
ellCorners
,
M_PI
,
M_PI_2
,
FALSE
))
return
FALSE
;
pointTemp
.
x
=
corners
[
1
].
x
-
ell_width
/
2
;
pointTemp
.
y
=
corners
[
1
].
y
;
if
(
!
PATH_AddEntry
(
p
P
ath
,
&
pointTemp
,
PT_LINETO
))
if
(
!
PATH_AddEntry
(
p
hysdev
->
p
ath
,
&
pointTemp
,
PT_LINETO
))
return
FALSE
;
ellCorners
[
0
].
x
=
corners
[
1
].
x
-
ell_width
;
ellCorners
[
1
].
x
=
corners
[
1
].
x
;
if
(
!
PATH_DoArcPart
(
p
P
ath
,
ellCorners
,
M_PI_2
,
0
,
FALSE
))
if
(
!
PATH_DoArcPart
(
p
hysdev
->
p
ath
,
ellCorners
,
M_PI_2
,
0
,
FALSE
))
return
FALSE
;
/* Close the roundrect figure */
if
(
!
CloseFigure
(
dc
->
hSelf
))
return
FALSE
;
return
TRUE
;
return
CloseFigure
(
dev
->
hdc
);
}
/* PATH_Rectangle
*
* Should be called when a call to Rectangle is performed on a DC that has
* an open path. Returns TRUE if successful, else FALSE.
/*************************************************************
* pathdrv_Rectangle
*/
BOOL
PATH_Rectangle
(
DC
*
dc
,
INT
x1
,
INT
y1
,
INT
x2
,
INT
y2
)
static
BOOL
pathdrv_Rectangle
(
PHYSDEV
dev
,
INT
x1
,
INT
y1
,
INT
x2
,
INT
y2
)
{
GdiPath
*
pPath
=
&
dc
->
path
;
POINT
corners
[
2
],
pointTemp
;
/* Check that path is open */
if
(
pPath
->
state
!=
PATH_Open
)
return
FALSE
;
struct
path_physdev
*
physdev
=
get_path_physdev
(
dev
);
POINT
corners
[
2
],
pointTemp
;
if
(
!
PATH_CheckCorners
(
dc
,
corners
,
x1
,
y1
,
x2
,
y2
))
return
FALSE
;
/* Close any previous figure */
if
(
!
CloseFigure
(
dc
->
hSelf
))
{
/* The CloseFigure call shouldn't have failed */
assert
(
FALSE
);
return
FALSE
;
}
PATH_CheckCorners
(
dev
->
hdc
,
corners
,
x1
,
y1
,
x2
,
y2
);
/* Add four points to the path */
pointTemp
.
x
=
corners
[
1
].
x
;
pointTemp
.
y
=
corners
[
0
].
y
;
if
(
!
PATH_AddEntry
(
p
P
ath
,
&
pointTemp
,
PT_MOVETO
))
if
(
!
PATH_AddEntry
(
p
hysdev
->
p
ath
,
&
pointTemp
,
PT_MOVETO
))
return
FALSE
;
if
(
!
PATH_AddEntry
(
p
P
ath
,
corners
,
PT_LINETO
))
if
(
!
PATH_AddEntry
(
p
hysdev
->
p
ath
,
corners
,
PT_LINETO
))
return
FALSE
;
pointTemp
.
x
=
corners
[
0
].
x
;
pointTemp
.
y
=
corners
[
1
].
y
;
if
(
!
PATH_AddEntry
(
p
P
ath
,
&
pointTemp
,
PT_LINETO
))
if
(
!
PATH_AddEntry
(
p
hysdev
->
p
ath
,
&
pointTemp
,
PT_LINETO
))
return
FALSE
;
if
(
!
PATH_AddEntry
(
p
P
ath
,
corners
+
1
,
PT_LINETO
))
if
(
!
PATH_AddEntry
(
p
hysdev
->
p
ath
,
corners
+
1
,
PT_LINETO
))
return
FALSE
;
/* Close the rectangle figure */
if
(
!
CloseFigure
(
dc
->
hSelf
))
{
/* The CloseFigure call shouldn't have failed */
assert
(
FALSE
);
return
FALSE
;
}
return
TRUE
;
return
CloseFigure
(
dev
->
hdc
);
}
/* PATH_Ellipse
...
...
@@ -2373,10 +2340,10 @@ const struct gdi_dc_funcs path_driver =
NULL
,
/* pPutImage */
NULL
,
/* pRealizeDefaultPalette */
NULL
,
/* pRealizePalette */
NULL
,
/* pRectangle */
pathdrv_Rectangle
,
/* pRectangle */
NULL
,
/* pResetDC */
NULL
,
/* pRestoreDC */
NULL
,
/* pRoundRect */
pathdrv_RoundRect
,
/* pRoundRect */
NULL
,
/* pSaveDC */
NULL
,
/* pScaleViewportExt */
NULL
,
/* pScaleWindowExt */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment