20 #include <freerdp/config.h>
22 #include <winpr/crt.h>
24 #include <winpr/stream.h>
28 rdpCache* cache_new(rdpContext* context)
30 rdpCache* cache = NULL;
32 WINPR_ASSERT(context);
34 cache = (rdpCache*)calloc(1,
sizeof(rdpCache));
39 cache->glyph = glyph_cache_new(context);
44 cache->brush = brush_cache_new(context);
49 cache->pointer = pointer_cache_new(context);
54 cache->bitmap = bitmap_cache_new(context);
59 cache->offscreen = offscreen_cache_new(context);
61 if (!cache->offscreen)
64 cache->palette = palette_cache_new(context);
69 cache->nine_grid = nine_grid_cache_new(context);
71 if (!cache->nine_grid)
76 WINPR_PRAGMA_DIAG_PUSH
77 WINPR_PRAGMA_DIAG_IGNORED_MISMATCHED_DEALLOC
83 void cache_free(rdpCache* cache)
87 glyph_cache_free(cache->glyph);
88 brush_cache_free(cache->brush);
89 pointer_cache_free(cache->pointer);
90 bitmap_cache_free(cache->bitmap);
91 offscreen_cache_free(cache->offscreen);
92 palette_cache_free(cache->palette);
93 nine_grid_cache_free(cache->nine_grid);
109 WINPR_PRAGMA_DIAG_PUSH
110 WINPR_PRAGMA_DIAG_IGNORED_MISMATCHED_DEALLOC
111 free_cache_color_table_order(context, dst);
112 WINPR_PRAGMA_DIAG_POP
130 dst->bmp.bitmapData = (BYTE*)malloc(order->bmp.bitmapDataLength);
132 if (!dst->bmp.bitmapData)
135 CopyMemory(dst->bmp.bitmapData, order->bmp.bitmapData, order->bmp.bitmapDataLength);
140 WINPR_PRAGMA_DIAG_PUSH
141 WINPR_PRAGMA_DIAG_IGNORED_MISMATCHED_DEALLOC
142 free_surface_bits_command(context, dst);
143 WINPR_PRAGMA_DIAG_POP
150 free(order->bmp.bitmapData);