19 #include <freerdp/config.h>
21 #include <winpr/assert.h>
22 #include <winpr/cast.h>
24 #include <rdtk/rdtk.h>
28 #include "shadow_lobby.h"
30 BOOL shadow_client_init_lobby(rdpShadowServer* server)
35 rdtkSurface* surface = NULL;
37 rdpShadowSurface* lobby = server->lobby;
42 rdtkEngine* engine = rdtk_engine_new();
46 EnterCriticalSection(&lobby->lock);
48 rdtk_surface_new(engine, lobby->data, WINPR_ASSERTING_INT_CAST(uint16_t, lobby->width),
49 WINPR_ASSERTING_INT_CAST(uint16_t, lobby->height), lobby->scanline);
55 WINPR_ASSERT(lobby->width <= UINT16_MAX);
56 WINPR_ASSERT(lobby->height <= UINT16_MAX);
57 invalidRect.right = (UINT16)lobby->width;
58 invalidRect.bottom = (UINT16)lobby->height;
59 if (server->shareSubRect)
62 rectangles_intersection(&invalidRect, &(server->subRect), &invalidRect);
65 width = invalidRect.right - invalidRect.left;
66 height = invalidRect.bottom - invalidRect.top;
67 WINPR_ASSERT(width <= UINT16_MAX);
68 WINPR_ASSERT(width >= 0);
69 WINPR_ASSERT(height <= UINT16_MAX);
70 WINPR_ASSERT(height >= 0);
71 rdtk_surface_fill(surface, invalidRect.left, invalidRect.top, (UINT16)width, (UINT16)height,
74 rdtk_label_draw(surface, invalidRect.left, invalidRect.top, (UINT16)width, (UINT16)height, NULL,
79 rdtk_surface_free(surface);
81 region16_union_rect(&(lobby->invalidRegion), &(lobby->invalidRegion), &invalidRect);
85 LeaveCriticalSection(&lobby->lock);
86 rdtk_engine_free(engine);