Module: wine Branch: master Commit: f898547b77a091132aefa1967887f5e640819bd4 URL: http://source.winehq.org/git/wine.git/?a=commit;h=f898547b77a091132aefa19678...
Author: Dmitry Timoshkov dmitry@codeweavers.com Date: Thu Oct 9 10:23:46 2008 +0900
gdi32: Remove the code which bypasses the DC transformation checks.
If it's absolutely required to check the child list first, that should be done inside of find_in_cache using the same comparisons as done there.
---
dlls/gdi32/freetype.c | 21 +++------------------ 1 files changed, 3 insertions(+), 18 deletions(-)
diff --git a/dlls/gdi32/freetype.c b/dlls/gdi32/freetype.c index 145be9b..d4cecb3 100644 --- a/dlls/gdi32/freetype.c +++ b/dlls/gdi32/freetype.c @@ -3286,24 +3286,7 @@ GdiFont *WineEngCreateFontInstance(DC *dc, HFONT hfont) FMAT2 dcmat; FontSubst *psub = NULL;
- EnterCriticalSection( &freetype_cs ); - - LIST_FOR_EACH_ENTRY(ret, &child_font_list, struct tagGdiFont, entry) - { - struct list *first_hfont = list_head(&ret->hfontlist); - hflist = LIST_ENTRY(first_hfont, HFONTLIST, entry); - if(hflist->hfont == hfont) - { - LeaveCriticalSection( &freetype_cs ); - return ret; - } - } - - if (!GetObjectW( hfont, sizeof(lf), &lf )) - { - LeaveCriticalSection( &freetype_cs ); - return NULL; - } + if (!GetObjectW( hfont, sizeof(lf), &lf )) return NULL; lf.lfWidth = abs(lf.lfWidth);
can_use_bitmap = GetDeviceCaps(dc->hSelf, TEXTCAPS) & TC_RA_ABLE; @@ -3326,6 +3309,8 @@ GdiFont *WineEngCreateFontInstance(DC *dc, HFONT hfont) TRACE("DC transform %f %f %f %f\n", dcmat.eM11, dcmat.eM12, dcmat.eM21, dcmat.eM22);
+ EnterCriticalSection( &freetype_cs ); + /* check the cache first */ if((ret = find_in_cache(hfont, &lf, &dcmat, can_use_bitmap)) != NULL) { TRACE("returning cached gdiFont(%p) for hFont %p\n", ret, hfont);