libfreerdp-core: make more caches configurable through the registry

This commit is contained in:
Marc-André Moreau 2012-10-12 15:47:51 -04:00
parent 061758a742
commit 5d69a74d34
6 changed files with 85 additions and 43 deletions

View File

@ -179,7 +179,7 @@ BOOL wf_pre_connect(freerdp* instance)
settings->order_support[NEG_ELLIPSE_SC_INDEX] = FALSE;
settings->order_support[NEG_ELLIPSE_CB_INDEX] = FALSE;
settings->glyph_cache = FALSE;
settings->glyphSupportLevel = GLYPH_SUPPORT_NONE;
wfi->cursor = g_default_cursor;

View File

@ -436,7 +436,8 @@ struct rdp_settings
ALIGN64 BOOL persistent_bitmap_cache; /* 330 */
ALIGN64 UINT32 bitmapCacheV2NumCells; /* 331 */
ALIGN64 BITMAP_CACHE_V2_CELL_INFO* bitmapCacheV2CellInfo; /* 332 */
UINT64 paddingQ[344 - 333]; /* 333 */
ALIGN64 BOOL allow_cache_waiting_list; /* 333 */
UINT64 paddingQ[344 - 334]; /* 334 */
/* Offscreen Bitmap Cache */
ALIGN64 BOOL offscreen_bitmap_cache; /* 344 */
@ -445,7 +446,7 @@ struct rdp_settings
UINT64 paddingR[352 - 347]; /* 347 */
/* Glyph Cache */
ALIGN64 BOOL glyph_cache; /* 352 */
ALIGN64 void* unused352; /* 352 */
ALIGN64 UINT32 glyphSupportLevel; /* 353 */
ALIGN64 GLYPH_CACHE_DEFINITION* glyphCache; /* 354 */
ALIGN64 GLYPH_CACHE_DEFINITION* fragCache; /* 355 */

View File

