#include "wlf_disp.h"
#include "wlf_channels.h"
-static BOOL wl_update_content(wlfContext* context_w)
-{
- if (!context_w)
- return FALSE;
-
- if (!context_w->waitingFrameDone && context_w->haveDamage)
- {
- UwacWindowSubmitBuffer(context_w->window, true);
- context_w->waitingFrameDone = TRUE;
- context_w->haveDamage = FALSE;
- }
-
- return TRUE;
-}
-
static BOOL wl_begin_paint(rdpContext* context)
{
rdpGdi* gdi;
{
rdpGdi* gdi;
char* data;
+ size_t baseOffset;
UINT32 i, x, y, w, h;
if (!context_w)
if (!gdi)
return FALSE;
+ baseOffset = y * gdi->stride + x * GetBytesPerPixel(gdi->dstFormat);
for (i = 0; i < h; i++)
{
- size_t offset = (i + y) * gdi->stride + x * GetBytesPerPixel(gdi->dstFormat);
+ size_t offset = i * gdi->stride + baseOffset;
memcpy(data + offset, gdi->primary_buffer + offset,
w * GetBytesPerPixel(gdi->dstFormat));
}
if (UwacWindowAddDamage(context_w->window, x, y, w, h) != UWAC_SUCCESS)
return FALSE;
- context_w->haveDamage = TRUE;
- return wl_update_content(context_w);
+ if (UwacWindowSubmitBuffer(context_w->window, true) != UWAC_SUCCESS)
+ return FALSE;
+
+ return TRUE;
}
static BOOL wl_end_paint(rdpContext* context)
if (!context->clipboard)
return FALSE;
- return wl_update_buffer(context, 0, 0, gdi->width, gdi->height);
+ return wl_refresh_display(context);
}
static void wl_post_disconnect(freerdp* instance)
switch (event.type)
{
case UWAC_EVENT_FRAME_DONE:
- if (!instance)
- continue;
-
- context->waitingFrameDone = FALSE;
-
- if (context->haveDamage && !wl_update_content(context))
- return FALSE;
-
break;
case UWAC_EVENT_POINTER_ENTER: