19 #include <freerdp/config.h>
21 #include <winpr/assert.h>
22 #include <rdtk/rdtk.h>
26 #include "shadow_lobby.h"
28 BOOL shadow_client_init_lobby(rdpShadowServer* server)
33 rdtkSurface* surface = NULL;
35 rdpShadowSurface* lobby = server->lobby;
40 rdtkEngine* engine = rdtk_engine_new();
44 EnterCriticalSection(&lobby->lock);
45 surface = rdtk_surface_new(engine, lobby->data, lobby->width, lobby->height, lobby->scanline);
51 WINPR_ASSERT(lobby->width <= UINT16_MAX);
52 WINPR_ASSERT(lobby->height <= UINT16_MAX);
53 invalidRect.right = (UINT16)lobby->width;
54 invalidRect.bottom = (UINT16)lobby->height;
55 if (server->shareSubRect)
58 rectangles_intersection(&invalidRect, &(server->subRect), &invalidRect);
61 width = invalidRect.right - invalidRect.left;
62 height = invalidRect.bottom - invalidRect.top;
63 WINPR_ASSERT(width <= UINT16_MAX);
64 WINPR_ASSERT(width >= 0);
65 WINPR_ASSERT(height <= UINT16_MAX);
66 WINPR_ASSERT(height >= 0);
67 rdtk_surface_fill(surface, invalidRect.left, invalidRect.top, (UINT16)width, (UINT16)height,
70 rdtk_label_draw(surface, invalidRect.left, invalidRect.top, (UINT16)width, (UINT16)height, NULL,
75 rdtk_surface_free(surface);
77 region16_union_rect(&(lobby->invalidRegion), &(lobby->invalidRegion), &invalidRect);
81 LeaveCriticalSection(&lobby->lock);
82 rdtk_engine_free(engine);