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
ccc034c2
Commit
ccc034c2
authored
Oct 31, 2012
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Store the anti-aliasing flags in the DC when selecting a font.
parent
6164d533
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
17 deletions
+16
-17
graphics.c
dlls/gdi32/dibdrv/graphics.c
+4
-4
font.c
dlls/gdi32/font.c
+8
-12
freetype.c
dlls/gdi32/freetype.c
+2
-0
gdi_private.h
dlls/gdi32/gdi_private.h
+2
-1
No files found.
dlls/gdi32/dibdrv/graphics.c
View file @
ccc034c2
...
...
@@ -665,7 +665,7 @@ BOOL dibdrv_ExtTextOut( PHYSDEV dev, INT x, INT y, UINT flags,
{
dibdrv_physdev
*
pdev
=
get_dibdrv_pdev
(
dev
);
struct
clipped_rects
clipped_rects
;
UINT
aa_flags
;
DC
*
dc
;
RECT
bounds
;
DWORD
text_color
;
struct
intensity_range
ranges
[
17
];
...
...
@@ -700,10 +700,10 @@ BOOL dibdrv_ExtTextOut( PHYSDEV dev, INT x, INT y, UINT flags,
text_color
=
get_pixel_color
(
pdev
,
GetTextColor
(
pdev
->
dev
.
hdc
),
TRUE
);
get_aa_ranges
(
pdev
->
dib
.
funcs
->
pixel_to_colorref
(
&
pdev
->
dib
,
text_color
),
ranges
);
aa_flags
=
get_font_aa_flags
(
dev
->
hdc
);
render_string
(
dev
->
hdc
,
&
pdev
->
dib
,
x
,
y
,
flags
,
aa_flags
,
str
,
count
,
dx
,
dc
=
get_dc_ptr
(
dev
->
hdc
);
render_string
(
dev
->
hdc
,
&
pdev
->
dib
,
x
,
y
,
flags
,
dc
->
aa_flags
,
str
,
count
,
dx
,
text_color
,
ranges
,
&
clipped_rects
,
&
bounds
);
release_dc_ptr
(
dc
);
done:
add_clipped_bounds
(
pdev
,
&
bounds
,
pdev
->
clip
);
...
...
dlls/gdi32/font.c
View file @
ccc034c2
...
...
@@ -390,9 +390,8 @@ static UINT get_subpixel_orientation( void )
return
GGO_GRAY4_BITMAP
;
}
UINT
get_font_aa_flags
(
HDC
hdc
)
UINT
get_font_aa_flags
(
HDC
hdc
,
const
LOGFONTW
*
lf
)
{
LOGFONTW
lf
;
WORD
gasp_flags
;
static
int
hinter
=
-
1
;
static
int
subpixel_enabled
=
-
1
;
...
...
@@ -406,9 +405,6 @@ UINT get_font_aa_flags( HDC hdc )
}
else
if
(
GetDeviceCaps
(
hdc
,
BITSPIXEL
)
<=
8
)
return
GGO_BITMAP
;
GetObjectW
(
GetCurrentObject
(
hdc
,
OBJ_FONT
),
sizeof
(
lf
),
&
lf
);
if
(
lf
.
lfQuality
==
NONANTIALIASED_QUALITY
)
return
GGO_BITMAP
;
if
(
hinter
==
-
1
||
subpixel_enabled
==
-
1
)
{
RASTERIZER_STATUS
status
;
...
...
@@ -417,8 +413,10 @@ UINT get_font_aa_flags( HDC hdc )
subpixel_enabled
=
status
.
wFlags
&
WINE_TT_SUBPIXEL_RENDERING_ENABLED
;
}
switch
(
lf
.
lfQuality
)
switch
(
lf
->
lfQuality
)
{
case
NONANTIALIASED_QUALITY
:
return
GGO_BITMAP
;
case
ANTIALIASED_QUALITY
:
smoothing
=
aa_smoothing
;
break
;
...
...
@@ -731,6 +729,7 @@ static HGDIOBJ FONT_SelectObject( HGDIOBJ handle, HDC hdc )
{
ret
=
dc
->
hFont
;
dc
->
hFont
=
handle
;
dc
->
aa_flags
=
aa_flags
?
aa_flags
:
GGO_BITMAP
;
update_font_code_page
(
dc
);
GDI_dec_ref_count
(
ret
);
}
...
...
@@ -1948,7 +1947,7 @@ BOOL nulldrv_ExtTextOut( PHYSDEV dev, INT x, INT y, UINT flags, const RECT *rect
LPCWSTR
str
,
UINT
count
,
const
INT
*
dx
)
{
DC
*
dc
=
get_nulldrv_dc
(
dev
);
UINT
aa_flags
,
i
;
UINT
i
;
DWORD
err
;
HGDIOBJ
orig
;
HPEN
pen
;
...
...
@@ -1970,18 +1969,15 @@ BOOL nulldrv_ExtTextOut( PHYSDEV dev, INT x, INT y, UINT flags, const RECT *rect
if
(
!
count
)
return
TRUE
;
aa_flags
=
get_font_aa_flags
(
dev
->
hdc
);
if
(
aa_flags
!=
GGO_BITMAP
)
if
(
dc
->
aa_flags
!=
GGO_BITMAP
)
{
char
buffer
[
FIELD_OFFSET
(
BITMAPINFO
,
bmiColors
[
256
]
)];
BITMAPINFO
*
info
=
(
BITMAPINFO
*
)
buffer
;
struct
gdi_image_bits
bits
;
struct
bitblt_coords
src
,
dst
;
PHYSDEV
dst_dev
;
/* FIXME Subpixel modes */
aa_flags
=
GGO_GRAY4_BITMAP
;
UINT
aa_flags
=
GGO_GRAY4_BITMAP
;
dst_dev
=
GET_DC_PHYSDEV
(
dc
,
pPutImage
);
src
.
visrect
=
get_total_extents
(
dev
->
hdc
,
x
,
y
,
flags
,
aa_flags
,
str
,
count
,
dx
);
...
...
dlls/gdi32/freetype.c
View file @
ccc034c2
...
...
@@ -4459,6 +4459,8 @@ static HFONT freetype_SelectFont( PHYSDEV dev, HFONT hfont, UINT *aa_flags )
GetObjectW
(
hfont
,
sizeof
(
lf
),
&
lf
);
lf
.
lfWidth
=
abs
(
lf
.
lfWidth
);
if
(
!*
aa_flags
)
*
aa_flags
=
get_font_aa_flags
(
dev
->
hdc
,
&
lf
);
can_use_bitmap
=
GetDeviceCaps
(
dev
->
hdc
,
TEXTCAPS
)
&
TC_RA_ABLE
;
TRACE
(
"%s, h=%d, it=%d, weight=%d, PandF=%02x, charset=%d orient %d escapement %d
\n
"
,
...
...
dlls/gdi32/gdi_private.h
View file @
ccc034c2
...
...
@@ -88,6 +88,7 @@ typedef struct tagDC
RECT
vis_rect
;
/* visible rectangle in screen coords */
RECT
device_rect
;
/* rectangle for the whole device */
int
pixel_format
;
/* pixel format (for memory DCs) */
UINT
aa_flags
;
/* anti-aliasing flags to pass to GetGlyphOutline for current font */
FLOAT
miterLimit
;
int
flags
;
...
...
@@ -278,7 +279,7 @@ extern BOOL DRIVER_GetDriverName( LPCWSTR device, LPWSTR driver, DWORD size ) DE
extern
HENHMETAFILE
EMF_Create_HENHMETAFILE
(
ENHMETAHEADER
*
emh
,
BOOL
on_disk
)
DECLSPEC_HIDDEN
;
/* font.c */
extern
UINT
get_font_aa_flags
(
HDC
hdc
)
DECLSPEC_HIDDEN
;
extern
UINT
get_font_aa_flags
(
HDC
hdc
,
const
LOGFONTW
*
lf
)
DECLSPEC_HIDDEN
;
/* freetype.c */
...
...
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