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
f3fab963
Commit
f3fab963
authored
Nov 16, 2011
by
Huw Davies
Committed by
Alexandre Julliard
Nov 16, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Add a helper to return the maximum level to use for a given anti-aliasing format.
parent
2bffcedc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
19 deletions
+25
-19
freetype.c
dlls/gdi32/freetype.c
+25
-19
No files found.
dlls/gdi32/freetype.c
View file @
f3fab963
...
...
@@ -5038,6 +5038,17 @@ static inline BOOL is_identity_MAT2(const MAT2 *matrix)
return
!
memcmp
(
matrix
,
&
identity
,
sizeof
(
MAT2
));
}
static
inline
BYTE
get_max_level
(
UINT
format
)
{
switch
(
format
)
{
case
GGO_GRAY2_BITMAP
:
return
4
;
case
GGO_GRAY4_BITMAP
:
return
16
;
case
GGO_GRAY8_BITMAP
:
return
64
;
}
return
255
;
}
static
DWORD
get_glyph_outline
(
GdiFont
*
incoming_font
,
UINT
glyph
,
UINT
format
,
LPGLYPHMETRICS
lpgm
,
DWORD
buflen
,
LPVOID
buf
,
const
MAT2
*
lpmat
)
...
...
@@ -5337,7 +5348,7 @@ static DWORD get_glyph_outline(GdiFont *incoming_font, UINT glyph, UINT format,
case
GGO_GRAY8_BITMAP
:
case
WINE_GGO_GRAY16_BITMAP
:
{
unsigned
int
m
ult
,
row
,
col
;
unsigned
int
m
ax_level
,
row
,
col
;
BYTE
*
start
,
*
ptr
;
width
=
lpgm
->
gmBlackBoxX
;
...
...
@@ -5347,6 +5358,8 @@ static DWORD get_glyph_outline(GdiFont *incoming_font, UINT glyph, UINT format,
if
(
!
buf
||
!
buflen
)
break
;
max_level
=
get_max_level
(
format
);
switch
(
ft_face
->
glyph
->
format
)
{
case
ft_glyph_format_bitmap
:
{
...
...
@@ -5379,29 +5392,22 @@ static DWORD get_glyph_outline(GdiFont *incoming_font, UINT glyph, UINT format,
pFT_Outline_Get_Bitmap
(
library
,
&
ft_face
->
glyph
->
outline
,
&
ft_bitmap
);
if
(
format
==
GGO_GRAY2_BITMAP
)
mult
=
4
;
else
if
(
format
==
GGO_GRAY4_BITMAP
)
mult
=
16
;
else
if
(
format
==
GGO_GRAY8_BITMAP
)
mult
=
64
;
else
/* format == WINE_GGO_GRAY16_BITMAP */
return
needed
;
break
;
if
(
max_level
!=
255
)
{
for
(
row
=
0
,
start
=
buf
;
row
<
height
;
row
++
)
{
for
(
col
=
0
,
ptr
=
start
;
col
<
width
;
col
++
,
ptr
++
)
*
ptr
=
(((
int
)
*
ptr
)
*
max_level
+
128
)
/
256
;
start
+=
pitch
;
}
}
return
needed
;
}
default:
FIXME
(
"loaded glyph format %x
\n
"
,
ft_face
->
glyph
->
format
);
return
GDI_ERROR
;
}
start
=
buf
;
for
(
row
=
0
;
row
<
height
;
row
++
)
{
ptr
=
start
;
for
(
col
=
0
;
col
<
width
;
col
++
,
ptr
++
)
{
*
ptr
=
(((
int
)
*
ptr
)
*
mult
+
128
)
/
256
;
}
start
+=
pitch
;
}
break
;
}
...
...
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