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
9efe66a8
Commit
9efe66a8
authored
Jul 27, 2016
by
Huw Davies
Committed by
Alexandre Julliard
Jul 27, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Use lp_to_dp() instead of LPtoDP() in the dib driver.
Signed-off-by:
Huw Davies
<
huw@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
7fa6dfec
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
11 deletions
+18
-11
bitblt.c
dlls/gdi32/dibdrv/bitblt.c
+2
-1
graphics.c
dlls/gdi32/dibdrv/graphics.c
+12
-7
objects.c
dlls/gdi32/dibdrv/objects.c
+4
-3
No files found.
dlls/gdi32/dibdrv/bitblt.c
View file @
9efe66a8
...
@@ -1416,6 +1416,7 @@ BOOL dibdrv_GradientFill( PHYSDEV dev, TRIVERTEX *vert_array, ULONG nvert,
...
@@ -1416,6 +1416,7 @@ BOOL dibdrv_GradientFill( PHYSDEV dev, TRIVERTEX *vert_array, ULONG nvert,
void
*
grad_array
,
ULONG
ngrad
,
ULONG
mode
)
void
*
grad_array
,
ULONG
ngrad
,
ULONG
mode
)
{
{
dibdrv_physdev
*
pdev
=
get_dibdrv_pdev
(
dev
);
dibdrv_physdev
*
pdev
=
get_dibdrv_pdev
(
dev
);
DC
*
dc
=
get_physdev_dc
(
dev
);
const
GRADIENT_TRIANGLE
*
tri
=
grad_array
;
const
GRADIENT_TRIANGLE
*
tri
=
grad_array
;
const
GRADIENT_RECT
*
rect
=
grad_array
;
const
GRADIENT_RECT
*
rect
=
grad_array
;
unsigned
int
i
;
unsigned
int
i
;
...
@@ -1430,7 +1431,7 @@ BOOL dibdrv_GradientFill( PHYSDEV dev, TRIVERTEX *vert_array, ULONG nvert,
...
@@ -1430,7 +1431,7 @@ BOOL dibdrv_GradientFill( PHYSDEV dev, TRIVERTEX *vert_array, ULONG nvert,
pts
[
i
].
x
=
vert_array
[
i
].
x
;
pts
[
i
].
x
=
vert_array
[
i
].
x
;
pts
[
i
].
y
=
vert_array
[
i
].
y
;
pts
[
i
].
y
=
vert_array
[
i
].
y
;
}
}
LPtoDP
(
dev
->
h
dc
,
pts
,
nvert
);
lp_to_dp
(
dc
,
pts
,
nvert
);
switch
(
mode
)
switch
(
mode
)
{
{
...
...
dlls/gdi32/dibdrv/graphics.c
View file @
9efe66a8
...
@@ -1097,6 +1097,7 @@ COLORREF dibdrv_GetNearestColor( PHYSDEV dev, COLORREF color )
...
@@ -1097,6 +1097,7 @@ COLORREF dibdrv_GetNearestColor( PHYSDEV dev, COLORREF color )
COLORREF
dibdrv_GetPixel
(
PHYSDEV
dev
,
INT
x
,
INT
y
)
COLORREF
dibdrv_GetPixel
(
PHYSDEV
dev
,
INT
x
,
INT
y
)
{
{
dibdrv_physdev
*
pdev
=
get_dibdrv_pdev
(
dev
);
dibdrv_physdev
*
pdev
=
get_dibdrv_pdev
(
dev
);
DC
*
dc
=
get_physdev_dc
(
dev
);
POINT
pt
;
POINT
pt
;
DWORD
pixel
;
DWORD
pixel
;
...
@@ -1104,7 +1105,7 @@ COLORREF dibdrv_GetPixel( PHYSDEV dev, INT x, INT y )
...
@@ -1104,7 +1105,7 @@ COLORREF dibdrv_GetPixel( PHYSDEV dev, INT x, INT y )
pt
.
x
=
x
;
pt
.
x
=
x
;
pt
.
y
=
y
;
pt
.
y
=
y
;
LPtoDP
(
dev
->
h
dc
,
&
pt
,
1
);
lp_to_dp
(
dc
,
&
pt
,
1
);
if
(
pt
.
x
<
0
||
pt
.
x
>=
pdev
->
dib
.
rect
.
right
-
pdev
->
dib
.
rect
.
left
||
if
(
pt
.
x
<
0
||
pt
.
x
>=
pdev
->
dib
.
rect
.
right
-
pdev
->
dib
.
rect
.
left
||
pt
.
y
<
0
||
pt
.
y
>=
pdev
->
dib
.
rect
.
bottom
-
pdev
->
dib
.
rect
.
top
)
pt
.
y
<
0
||
pt
.
y
>=
pdev
->
dib
.
rect
.
bottom
-
pdev
->
dib
.
rect
.
top
)
...
@@ -1120,15 +1121,16 @@ COLORREF dibdrv_GetPixel( PHYSDEV dev, INT x, INT y )
...
@@ -1120,15 +1121,16 @@ COLORREF dibdrv_GetPixel( PHYSDEV dev, INT x, INT y )
BOOL
dibdrv_LineTo
(
PHYSDEV
dev
,
INT
x
,
INT
y
)
BOOL
dibdrv_LineTo
(
PHYSDEV
dev
,
INT
x
,
INT
y
)
{
{
dibdrv_physdev
*
pdev
=
get_dibdrv_pdev
(
dev
);
dibdrv_physdev
*
pdev
=
get_dibdrv_pdev
(
dev
);
DC
*
dc
=
get_physdev_dc
(
dev
);
POINT
pts
[
2
];
POINT
pts
[
2
];
HRGN
region
=
0
;
HRGN
region
=
0
;
BOOL
ret
;
BOOL
ret
;
GetCurrentPositionEx
(
dev
->
hdc
,
pts
)
;
pts
[
0
]
=
dc
->
cur_pos
;
pts
[
1
].
x
=
x
;
pts
[
1
].
x
=
x
;
pts
[
1
].
y
=
y
;
pts
[
1
].
y
=
y
;
LPtoDP
(
dev
->
h
dc
,
pts
,
2
);
lp_to_dp
(
dc
,
pts
,
2
);
if
(
pdev
->
pen_uses_region
&&
!
(
region
=
CreateRectRgn
(
0
,
0
,
0
,
0
)))
return
FALSE
;
if
(
pdev
->
pen_uses_region
&&
!
(
region
=
CreateRectRgn
(
0
,
0
,
0
,
0
)))
return
FALSE
;
...
@@ -1229,6 +1231,7 @@ BOOL dibdrv_PaintRgn( PHYSDEV dev, HRGN rgn )
...
@@ -1229,6 +1231,7 @@ BOOL dibdrv_PaintRgn( PHYSDEV dev, HRGN rgn )
BOOL
dibdrv_PolyPolygon
(
PHYSDEV
dev
,
const
POINT
*
pt
,
const
INT
*
counts
,
DWORD
polygons
)
BOOL
dibdrv_PolyPolygon
(
PHYSDEV
dev
,
const
POINT
*
pt
,
const
INT
*
counts
,
DWORD
polygons
)
{
{
dibdrv_physdev
*
pdev
=
get_dibdrv_pdev
(
dev
);
dibdrv_physdev
*
pdev
=
get_dibdrv_pdev
(
dev
);
DC
*
dc
=
get_physdev_dc
(
dev
);
DWORD
total
,
i
,
pos
;
DWORD
total
,
i
,
pos
;
BOOL
ret
=
TRUE
;
BOOL
ret
=
TRUE
;
POINT
*
points
;
POINT
*
points
;
...
@@ -1243,10 +1246,10 @@ BOOL dibdrv_PolyPolygon( PHYSDEV dev, const POINT *pt, const INT *counts, DWORD
...
@@ -1243,10 +1246,10 @@ BOOL dibdrv_PolyPolygon( PHYSDEV dev, const POINT *pt, const INT *counts, DWORD
points
=
HeapAlloc
(
GetProcessHeap
(),
0
,
total
*
sizeof
(
*
pt
)
);
points
=
HeapAlloc
(
GetProcessHeap
(),
0
,
total
*
sizeof
(
*
pt
)
);
if
(
!
points
)
return
FALSE
;
if
(
!
points
)
return
FALSE
;
memcpy
(
points
,
pt
,
total
*
sizeof
(
*
pt
)
);
memcpy
(
points
,
pt
,
total
*
sizeof
(
*
pt
)
);
LPtoDP
(
dev
->
h
dc
,
points
,
total
);
lp_to_dp
(
dc
,
points
,
total
);
if
(
pdev
->
brush
.
style
!=
BS_NULL
&&
if
(
pdev
->
brush
.
style
!=
BS_NULL
&&
!
(
interior
=
CreatePolyPolygonRgn
(
points
,
counts
,
polygons
,
GetPolyFillMode
(
dev
->
hdc
)
)))
!
(
interior
=
CreatePolyPolygonRgn
(
points
,
counts
,
polygons
,
dc
->
polyFillMode
)))
{
{
HeapFree
(
GetProcessHeap
(),
0
,
points
);
HeapFree
(
GetProcessHeap
(),
0
,
points
);
return
FALSE
;
return
FALSE
;
...
@@ -1291,6 +1294,7 @@ BOOL dibdrv_PolyPolygon( PHYSDEV dev, const POINT *pt, const INT *counts, DWORD
...
@@ -1291,6 +1294,7 @@ BOOL dibdrv_PolyPolygon( PHYSDEV dev, const POINT *pt, const INT *counts, DWORD
BOOL
dibdrv_PolyPolyline
(
PHYSDEV
dev
,
const
POINT
*
pt
,
const
DWORD
*
counts
,
DWORD
polylines
)
BOOL
dibdrv_PolyPolyline
(
PHYSDEV
dev
,
const
POINT
*
pt
,
const
DWORD
*
counts
,
DWORD
polylines
)
{
{
dibdrv_physdev
*
pdev
=
get_dibdrv_pdev
(
dev
);
dibdrv_physdev
*
pdev
=
get_dibdrv_pdev
(
dev
);
DC
*
dc
=
get_physdev_dc
(
dev
);
DWORD
total
,
pos
,
i
;
DWORD
total
,
pos
,
i
;
POINT
*
points
;
POINT
*
points
;
BOOL
ret
=
TRUE
;
BOOL
ret
=
TRUE
;
...
@@ -1305,7 +1309,7 @@ BOOL dibdrv_PolyPolyline( PHYSDEV dev, const POINT* pt, const DWORD* counts, DWO
...
@@ -1305,7 +1309,7 @@ BOOL dibdrv_PolyPolyline( PHYSDEV dev, const POINT* pt, const DWORD* counts, DWO
points
=
HeapAlloc
(
GetProcessHeap
(),
0
,
total
*
sizeof
(
*
pt
)
);
points
=
HeapAlloc
(
GetProcessHeap
(),
0
,
total
*
sizeof
(
*
pt
)
);
if
(
!
points
)
return
FALSE
;
if
(
!
points
)
return
FALSE
;
memcpy
(
points
,
pt
,
total
*
sizeof
(
*
pt
)
);
memcpy
(
points
,
pt
,
total
*
sizeof
(
*
pt
)
);
LPtoDP
(
dev
->
h
dc
,
points
,
total
);
lp_to_dp
(
dc
,
points
,
total
);
if
(
pdev
->
pen_uses_region
&&
!
(
outline
=
CreateRectRgn
(
0
,
0
,
0
,
0
)))
if
(
pdev
->
pen_uses_region
&&
!
(
outline
=
CreateRectRgn
(
0
,
0
,
0
,
0
)))
{
{
...
@@ -1555,6 +1559,7 @@ BOOL dibdrv_Pie( PHYSDEV dev, INT left, INT top, INT right, INT bottom,
...
@@ -1555,6 +1559,7 @@ BOOL dibdrv_Pie( PHYSDEV dev, INT left, INT top, INT right, INT bottom,
COLORREF
dibdrv_SetPixel
(
PHYSDEV
dev
,
INT
x
,
INT
y
,
COLORREF
color
)
COLORREF
dibdrv_SetPixel
(
PHYSDEV
dev
,
INT
x
,
INT
y
,
COLORREF
color
)
{
{
dibdrv_physdev
*
pdev
=
get_dibdrv_pdev
(
dev
);
dibdrv_physdev
*
pdev
=
get_dibdrv_pdev
(
dev
);
DC
*
dc
=
get_physdev_dc
(
dev
);
struct
clipped_rects
clipped_rects
;
struct
clipped_rects
clipped_rects
;
RECT
rect
;
RECT
rect
;
POINT
pt
;
POINT
pt
;
...
@@ -1564,7 +1569,7 @@ COLORREF dibdrv_SetPixel( PHYSDEV dev, INT x, INT y, COLORREF color )
...
@@ -1564,7 +1569,7 @@ COLORREF dibdrv_SetPixel( PHYSDEV dev, INT x, INT y, COLORREF color )
pt
.
x
=
x
;
pt
.
x
=
x
;
pt
.
y
=
y
;
pt
.
y
=
y
;
LPtoDP
(
dev
->
h
dc
,
&
pt
,
1
);
lp_to_dp
(
dc
,
&
pt
,
1
);
rect
.
left
=
pt
.
x
;
rect
.
left
=
pt
.
x
;
rect
.
top
=
pt
.
y
;
rect
.
top
=
pt
.
y
;
rect
.
right
=
rect
.
left
+
1
;
rect
.
right
=
rect
.
left
+
1
;
...
...
dlls/gdi32/dibdrv/objects.c
View file @
9efe66a8
...
@@ -1726,14 +1726,14 @@ static inline void scale_dash_pattern( dash_pattern *pattern, DWORD scale, DWORD
...
@@ -1726,14 +1726,14 @@ static inline void scale_dash_pattern( dash_pattern *pattern, DWORD scale, DWORD
}
}
}
}
static
inline
int
get_pen_device_width
(
dibdrv_physdev
*
pdev
,
int
width
)
static
inline
int
get_pen_device_width
(
DC
*
dc
,
int
width
)
{
{
POINT
pts
[
2
];
POINT
pts
[
2
];
if
(
!
width
)
return
1
;
if
(
!
width
)
return
1
;
pts
[
0
].
x
=
pts
[
0
].
y
=
pts
[
1
].
y
=
0
;
pts
[
0
].
x
=
pts
[
0
].
y
=
pts
[
1
].
y
=
0
;
pts
[
1
].
x
=
width
;
pts
[
1
].
x
=
width
;
LPtoDP
(
pdev
->
dev
.
h
dc
,
pts
,
2
);
lp_to_dp
(
dc
,
pts
,
2
);
width
=
floor
(
hypot
(
pts
[
1
].
x
-
pts
[
0
].
x
,
pts
[
1
].
y
-
pts
[
0
].
y
));
width
=
floor
(
hypot
(
pts
[
1
].
x
-
pts
[
0
].
x
,
pts
[
1
].
y
-
pts
[
0
].
y
));
return
max
(
width
,
1
);
return
max
(
width
,
1
);
}
}
...
@@ -2113,6 +2113,7 @@ HBRUSH dibdrv_SelectBrush( PHYSDEV dev, HBRUSH hbrush, const struct brush_patter
...
@@ -2113,6 +2113,7 @@ HBRUSH dibdrv_SelectBrush( PHYSDEV dev, HBRUSH hbrush, const struct brush_patter
HPEN
dibdrv_SelectPen
(
PHYSDEV
dev
,
HPEN
hpen
,
const
struct
brush_pattern
*
pattern
)
HPEN
dibdrv_SelectPen
(
PHYSDEV
dev
,
HPEN
hpen
,
const
struct
brush_pattern
*
pattern
)
{
{
dibdrv_physdev
*
pdev
=
get_dibdrv_pdev
(
dev
);
dibdrv_physdev
*
pdev
=
get_dibdrv_pdev
(
dev
);
DC
*
dc
=
get_physdev_dc
(
dev
);
LOGPEN
logpen
;
LOGPEN
logpen
;
LOGBRUSH
logbrush
;
LOGBRUSH
logbrush
;
EXTLOGPEN
*
elp
=
NULL
;
EXTLOGPEN
*
elp
=
NULL
;
...
@@ -2147,7 +2148,7 @@ HPEN dibdrv_SelectPen( PHYSDEV dev, HPEN hpen, const struct brush_pattern *patte
...
@@ -2147,7 +2148,7 @@ HPEN dibdrv_SelectPen( PHYSDEV dev, HPEN hpen, const struct brush_pattern *patte
pdev
->
pen_join
=
logpen
.
lopnStyle
&
PS_JOIN_MASK
;
pdev
->
pen_join
=
logpen
.
lopnStyle
&
PS_JOIN_MASK
;
pdev
->
pen_endcap
=
logpen
.
lopnStyle
&
PS_ENDCAP_MASK
;
pdev
->
pen_endcap
=
logpen
.
lopnStyle
&
PS_ENDCAP_MASK
;
pdev
->
pen_width
=
get_pen_device_width
(
pdev
,
logpen
.
lopnWidth
.
x
);
pdev
->
pen_width
=
get_pen_device_width
(
dc
,
logpen
.
lopnWidth
.
x
);
if
(
hpen
==
GetStockObject
(
DC_PEN
))
if
(
hpen
==
GetStockObject
(
DC_PEN
))
logbrush
.
lbColor
=
GetDCPenColor
(
dev
->
hdc
);
logbrush
.
lbColor
=
GetDCPenColor
(
dev
->
hdc
);
...
...
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