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
ac00dfc9
Commit
ac00dfc9
authored
Oct 26, 2011
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Implement the Bezier entry points in the path driver.
parent
4d9cc241
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
60 additions
and
86 deletions
+60
-86
gdi_private.h
dlls/gdi32/gdi_private.h
+0
-3
painting.c
dlls/gdi32/painting.c
+13
-21
path.c
dlls/gdi32/path.c
+47
-62
No files found.
dlls/gdi32/gdi_private.h
View file @
ac00dfc9
...
...
@@ -327,9 +327,6 @@ extern BOOL PATH_RestorePath( DC *dst, DC *src ) 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_PolyBezierTo
(
DC
*
dc
,
const
POINT
*
pt
,
DWORD
cbCount
)
DECLSPEC_HIDDEN
;
extern
BOOL
PATH_PolyBezier
(
DC
*
dc
,
const
POINT
*
pt
,
DWORD
cbCount
)
DECLSPEC_HIDDEN
;
extern
BOOL
PATH_PolyDraw
(
DC
*
dc
,
const
POINT
*
pts
,
const
BYTE
*
types
,
DWORD
cbCount
)
DECLSPEC_HIDDEN
;
extern
BOOL
PATH_PolylineTo
(
DC
*
dc
,
const
POINT
*
pt
,
DWORD
cbCount
)
DECLSPEC_HIDDEN
;
extern
BOOL
PATH_Polyline
(
DC
*
dc
,
const
POINT
*
pt
,
DWORD
cbCount
)
DECLSPEC_HIDDEN
;
extern
BOOL
PATH_Polygon
(
DC
*
dc
,
const
POINT
*
pt
,
DWORD
cbCount
)
DECLSPEC_HIDDEN
;
...
...
dlls/gdi32/painting.c
View file @
ac00dfc9
...
...
@@ -881,7 +881,8 @@ BOOL WINAPI FloodFill( HDC hdc, INT x, INT y, COLORREF color )
*/
BOOL
WINAPI
PolyBezier
(
HDC
hdc
,
const
POINT
*
lppt
,
DWORD
cPoints
)
{
BOOL
ret
=
FALSE
;
PHYSDEV
physdev
;
BOOL
ret
;
DC
*
dc
;
/* cPoints must be 3 * n + 1 (where n>=1) */
...
...
@@ -891,12 +892,8 @@ BOOL WINAPI PolyBezier( HDC hdc, const POINT* lppt, DWORD cPoints )
if
(
!
dc
)
return
FALSE
;
update_dc
(
dc
);
if
(
PATH_IsPathOpen
(
dc
->
path
))
ret
=
PATH_PolyBezier
(
dc
,
lppt
,
cPoints
);
else
{
PHYSDEV
physdev
=
GET_DC_PHYSDEV
(
dc
,
pPolyBezier
);
ret
=
physdev
->
funcs
->
pPolyBezier
(
physdev
,
lppt
,
cPoints
);
}
physdev
=
GET_DC_PHYSDEV
(
dc
,
pPolyBezier
);
ret
=
physdev
->
funcs
->
pPolyBezier
(
physdev
,
lppt
,
cPoints
);
release_dc_ptr
(
dc
);
return
ret
;
}
...
...
@@ -917,7 +914,8 @@ BOOL WINAPI PolyBezier( HDC hdc, const POINT* lppt, DWORD cPoints )
BOOL
WINAPI
PolyBezierTo
(
HDC
hdc
,
const
POINT
*
lppt
,
DWORD
cPoints
)
{
DC
*
dc
;
BOOL
ret
=
FALSE
;
BOOL
ret
;
PHYSDEV
physdev
;
/* cbPoints must be 3 * n (where n>=1) */
if
(
!
cPoints
||
(
cPoints
%
3
)
!=
0
)
return
FALSE
;
...
...
@@ -926,12 +924,9 @@ BOOL WINAPI PolyBezierTo( HDC hdc, const POINT* lppt, DWORD cPoints )
if
(
!
dc
)
return
FALSE
;
update_dc
(
dc
);
if
(
PATH_IsPathOpen
(
dc
->
path
))
ret
=
PATH_PolyBezierTo
(
dc
,
lppt
,
cPoints
);
else
{
PHYSDEV
physdev
=
GET_DC_PHYSDEV
(
dc
,
pPolyBezierTo
);
ret
=
physdev
->
funcs
->
pPolyBezierTo
(
physdev
,
lppt
,
cPoints
);
}
physdev
=
GET_DC_PHYSDEV
(
dc
,
pPolyBezierTo
);
ret
=
physdev
->
funcs
->
pPolyBezierTo
(
physdev
,
lppt
,
cPoints
);
if
(
ret
)
{
dc
->
CursPosX
=
lppt
[
cPoints
-
1
].
x
;
dc
->
CursPosY
=
lppt
[
cPoints
-
1
].
y
;
...
...
@@ -974,17 +969,14 @@ BOOL WINAPI PolyDraw(HDC hdc, const POINT *lppt, const BYTE *lpbTypes,
DWORD
cCount
)
{
DC
*
dc
=
get_dc_ptr
(
hdc
);
BOOL
result
=
FALSE
;
PHYSDEV
physdev
;
BOOL
result
;
if
(
!
dc
)
return
FALSE
;
update_dc
(
dc
);
if
(
PATH_IsPathOpen
(
dc
->
path
)
)
result
=
PATH_PolyDraw
(
dc
,
lppt
,
lpbTypes
,
cCount
);
else
{
PHYSDEV
physdev
=
GET_DC_PHYSDEV
(
dc
,
pPolyDraw
);
result
=
physdev
->
funcs
->
pPolyDraw
(
physdev
,
lppt
,
lpbTypes
,
cCount
);
}
physdev
=
GET_DC_PHYSDEV
(
dc
,
pPolyDraw
);
result
=
physdev
->
funcs
->
pPolyDraw
(
physdev
,
lppt
,
lpbTypes
,
cCount
);
release_dc_ptr
(
dc
);
return
result
;
}
...
...
dlls/gdi32/path.c
View file @
ac00dfc9
...
...
@@ -1224,75 +1224,60 @@ static BOOL pathdrv_Ellipse( PHYSDEV dev, INT x1, INT y1, INT x2, INT y2 )
}
BOOL
PATH_PolyBezierTo
(
DC
*
dc
,
const
POINT
*
pts
,
DWORD
cbPoints
)
/*************************************************************
* pathdrv_PolyBezierTo
*/
static
BOOL
pathdrv_PolyBezierTo
(
PHYSDEV
dev
,
const
POINT
*
pts
,
DWORD
cbPoints
)
{
GdiPath
*
pPath
=
&
dc
->
path
;
POINT
pt
;
UINT
i
;
/* Check that path is open */
if
(
pPath
->
state
!=
PATH_Open
)
return
FALSE
;
struct
path_physdev
*
physdev
=
get_path_physdev
(
dev
);
POINT
pt
;
UINT
i
;
/* Add a PT_MOVETO if necessary */
if
(
pPath
->
newStroke
)
{
pPath
->
newStroke
=
FALSE
;
pt
.
x
=
dc
->
CursPosX
;
pt
.
y
=
dc
->
CursPosY
;
if
(
!
LPtoDP
(
dc
->
hSelf
,
&
pt
,
1
))
return
FALSE
;
if
(
!
PATH_AddEntry
(
pPath
,
&
pt
,
PT_MOVETO
))
return
FALSE
;
}
if
(
!
start_new_stroke
(
physdev
))
return
FALSE
;
for
(
i
=
0
;
i
<
cbPoints
;
i
++
)
{
pt
=
pts
[
i
];
if
(
!
LPtoDP
(
dc
->
hSelf
,
&
pt
,
1
))
return
FALSE
;
PATH_AddEntry
(
pPath
,
&
pt
,
PT_BEZIERTO
);
}
return
TRUE
;
for
(
i
=
0
;
i
<
cbPoints
;
i
++
)
{
pt
=
pts
[
i
];
LPtoDP
(
dev
->
hdc
,
&
pt
,
1
);
PATH_AddEntry
(
physdev
->
path
,
&
pt
,
PT_BEZIERTO
);
}
return
TRUE
;
}
BOOL
PATH_PolyBezier
(
DC
*
dc
,
const
POINT
*
pts
,
DWORD
cbPoints
)
{
GdiPath
*
pPath
=
&
dc
->
path
;
POINT
pt
;
UINT
i
;
/* Check that path is open */
if
(
pPath
->
state
!=
PATH_Open
)
return
FALSE
;
/*************************************************************
* pathdrv_PolyBezier
*/
static
BOOL
pathdrv_PolyBezier
(
PHYSDEV
dev
,
const
POINT
*
pts
,
DWORD
cbPoints
)
{
struct
path_physdev
*
physdev
=
get_path_physdev
(
dev
);
POINT
pt
;
UINT
i
;
for
(
i
=
0
;
i
<
cbPoints
;
i
++
)
{
pt
=
pts
[
i
];
if
(
!
LPtoDP
(
dc
->
hSelf
,
&
pt
,
1
))
return
FALSE
;
PATH_AddEntry
(
pPath
,
&
pt
,
(
i
==
0
)
?
PT_MOVETO
:
PT_BEZIERTO
);
}
return
TRUE
;
for
(
i
=
0
;
i
<
cbPoints
;
i
++
)
{
pt
=
pts
[
i
];
LPtoDP
(
dev
->
hdc
,
&
pt
,
1
);
PATH_AddEntry
(
physdev
->
path
,
&
pt
,
(
i
==
0
)
?
PT_MOVETO
:
PT_BEZIERTO
);
}
return
TRUE
;
}
/* PATH_PolyDraw
*
* Should be called when a call to PolyDraw is performed on a DC that has
* an open path. Returns TRUE if successful, else FALSE.
/*************************************************************
* pathdrv_PolyDraw
*/
BOOL
PATH_PolyDraw
(
DC
*
dc
,
const
POINT
*
pts
,
const
BYTE
*
types
,
DWORD
cbPoints
)
static
BOOL
pathdrv_PolyDraw
(
PHYSDEV
dev
,
const
POINT
*
pts
,
const
BYTE
*
types
,
DWORD
cbPoints
)
{
GdiPath
*
pPath
=
&
dc
->
path
;
struct
path_physdev
*
physdev
=
get_path_physdev
(
dev
)
;
POINT
lastmove
,
orig_pos
;
INT
i
;
GetCurrentPositionEx
(
d
c
->
hSelf
,
&
orig_pos
);
GetCurrentPositionEx
(
d
ev
->
hdc
,
&
orig_pos
);
lastmove
=
orig_pos
;
for
(
i
=
p
P
ath
->
numEntriesUsed
-
1
;
i
>=
0
;
i
--
){
if
(
p
P
ath
->
pFlags
[
i
]
==
PT_MOVETO
){
lastmove
=
p
P
ath
->
pPoints
[
i
];
DPtoLP
(
d
c
->
hSelf
,
&
lastmove
,
1
);
for
(
i
=
p
hysdev
->
p
ath
->
numEntriesUsed
-
1
;
i
>=
0
;
i
--
){
if
(
p
hysdev
->
p
ath
->
pFlags
[
i
]
==
PT_MOVETO
){
lastmove
=
p
hysdev
->
p
ath
->
pPoints
[
i
];
DPtoLP
(
d
ev
->
hdc
,
&
lastmove
,
1
);
break
;
}
}
...
...
@@ -1302,17 +1287,17 @@ BOOL PATH_PolyDraw(DC *dc, const POINT *pts, const BYTE *types,
switch
(
types
[
i
])
{
case
PT_MOVETO
:
MoveToEx
(
d
c
->
hSelf
,
pts
[
i
].
x
,
pts
[
i
].
y
,
NULL
);
MoveToEx
(
d
ev
->
hdc
,
pts
[
i
].
x
,
pts
[
i
].
y
,
NULL
);
break
;
case
PT_LINETO
:
case
PT_LINETO
|
PT_CLOSEFIGURE
:
LineTo
(
d
c
->
hSelf
,
pts
[
i
].
x
,
pts
[
i
].
y
);
LineTo
(
d
ev
->
hdc
,
pts
[
i
].
x
,
pts
[
i
].
y
);
break
;
case
PT_BEZIERTO
:
if
((
i
+
2
<
cbPoints
)
&&
(
types
[
i
+
1
]
==
PT_BEZIERTO
)
&&
(
types
[
i
+
2
]
&
~
PT_CLOSEFIGURE
)
==
PT_BEZIERTO
)
{
PolyBezierTo
(
d
c
->
hSelf
,
&
pts
[
i
],
3
);
PolyBezierTo
(
d
ev
->
hdc
,
&
pts
[
i
],
3
);
i
+=
2
;
break
;
}
...
...
@@ -1322,14 +1307,14 @@ BOOL PATH_PolyDraw(DC *dc, const POINT *pts, const BYTE *types,
{
if
(
!
(
types
[
i
-
1
]
&
PT_CLOSEFIGURE
))
lastmove
=
pts
[
i
-
1
];
if
(
lastmove
.
x
!=
orig_pos
.
x
||
lastmove
.
y
!=
orig_pos
.
y
)
MoveToEx
(
d
c
->
hSelf
,
orig_pos
.
x
,
orig_pos
.
y
,
NULL
);
MoveToEx
(
d
ev
->
hdc
,
orig_pos
.
x
,
orig_pos
.
y
,
NULL
);
}
return
FALSE
;
}
if
(
types
[
i
]
&
PT_CLOSEFIGURE
){
p
Path
->
pFlags
[
pP
ath
->
numEntriesUsed
-
1
]
|=
PT_CLOSEFIGURE
;
MoveToEx
(
d
c
->
hSelf
,
lastmove
.
x
,
lastmove
.
y
,
NULL
);
p
hysdev
->
path
->
pFlags
[
physdev
->
p
ath
->
numEntriesUsed
-
1
]
|=
PT_CLOSEFIGURE
;
MoveToEx
(
d
ev
->
hdc
,
lastmove
.
x
,
lastmove
.
y
,
NULL
);
}
}
...
...
@@ -2374,9 +2359,9 @@ const struct gdi_dc_funcs path_driver =
NULL
,
/* pPaintRgn */
NULL
,
/* pPatBlt */
pathdrv_Pie
,
/* pPie */
NULL
,
/* pPolyBezier */
NULL
,
/* pPolyBezierTo */
NULL
,
/* pPolyDraw */
pathdrv_PolyBezier
,
/* pPolyBezier */
pathdrv_PolyBezierTo
,
/* pPolyBezierTo */
pathdrv_PolyDraw
,
/* pPolyDraw */
NULL
,
/* pPolyPolygon */
NULL
,
/* pPolyPolyline */
NULL
,
/* pPolygon */
...
...
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