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

@ -22,49 +22,49 @@
#include <freerdp/types.h>
#define GLYPH_FRAGMENT_NOP 0x00
#define GLYPH_FRAGMENT_USE 0xFE
#define GLYPH_FRAGMENT_ADD 0xFF
#define GLYPH_FRAGMENT_NOP 0x00
#define GLYPH_FRAGMENT_USE 0xFE
#define GLYPH_FRAGMENT_ADD 0xFF
#define CBR2_HEIGHT_SAME_AS_WIDTH 0x01
#define CBR2_PERSISTENT_KEY_PRESENT 0x02
#define CBR2_NO_BITMAP_COMPRESSION_HDR 0x08
#define CBR2_DO_NOT_CACHE 0x10
#define CBR2_HEIGHT_SAME_AS_WIDTH 0x01
#define CBR2_PERSISTENT_KEY_PRESENT 0x02
#define CBR2_NO_BITMAP_COMPRESSION_HDR 0x08
#define CBR2_DO_NOT_CACHE 0x10
#define SCREEN_BITMAP_SURFACE 0xFFFF
#define BITMAP_CACHE_WAITING_LIST_INDEX 0x7FFF
#define SCREEN_BITMAP_SURFACE 0xFFFF
#define BITMAP_CACHE_WAITING_LIST_INDEX 0x7FFF
#define CACHED_BRUSH 0x80
#define CACHED_BRUSH 0x80
#define BMF_1BPP 0x1
#define BMF_8BPP 0x3
#define BMF_16BPP 0x4
#define BMF_24BPP 0x5
#define BMF_32BPP 0x6
#define BMF_1BPP 0x1
#define BMF_8BPP 0x3
#define BMF_16BPP 0x4
#define BMF_24BPP 0x5
#define BMF_32BPP 0x6
#ifndef _WIN32
#define BS_SOLID 0x00
#define BS_NULL 0x01
#define BS_HATCHED 0x02
#define BS_PATTERN 0x03
#define BS_SOLID 0x00
#define BS_NULL 0x01
#define BS_HATCHED 0x02
#define BS_PATTERN 0x03
#endif
#ifndef _WIN32
#define HS_HORIZONTAL 0x00
#define HS_VERTICAL 0x01
#define HS_FDIAGONAL 0x02
#define HS_BDIAGONAL 0x03
#define HS_CROSS 0x04
#define HS_DIAGCROSS 0x05
#define HS_HORIZONTAL 0x00
#define HS_VERTICAL 0x01
#define HS_FDIAGONAL 0x02
#define HS_BDIAGONAL 0x03
#define HS_CROSS 0x04
#define HS_DIAGCROSS 0x05
#endif
#define SO_FLAG_DEFAULT_PLACEMENT 0x01
#define SO_HORIZONTAL 0x02
#define SO_VERTICAL 0x04
#define SO_REVERSED 0x08
#define SO_ZERO_BEARINGS 0x10
#define SO_CHAR_INC_EQUAL_BM_BASE 0x20
#define SO_MAXEXT_EQUAL_BM_SIDE 0x40
#define SO_FLAG_DEFAULT_PLACEMENT 0x01
#define SO_HORIZONTAL 0x02
#define SO_VERTICAL 0x04
#define SO_REVERSED 0x08
#define SO_ZERO_BEARINGS 0x10
#define SO_CHAR_INC_EQUAL_BM_BASE 0x20
#define SO_MAXEXT_EQUAL_BM_SIDE 0x40
struct _CACHE_BITMAP_ORDER
{

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)
{