@ -464,9 +464,6 @@ rdpGlyphCache* glyph_cache_new(rdpSettings* settings)
glyph->settings = settings;
glyph->context = ((freerdp*) settings->instance)->update->context;
if (settings->glyph_cache)
settings->glyphSupportLevel = GLYPH_SUPPORT_FULL;
for (i = 0; i < 10; i++)
{
glyph->glyphCache[i].number = settings->glyphCache[i].cacheEntries;

View File

@ -81,8 +81,6 @@ void settings_client_load_hkey_local_machine(rdpSettings* settings)
REG_QUERY_DWORD_VALUE(hKey, _T("OffscreenBitmapCacheSize"), dwType, dwValue, dwSize, settings->offscreen_bitmap_cache_size);
REG_QUERY_DWORD_VALUE(hKey, _T("OffscreenBitmapCacheEntries"), dwType, dwValue, dwSize, settings->offscreen_bitmap_cache_entries);
REG_QUERY_BOOL_VALUE(hKey, _T("GlyphCache"), dwType, dwValue, dwSize, settings->glyph_cache);
RegCloseKey(hKey);
}
@ -103,6 +101,52 @@ void settings_client_load_hkey_local_machine(rdpSettings* settings)
REG_QUERY_DWORD_VALUE(hKey, _T("Cell4NumEntries"), dwType, dwValue, dwSize, settings->bitmapCacheV2CellInfo[4].numEntries);
REG_QUERY_BOOL_VALUE(hKey, _T("Cell4Persistent"), dwType, dwValue, dwSize, settings->bitmapCacheV2CellInfo[4].persistent);
REG_QUERY_BOOL_VALUE(hKey, _T("AllowCacheWaitingList"), dwType, dwValue, dwSize, settings->allow_cache_waiting_list);
RegCloseKey(hKey);
}
status = RegOpenKeyEx(HKEY_LOCAL_MACHINE, _T("Software\\FreeRDP\\Client\\GlyphCache"), 0, KEY_READ | KEY_WOW64_64KEY, &hKey);
if (status == ERROR_SUCCESS)
{
REG_QUERY_DWORD_VALUE(hKey, _T("SupportLevel"), dwType, dwValue, dwSize, settings->glyphSupportLevel);
REG_QUERY_DWORD_VALUE(hKey, _T("Cache0NumEntries"), dwType, dwValue, dwSize, settings->glyphCache[0].cacheEntries);
REG_QUERY_DWORD_VALUE(hKey, _T("Cache0MaxCellSize"), dwType, dwValue, dwSize, settings->glyphCache[0].cacheMaximumCellSize);
REG_QUERY_DWORD_VALUE(hKey, _T("Cache1NumEntries"), dwType, dwValue, dwSize, settings->glyphCache[1].cacheEntries);
REG_QUERY_DWORD_VALUE(hKey, _T("Cache1MaxCellSize"), dwType, dwValue, dwSize, settings->glyphCache[1].cacheMaximumCellSize);
REG_QUERY_DWORD_VALUE(hKey, _T("Cache2NumEntries"), dwType, dwValue, dwSize, settings->glyphCache[2].cacheEntries);
REG_QUERY_DWORD_VALUE(hKey, _T("Cache2MaxCellSize"), dwType, dwValue, dwSize, settings->glyphCache[2].cacheMaximumCellSize);
REG_QUERY_DWORD_VALUE(hKey, _T("Cache3NumEntries"), dwType, dwValue, dwSize, settings->glyphCache[3].cacheEntries);
REG_QUERY_DWORD_VALUE(hKey, _T("Cache3MaxCellSize"), dwType, dwValue, dwSize, settings->glyphCache[3].cacheMaximumCellSize);
REG_QUERY_DWORD_VALUE(hKey, _T("Cache4NumEntries"), dwType, dwValue, dwSize, settings->glyphCache[4].cacheEntries);
REG_QUERY_DWORD_VALUE(hKey, _T("Cache4MaxCellSize"), dwType, dwValue, dwSize, settings->glyphCache[4].cacheMaximumCellSize);
REG_QUERY_DWORD_VALUE(hKey, _T("Cache5NumEntries"), dwType, dwValue, dwSize, settings->glyphCache[5].cacheEntries);
REG_QUERY_DWORD_VALUE(hKey, _T("Cache5MaxCellSize"), dwType, dwValue, dwSize, settings->glyphCache[5].cacheMaximumCellSize);
REG_QUERY_DWORD_VALUE(hKey, _T("Cache6NumEntries"), dwType, dwValue, dwSize, settings->glyphCache[6].cacheEntries);
REG_QUERY_DWORD_VALUE(hKey, _T("Cache6MaxCellSize"), dwType, dwValue, dwSize, settings->glyphCache[6].cacheMaximumCellSize);
REG_QUERY_DWORD_VALUE(hKey, _T("Cache7NumEntries"), dwType, dwValue, dwSize, settings->glyphCache[7].cacheEntries);
REG_QUERY_DWORD_VALUE(hKey, _T("Cache7MaxCellSize"), dwType, dwValue, dwSize, settings->glyphCache[7].cacheMaximumCellSize);
REG_QUERY_DWORD_VALUE(hKey, _T("Cache8NumEntries"), dwType, dwValue, dwSize, settings->glyphCache[8].cacheEntries);
REG_QUERY_DWORD_VALUE(hKey, _T("Cache8MaxCellSize"), dwType, dwValue, dwSize, settings->glyphCache[8].cacheMaximumCellSize);
REG_QUERY_DWORD_VALUE(hKey, _T("Cache9NumEntries"), dwType, dwValue, dwSize, settings->glyphCache[9].cacheEntries);
REG_QUERY_DWORD_VALUE(hKey, _T("Cache9MaxCellSize"), dwType, dwValue, dwSize, settings->glyphCache[9].cacheMaximumCellSize);
REG_QUERY_DWORD_VALUE(hKey, _T("FragCacheNumEntries"), dwType, dwValue, dwSize, settings->fragCache->cacheEntries);
REG_QUERY_DWORD_VALUE(hKey, _T("FragCacheMaxCellSize"), dwType, dwValue, dwSize, settings->fragCache->cacheMaximumCellSize);
RegCloseKey(hKey);
}
status = RegOpenKeyEx(HKEY_LOCAL_MACHINE, _T("Software\\FreeRDP\\Client\\PointerCache"), 0, KEY_READ | KEY_WOW64_64KEY, &hKey);
if (status == ERROR_SUCCESS)
{
REG_QUERY_BOOL_VALUE(hKey, _T("LargePointer"), dwType, dwValue, dwSize, settings->large_pointer);
REG_QUERY_BOOL_VALUE(hKey, _T("ColorPointer"), dwType, dwValue, dwSize, settings->color_pointer);
REG_QUERY_DWORD_VALUE(hKey, _T("PointerCacheSize"), dwType, dwValue, dwSize, settings->pointer_cache_size);
RegCloseKey(hKey);
}
}
@ -232,6 +276,7 @@ rdpSettings* settings_new(void* instance)
settings->bitmap_cache = TRUE;
settings->persistent_bitmap_cache = FALSE;
settings->allow_cache_waiting_list = TRUE;
settings->bitmapCacheV2NumCells = 5;
settings->bitmapCacheV2CellInfo = xzalloc(sizeof(BITMAP_CACHE_V2_CELL_INFO) * 6);
@ -249,8 +294,7 @@ rdpSettings* settings_new(void* instance)
settings->refresh_rect = TRUE;
settings->suppress_output = TRUE;
settings->glyph_cache = TRUE;
settings->glyphSupportLevel = GLYPH_SUPPORT_NONE;
settings->glyphSupportLevel = GLYPH_SUPPORT_FULL;
settings->glyphCache = xzalloc(sizeof(GLYPH_CACHE_DEFINITION) * 10);
settings->fragCache = xnew(GLYPH_CACHE_DEFINITION);
settings->glyphCache[0].cacheEntries = 254;

View File

@ -351,7 +351,7 @@ int freerdp_parse_args(rdpSettings* settings, int argc, char** argv,
}
else if (strcmp("--no-glyph-cache", argv[index]) == 0)
{
settings->glyph_cache = FALSE;
settings->glyphSupportLevel = GLYPH_SUPPORT_NONE;
}
else if (strcmp("--no-osb", argv[index]) == 0)
{