Commit e4300d61 authored by Alexandre Julliard's avatar Alexandre Julliard

gdi32: Cache the font smoothing parameters.

parent 96ab188f
......@@ -781,6 +781,7 @@ HFONT nulldrv_SelectFont( PHYSDEV dev, HFONT font, UINT *aa_flags )
{
static const WCHAR desktopW[] = { 'C','o','n','t','r','o','l',' ','P','a','n','e','l','\\',
'D','e','s','k','t','o','p',0 };
static int orientation = -1, smoothing = -1;
LOGFONTW lf;
HKEY key;
......@@ -797,14 +798,22 @@ HFONT nulldrv_SelectFont( PHYSDEV dev, HFONT font, UINT *aa_flags )
break;
case CLEARTYPE_QUALITY:
case CLEARTYPE_NATURAL_QUALITY:
if (RegOpenKeyW( HKEY_CURRENT_USER, desktopW, &key )) break;
*aa_flags = get_subpixel_orientation( key );
RegCloseKey( key );
if (orientation == -1)
{
if (RegOpenKeyW( HKEY_CURRENT_USER, desktopW, &key )) break;
orientation = get_subpixel_orientation( key );
RegCloseKey( key );
}
*aa_flags = orientation;
break;
default:
if (RegOpenKeyW( HKEY_CURRENT_USER, desktopW, &key )) break;
*aa_flags = get_default_smoothing( key );
RegCloseKey( key );
if (smoothing == -1)
{
if (RegOpenKeyW( HKEY_CURRENT_USER, desktopW, &key )) break;
smoothing = get_default_smoothing( key );
RegCloseKey( key );
}
*aa_flags = smoothing;
break;
}
return 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment