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
06dced4e
Commit
06dced4e
authored
Dec 07, 2012
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Keep track of the number of fonts on the unused list.
parent
d3c12834
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
10 deletions
+10
-10
freetype.c
dlls/gdi32/freetype.c
+10
-10
No files found.
dlls/gdi32/freetype.c
View file @
06dced4e
...
...
@@ -375,6 +375,7 @@ struct enum_charset_list {
static
struct
list
gdi_font_list
=
LIST_INIT
(
gdi_font_list
);
static
struct
list
unused_gdi_font_list
=
LIST_INIT
(
unused_gdi_font_list
);
static
unsigned
int
unused_font_count
;
#define UNUSED_CACHE_SIZE 10
static
struct
list
system_links
=
LIST_INIT
(
system_links
);
...
...
@@ -4307,6 +4308,7 @@ static GdiFont *find_in_cache(HFONT hfont, const LOGFONTW *plf, const FMAT2 *pma
hflist
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
*
hflist
));
hflist
->
hfont
=
hfont
;
list_add_head
(
&
ret
->
hfontlist
,
&
hflist
->
entry
);
unused_font_count
--
;
return
ret
;
}
return
NULL
;
...
...
@@ -5021,7 +5023,6 @@ BOOL WineEngDestroyFontInstance(HFONT handle)
GdiFont
*
gdiFont
,
*
next
;
HFONTLIST
*
hflist
,
*
hfnext
;
BOOL
ret
=
FALSE
;
int
i
=
0
;
GDI_CheckNotLock
();
EnterCriticalSection
(
&
freetype_cs
);
...
...
@@ -5044,17 +5045,16 @@ BOOL WineEngDestroyFontInstance(HFONT handle)
TRACE
(
"Moving to Unused list
\n
"
);
list_remove
(
&
gdiFont
->
entry
);
list_add_head
(
&
unused_gdi_font_list
,
&
gdiFont
->
entry
);
if
(
unused_font_count
>
UNUSED_CACHE_SIZE
)
{
gdiFont
=
LIST_ENTRY
(
list_tail
(
&
unused_gdi_font_list
),
struct
tagGdiFont
,
entry
);
TRACE
(
"freeing %p
\n
"
,
gdiFont
);
list_remove
(
&
gdiFont
->
entry
);
free_font
(
gdiFont
);
}
else
unused_font_count
++
;
}
}
LIST_FOR_EACH_ENTRY_SAFE
(
gdiFont
,
next
,
&
unused_gdi_font_list
,
struct
tagGdiFont
,
entry
)
{
if
(
i
++
<
UNUSED_CACHE_SIZE
)
continue
;
TRACE
(
"freeing %p
\n
"
,
gdiFont
);
list_remove
(
&
gdiFont
->
entry
);
free_font
(
gdiFont
);
}
LeaveCriticalSection
(
&
freetype_cs
);
return
ret
;
}
...
...
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