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
ec4a46f9
Commit
ec4a46f9
authored
Jan 16, 2008
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Jan 16, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Allocate cache for face enumeration data only when necessary.
parent
ced64861
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
13 deletions
+20
-13
freetype.c
dlls/gdi32/freetype.c
+20
-13
No files found.
dlls/gdi32/freetype.c
View file @
ec4a46f9
...
...
@@ -242,6 +242,13 @@ typedef struct {
FT_Pos
size
,
x_ppem
,
y_ppem
;
}
My_FT_Bitmap_Size
;
struct
enum_data
{
ENUMLOGFONTEXW
elf
;
NEWTEXTMETRICEXW
ntm
;
DWORD
type
;
};
typedef
struct
tagFace
{
struct
list
entry
;
WCHAR
*
StyleName
;
...
...
@@ -260,10 +267,7 @@ typedef struct tagFace {
BOOL
external
;
/* TRUE if we should manually add this font to the registry */
struct
tagFamily
*
family
;
/* Cached data for Enum */
BOOL
cache_valid
;
ENUMLOGFONTEXW
elf
;
NEWTEXTMETRICEXW
ntm
;
DWORD
type
;
struct
enum_data
*
cached_enum_data
;
}
Face
;
typedef
struct
tagFamily
{
...
...
@@ -1239,7 +1243,7 @@ static INT AddFontToList(const char *file, void *font_data_ptr, DWORD font_data_
}
}
face
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
*
face
));
face
->
cache
_valid
=
FALSE
;
face
->
cache
d_enum_data
=
NULL
;
list_add_tail
(
&
family
->
faces
,
&
face
->
entry
);
face
->
StyleName
=
StyleW
;
if
(
file
)
...
...
@@ -3290,12 +3294,12 @@ static void GetEnumStructs(Face *face, LPENUMLOGFONTEXW pelf,
GdiFont
*
font
;
LONG
width
,
height
;
if
(
face
->
cache
_valid
)
if
(
face
->
cache
d_enum_data
)
{
TRACE
(
"Cached
\n
"
);
memcpy
(
pelf
,
&
face
->
elf
,
sizeof
(
ENUMLOGFONTEXW
));
memcpy
(
pntm
,
&
face
->
ntm
,
sizeof
(
NEWTEXTMETRICEXW
));
*
ptype
=
face
->
type
;
memcpy
(
pelf
,
&
face
->
cached_enum_data
->
elf
,
sizeof
(
ENUMLOGFONTEXW
));
memcpy
(
pntm
,
&
face
->
cached_enum_data
->
ntm
,
sizeof
(
NEWTEXTMETRICEXW
));
*
ptype
=
face
->
cached_enum_data
->
type
;
return
;
}
...
...
@@ -3374,10 +3378,13 @@ static void GetEnumStructs(Face *face, LPENUMLOGFONTEXW pelf,
if
(
!
(
pntm
->
ntmTm
.
tmPitchAndFamily
&
TMPF_VECTOR
))
*
ptype
|=
RASTER_FONTTYPE
;
memcpy
(
&
face
->
elf
,
pelf
,
sizeof
(
ENUMLOGFONTEXW
));
memcpy
(
&
face
->
ntm
,
pntm
,
sizeof
(
NEWTEXTMETRICEXW
));
face
->
type
=
*
ptype
;
face
->
cache_valid
=
TRUE
;
face
->
cached_enum_data
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
*
face
->
cached_enum_data
));
if
(
face
->
cached_enum_data
)
{
memcpy
(
&
face
->
cached_enum_data
->
elf
,
pelf
,
sizeof
(
ENUMLOGFONTEXW
));
memcpy
(
&
face
->
cached_enum_data
->
ntm
,
pntm
,
sizeof
(
NEWTEXTMETRICEXW
));
face
->
cached_enum_data
->
type
=
*
ptype
;
}
free_font
(
font
);
}
...
...
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