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
84f549b6
Commit
84f549b6
authored
Sep 12, 2011
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winex11: Pass an HDC to the size mapping functions.
parent
b174bde4
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
23 additions
and
23 deletions
+23
-23
graphics.c
dlls/winex11.drv/graphics.c
+4
-4
pen.c
dlls/winex11.drv/pen.c
+1
-1
x11drv.h
dlls/winex11.drv/x11drv.h
+2
-2
xfont.c
dlls/winex11.drv/xfont.c
+2
-2
xrender.c
dlls/winex11.drv/xrender.c
+14
-14
No files found.
dlls/winex11.drv/graphics.c
View file @
84f549b6
...
...
@@ -473,7 +473,7 @@ BOOL X11DRV_SetupGCForText( X11DRV_PDEVICE *physDev )
*
* Performs a world-to-viewport transformation on the specified width.
*/
INT
X11DRV_XWStoDS
(
X11DRV_PDEVICE
*
physDev
,
INT
width
)
INT
X11DRV_XWStoDS
(
HDC
hdc
,
INT
width
)
{
POINT
pt
[
2
];
...
...
@@ -481,7 +481,7 @@ INT X11DRV_XWStoDS( X11DRV_PDEVICE *physDev, INT width )
pt
[
0
].
y
=
0
;
pt
[
1
].
x
=
width
;
pt
[
1
].
y
=
0
;
LPtoDP
(
physDev
->
dev
.
hdc
,
pt
,
2
);
LPtoDP
(
hdc
,
pt
,
2
);
return
pt
[
1
].
x
-
pt
[
0
].
x
;
}
...
...
@@ -490,7 +490,7 @@ INT X11DRV_XWStoDS( X11DRV_PDEVICE *physDev, INT width )
*
* Performs a world-to-viewport transformation on the specified height.
*/
INT
X11DRV_YWStoDS
(
X11DRV_PDEVICE
*
physDev
,
INT
height
)
INT
X11DRV_YWStoDS
(
HDC
hdc
,
INT
height
)
{
POINT
pt
[
2
];
...
...
@@ -498,7 +498,7 @@ INT X11DRV_YWStoDS( X11DRV_PDEVICE *physDev, INT height )
pt
[
0
].
y
=
0
;
pt
[
1
].
x
=
0
;
pt
[
1
].
y
=
height
;
LPtoDP
(
physDev
->
dev
.
hdc
,
pt
,
2
);
LPtoDP
(
hdc
,
pt
,
2
);
return
pt
[
1
].
y
-
pt
[
0
].
y
;
}
...
...
dlls/winex11.drv/pen.c
View file @
84f549b6
...
...
@@ -74,7 +74,7 @@ HPEN X11DRV_SelectPen( PHYSDEV dev, HPEN hpen )
physDev
->
pen
.
width
=
logpen
.
lopnWidth
.
x
;
if
((
logpen
.
lopnStyle
&
PS_GEOMETRIC
)
||
(
physDev
->
pen
.
width
>=
1
))
{
physDev
->
pen
.
width
=
X11DRV_XWStoDS
(
physDev
,
physDev
->
pen
.
width
);
physDev
->
pen
.
width
=
X11DRV_XWStoDS
(
dev
->
hdc
,
physDev
->
pen
.
width
);
if
(
physDev
->
pen
.
width
<
0
)
physDev
->
pen
.
width
=
-
physDev
->
pen
.
width
;
}
...
...
dlls/winex11.drv/x11drv.h
View file @
84f549b6
...
...
@@ -286,8 +286,8 @@ extern void restore_clipping_region( X11DRV_PDEVICE *dev, HRGN rgn ) DECLSPEC_HI
extern
BOOL
X11DRV_SetupGCForPatBlt
(
X11DRV_PDEVICE
*
physDev
,
GC
gc
,
BOOL
fMapColors
)
DECLSPEC_HIDDEN
;
extern
BOOL
X11DRV_SetupGCForBrush
(
X11DRV_PDEVICE
*
physDev
)
DECLSPEC_HIDDEN
;
extern
BOOL
X11DRV_SetupGCForText
(
X11DRV_PDEVICE
*
physDev
)
DECLSPEC_HIDDEN
;
extern
INT
X11DRV_XWStoDS
(
X11DRV_PDEVICE
*
physDev
,
INT
width
)
DECLSPEC_HIDDEN
;
extern
INT
X11DRV_YWStoDS
(
X11DRV_PDEVICE
*
physDev
,
INT
height
)
DECLSPEC_HIDDEN
;
extern
INT
X11DRV_XWStoDS
(
HDC
hdc
,
INT
width
)
DECLSPEC_HIDDEN
;
extern
INT
X11DRV_YWStoDS
(
HDC
hdc
,
INT
height
)
DECLSPEC_HIDDEN
;
extern
const
int
X11DRV_XROPfunction
[];
...
...
dlls/winex11.drv/xfont.c
View file @
84f549b6
...
...
@@ -3254,14 +3254,14 @@ HFONT X11DRV_SelectFont( PHYSDEV dev, HFONT hfont, HANDLE gdiFont )
/* FIXME - check that the other drivers do this correctly */
if
(
lf
.
lfWidth
)
{
INT
width
=
X11DRV_XWStoDS
(
physDev
,
lf
.
lfWidth
);
INT
width
=
X11DRV_XWStoDS
(
dev
->
hdc
,
lf
.
lfWidth
);
lf
.
lfWidth
=
(
lf
.
lfWidth
<
0
)
?
-
abs
(
width
)
:
abs
(
width
);
if
(
lf
.
lfWidth
==
0
)
lf
.
lfWidth
=
1
;
/* Minimum width */
}
if
(
lf
.
lfHeight
)
{
INT
height
=
X11DRV_YWStoDS
(
physDev
,
lf
.
lfHeight
);
INT
height
=
X11DRV_YWStoDS
(
dev
->
hdc
,
lf
.
lfHeight
);
lf
.
lfHeight
=
(
lf
.
lfHeight
<
0
)
?
-
abs
(
height
)
:
abs
(
height
);
if
(
lf
.
lfHeight
==
0
)
lf
.
lfHeight
=
MIN_FONT_SIZE
;
...
...
dlls/winex11.drv/xrender.c
View file @
84f549b6
...
...
@@ -828,7 +828,7 @@ static int AllocEntry(void)
return
mru
;
}
static
BOOL
get_gasp_flags
(
struct
xrender_physdev
*
physDev
,
WORD
*
flags
)
static
BOOL
get_gasp_flags
(
HDC
hdc
,
WORD
*
flags
)
{
DWORD
size
;
WORD
*
gasp
,
*
buffer
;
...
...
@@ -838,15 +838,15 @@ static BOOL get_gasp_flags(struct xrender_physdev *physDev, WORD *flags)
*
flags
=
0
;
size
=
GetFontData
(
physDev
->
dev
.
hdc
,
MS_GASP_TAG
,
0
,
NULL
,
0
);
size
=
GetFontData
(
hdc
,
MS_GASP_TAG
,
0
,
NULL
,
0
);
if
(
size
==
GDI_ERROR
)
return
FALSE
;
gasp
=
buffer
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
);
GetFontData
(
physDev
->
dev
.
hdc
,
MS_GASP_TAG
,
0
,
gasp
,
size
);
GetFontData
(
hdc
,
MS_GASP_TAG
,
0
,
gasp
,
size
);
GetTextMetricsW
(
physDev
->
dev
.
hdc
,
&
tm
);
ppem
=
abs
(
X11DRV_YWStoDS
(
physDev
->
x11dev
,
tm
.
tmAscent
+
tm
.
tmDescent
-
tm
.
tmInternalLeading
));
GetTextMetricsW
(
hdc
,
&
tm
);
ppem
=
abs
(
X11DRV_YWStoDS
(
hdc
,
tm
.
tmAscent
+
tm
.
tmDescent
-
tm
.
tmInternalLeading
));
gasp
++
;
num_recs
=
get_be_word
(
*
gasp
);
...
...
@@ -864,7 +864,7 @@ static BOOL get_gasp_flags(struct xrender_physdev *physDev, WORD *flags)
return
TRUE
;
}
static
AA_Type
get_antialias_type
(
struct
xrender_physdev
*
physDev
,
BOOL
subpixel
,
BOOL
hinter
)
static
AA_Type
get_antialias_type
(
HDC
hdc
,
BOOL
subpixel
,
BOOL
hinter
)
{
AA_Type
ret
;
WORD
flags
;
...
...
@@ -887,7 +887,7 @@ static AA_Type get_antialias_type( struct xrender_physdev *physDev, BOOL subpixe
But, Wine's subpixel rendering can support the portrait mode.
*/
}
else
if
(
!
hinter
||
!
get_gasp_flags
(
physDev
,
&
flags
)
||
flags
&
GASP_DOGRAY
)
else
if
(
!
hinter
||
!
get_gasp_flags
(
hdc
,
&
flags
)
||
flags
&
GASP_DOGRAY
)
ret
=
AA_Grey
;
else
ret
=
AA_None
;
...
...
@@ -895,7 +895,7 @@ static AA_Type get_antialias_type( struct xrender_physdev *physDev, BOOL subpixe
return
ret
;
}
static
int
GetCacheEntry
(
struct
xrender_physdev
*
physDev
,
LFANDSIZE
*
plfsz
)
static
int
GetCacheEntry
(
HDC
hdc
,
LFANDSIZE
*
plfsz
)
{
int
ret
;
int
format
;
...
...
@@ -926,11 +926,11 @@ static int GetCacheEntry(struct xrender_physdev *physDev, LFANDSIZE *plfsz)
switch
(
plfsz
->
lf
.
lfQuality
)
{
case
ANTIALIASED_QUALITY
:
entry
->
aa_default
=
get_antialias_type
(
physDev
,
FALSE
,
hinter
);
entry
->
aa_default
=
get_antialias_type
(
hdc
,
FALSE
,
hinter
);
return
ret
;
/* ignore further configuration */
case
CLEARTYPE_QUALITY
:
case
CLEARTYPE_NATURAL_QUALITY
:
entry
->
aa_default
=
get_antialias_type
(
physDev
,
subpixel
,
hinter
);
entry
->
aa_default
=
get_antialias_type
(
hdc
,
subpixel
,
hinter
);
break
;
case
DEFAULT_QUALITY
:
case
DRAFT_QUALITY
:
...
...
@@ -939,7 +939,7 @@ static int GetCacheEntry(struct xrender_physdev *physDev, LFANDSIZE *plfsz)
if
(
SystemParametersInfoW
(
SPI_GETFONTSMOOTHING
,
0
,
&
font_smoothing
,
0
)
&&
font_smoothing
)
{
entry
->
aa_default
=
get_antialias_type
(
physDev
,
subpixel
,
hinter
);
entry
->
aa_default
=
get_antialias_type
(
hdc
,
subpixel
,
hinter
);
}
else
entry
->
aa_default
=
AA_None
;
...
...
@@ -1111,8 +1111,8 @@ static HFONT xrenderdrv_SelectFont( PHYSDEV dev, HFONT hfont, HANDLE gdiFont )
lfsz
.
lf
.
lfHeight
,
lfsz
.
lf
.
lfWidth
,
lfsz
.
lf
.
lfWeight
,
lfsz
.
lf
.
lfItalic
,
lfsz
.
lf
.
lfCharSet
,
debugstr_w
(
lfsz
.
lf
.
lfFaceName
));
lfsz
.
lf
.
lfWidth
=
abs
(
lfsz
.
lf
.
lfWidth
);
lfsz
.
devsize
.
cx
=
X11DRV_XWStoDS
(
physdev
->
x11dev
,
lfsz
.
lf
.
lfWidth
);
lfsz
.
devsize
.
cy
=
X11DRV_YWStoDS
(
physdev
->
x11dev
,
lfsz
.
lf
.
lfHeight
);
lfsz
.
devsize
.
cx
=
X11DRV_XWStoDS
(
dev
->
hdc
,
lfsz
.
lf
.
lfWidth
);
lfsz
.
devsize
.
cy
=
X11DRV_YWStoDS
(
dev
->
hdc
,
lfsz
.
lf
.
lfHeight
);
GetTransform
(
dev
->
hdc
,
0x204
,
&
lfsz
.
xform
);
TRACE
(
"font transform %f %f %f %f
\n
"
,
lfsz
.
xform
.
eM11
,
lfsz
.
xform
.
eM12
,
...
...
@@ -1126,7 +1126,7 @@ static HFONT xrenderdrv_SelectFont( PHYSDEV dev, HFONT hfont, HANDLE gdiFont )
EnterCriticalSection
(
&
xrender_cs
);
if
(
physdev
->
info
.
cache_index
!=
-
1
)
dec_ref_cache
(
physdev
->
info
.
cache_index
);
physdev
->
info
.
cache_index
=
GetCacheEntry
(
physdev
,
&
lfsz
);
physdev
->
info
.
cache_index
=
GetCacheEntry
(
dev
->
hdc
,
&
lfsz
);
LeaveCriticalSection
(
&
xrender_cs
);
physdev
->
x11dev
->
has_gdi_font
=
TRUE
;
return
0
;
...
...
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