Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
1b63d5a6
Commit
1b63d5a6
authored
Nov 17, 2011
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Add a helper function to determine anti-aliasing flags.
parent
5282ffad
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
17 deletions
+27
-17
graphics.c
dlls/gdi32/dibdrv/graphics.c
+5
-17
font.c
dlls/gdi32/font.c
+19
-0
gdi_private.h
dlls/gdi32/gdi_private.h
+3
-0
No files found.
dlls/gdi32/dibdrv/graphics.c
View file @
1b63d5a6
...
...
@@ -157,19 +157,6 @@ static void draw_glyph( dibdrv_physdev *pdev, const POINT *origin, const GLYPHME
release_wine_region
(
pdev
->
clip
);
}
static
inline
UINT
get_aa_flags
(
dibdrv_physdev
*
pdev
)
{
LOGFONTW
lf
;
if
(
pdev
->
dib
.
bit_count
<=
8
)
return
GGO_BITMAP
;
GetObjectW
(
GetCurrentObject
(
pdev
->
dev
.
hdc
,
OBJ_FONT
),
sizeof
(
lf
),
&
lf
);
if
(
lf
.
lfQuality
==
NONANTIALIASED_QUALITY
)
return
GGO_BITMAP
;
/* FIXME, check gasp and user prefs */
return
GGO_GRAY4_BITMAP
;
}
static
const
BYTE
masks
[
8
]
=
{
0x80
,
0x40
,
0x20
,
0x10
,
0x08
,
0x04
,
0x02
,
0x01
};
static
const
int
padding
[
4
]
=
{
0
,
3
,
2
,
1
};
...
...
@@ -181,10 +168,10 @@ static const int padding[4] = {0, 3, 2, 1};
* For non-antialiased bitmaps convert them to the 17-level format
* using only values 0 or 16.
*/
static
DWORD
get_glyph_bitmap
(
dibdrv_physdev
*
pdev
,
UINT
index
,
GLYPHMETRICS
*
metrics
,
static
DWORD
get_glyph_bitmap
(
dibdrv_physdev
*
pdev
,
UINT
index
,
UINT
aa_flags
,
GLYPHMETRICS
*
metrics
,
struct
gdi_image_bits
*
image
)
{
UINT
aa_flags
=
get_aa_flags
(
pdev
),
ggo_flags
=
aa_flags
|
GGO_GLYPH_INDEX
;
UINT
ggo_flags
=
aa_flags
|
GGO_GLYPH_INDEX
;
static
const
MAT2
identity
=
{
{
0
,
1
},
{
0
,
0
},
{
0
,
0
},
{
0
,
1
}
};
UINT
indices
[
3
]
=
{
0
,
0
,
0x20
};
int
i
,
x
,
y
;
...
...
@@ -253,7 +240,7 @@ BOOL dibdrv_ExtTextOut( PHYSDEV dev, INT x, INT y, UINT flags,
const
RECT
*
rect
,
LPCWSTR
str
,
UINT
count
,
const
INT
*
dx
)
{
dibdrv_physdev
*
pdev
=
get_dibdrv_pdev
(
dev
);
UINT
i
;
UINT
aa_flags
,
i
;
POINT
origin
;
DWORD
err
;
HRGN
saved_clip
=
NULL
;
...
...
@@ -274,6 +261,7 @@ BOOL dibdrv_ExtTextOut( PHYSDEV dev, INT x, INT y, UINT flags,
DeleteObject
(
clip
);
}
aa_flags
=
get_font_aa_flags
(
dev
->
hdc
);
origin
.
x
=
x
;
origin
.
y
=
y
;
for
(
i
=
0
;
i
<
count
;
i
++
)
...
...
@@ -281,7 +269,7 @@ BOOL dibdrv_ExtTextOut( PHYSDEV dev, INT x, INT y, UINT flags,
GLYPHMETRICS
metrics
;
struct
gdi_image_bits
image
;
err
=
get_glyph_bitmap
(
pdev
,
(
UINT
)
str
[
i
],
&
metrics
,
&
image
);
err
=
get_glyph_bitmap
(
pdev
,
(
UINT
)
str
[
i
],
aa_flags
,
&
metrics
,
&
image
);
if
(
err
)
continue
;
if
(
image
.
ptr
)
draw_glyph
(
pdev
,
&
origin
,
&
metrics
,
&
image
);
...
...
dlls/gdi32/font.c
View file @
1b63d5a6
...
...
@@ -258,6 +258,25 @@ static void FONT_NewTextMetricExWToA(const NEWTEXTMETRICEXW *ptmW, NEWTEXTMETRIC
}
UINT
get_font_aa_flags
(
HDC
hdc
)
{
LOGFONTW
lf
;
if
(
GetObjectType
(
hdc
)
==
OBJ_MEMDC
)
{
BITMAP
bm
;
GetObjectW
(
GetCurrentObject
(
hdc
,
OBJ_BITMAP
),
sizeof
(
bm
),
&
bm
);
if
(
bm
.
bmBitsPixel
<=
8
)
return
GGO_BITMAP
;
}
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
;
/* FIXME, check gasp and user prefs */
return
GGO_GRAY4_BITMAP
;
}
/***********************************************************************
* GdiGetCodePage (GDI32.@)
*/
...
...
dlls/gdi32/gdi_private.h
View file @
1b63d5a6
...
...
@@ -278,6 +278,9 @@ extern BOOL DRIVER_GetDriverName( LPCWSTR device, LPWSTR driver, DWORD size ) DE
/* enhmetafile.c */
extern
HENHMETAFILE
EMF_Create_HENHMETAFILE
(
ENHMETAHEADER
*
emh
,
BOOL
on_disk
)
DECLSPEC_HIDDEN
;
/* font.c */
extern
UINT
get_font_aa_flags
(
HDC
hdc
)
DECLSPEC_HIDDEN
;
/* freetype.c */
/* Undocumented structure filled in by GdiRealizationInfo */
...
...
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