libfreerdp-gdi: enable altsec frame markers

This commit is contained in:
Marc-André Moreau 2014-09-05 16:06:19 -04:00
parent 7f9d05183c
commit 66bbbf0519
6 changed files with 59 additions and 29 deletions

View File

@ -187,23 +187,33 @@ void xf_sw_begin_paint(rdpContext *context)
void xf_sw_end_paint(rdpContext *context)
{
rdpGdi *gdi;
int i;
INT32 x, y;
UINT32 w, h;
int ninvalid;
HGDI_RGN cinvalid;
xfContext* xfc = (xfContext*) context;
gdi = context->gdi;
rdpGdi* gdi = context->gdi;
x = gdi->primary->hdc->hwnd->invalid->x;
y = gdi->primary->hdc->hwnd->invalid->y;
w = gdi->primary->hdc->hwnd->invalid->w;
h = gdi->primary->hdc->hwnd->invalid->h;
ninvalid = gdi->primary->hdc->hwnd->ninvalid;
cinvalid = gdi->primary->hdc->hwnd->cinvalid;
if (!xfc->remote_app)
{
if (!xfc->complex_regions)
{
if (gdi->primary->hdc->hwnd->invalid->null)
return;
x = gdi->primary->hdc->hwnd->invalid->x;
y = gdi->primary->hdc->hwnd->invalid->y;
w = gdi->primary->hdc->hwnd->invalid->w;
h = gdi->primary->hdc->hwnd->invalid->h;
xf_lock_x11(xfc, FALSE);
XPutImage(xfc->display, xfc->primary, xfc->gc, xfc->image, x, y, x, y, w, h);
if ((xfc->settings->ScalingFactor != 1.0) || (xfc->offset_x) || (xfc->offset_y))
{
xf_draw_screen_scaled(xfc, x, y, w, h, TRUE);
@ -212,26 +222,26 @@ void xf_sw_end_paint(rdpContext *context)
{
XCopyArea(xfc->display, xfc->primary, xfc->window->handle, xfc->gc, x, y, w, h, x, y);
}
xf_unlock_x11(xfc, FALSE);
}
else
{
int i;
int ninvalid;
HGDI_RGN cinvalid;
if (gdi->primary->hdc->hwnd->ninvalid < 1)
return;
ninvalid = gdi->primary->hdc->hwnd->ninvalid;
cinvalid = gdi->primary->hdc->hwnd->cinvalid;
xf_lock_x11(xfc, FALSE);
for (i = 0; i < ninvalid; i++)
{
x = cinvalid[i].x;
y = cinvalid[i].y;
w = cinvalid[i].w;
h = cinvalid[i].h;
//combine xfc->primary with xfc->image
XPutImage(xfc->display, xfc->primary, xfc->gc, xfc->image, x, y, x, y, w, h);
if ((xfc->settings->ScalingFactor != 1.0) || (xfc->offset_x) || (xfc->offset_y))
{
xf_draw_screen_scaled(xfc, x, y, w, h, TRUE);
@ -241,7 +251,9 @@ void xf_sw_end_paint(rdpContext *context)
XCopyArea(xfc->display, xfc->primary, xfc->window->handle, xfc->gc, x, y, w, h, x, y);
}
}
XFlush(xfc->display);
xf_unlock_x11(xfc, FALSE);
}
}
@ -249,12 +261,11 @@ void xf_sw_end_paint(rdpContext *context)
{
if (gdi->primary->hdc->hwnd->invalid->null)
return;
x = gdi->primary->hdc->hwnd->invalid->x;
y = gdi->primary->hdc->hwnd->invalid->y;
w = gdi->primary->hdc->hwnd->invalid->w;
h = gdi->primary->hdc->hwnd->invalid->h;
xf_lock_x11(xfc, FALSE);
xf_rail_paint(xfc, context->rail, x, y, x + w - 1, y + h - 1);
xf_unlock_x11(xfc, FALSE);
}
}
@ -264,11 +275,14 @@ void xf_sw_desktop_resize(rdpContext *context)
rdpSettings *settings;
xfContext *xfc = (xfContext *) context;
settings = xfc->instance->settings;
xf_lock_x11(xfc, TRUE);
if (!xfc->fullscreen)
{
rdpGdi *gdi = context->gdi;
gdi_resize(gdi, xfc->width, xfc->height);
if (xfc->image)
{
xfc->image->data = NULL;
@ -277,6 +291,7 @@ void xf_sw_desktop_resize(rdpContext *context)
(char *) gdi->primary_buffer, gdi->width, gdi->height, xfc->scanline_pad, 0);
}
}
xf_unlock_x11(xfc, TRUE);
}

View File

@ -949,6 +949,11 @@ void xf_gdi_ellipse_cb(rdpContext* context, ELLIPSE_CB_ORDER* ellipse_cb)
DEBUG_WARN( "EllipseCB\n");
}
void xf_gdi_frame_marker(rdpContext* context, FRAME_MARKER_ORDER* frameMarker)
{
}
void xf_gdi_surface_frame_marker(rdpContext* context, SURFACE_FRAME_MARKER* surface_frame_marker)
{
rdpSettings* settings;
@ -1187,5 +1192,7 @@ void xf_gdi_register_update_callbacks(rdpUpdate* update)
update->SurfaceBits = xf_gdi_surface_bits;
update->SurfaceFrameMarker = xf_gdi_surface_frame_marker;
update->altsec->FrameMarker = xf_gdi_frame_marker;
}

View File

@ -389,7 +389,6 @@ void xf_Glyph_Draw(rdpContext* context, rdpGlyph* glyph, int x, int y)
void xf_Glyph_BeginDraw(rdpContext* context, int x, int y, int width, int height, UINT32 bgcolor, UINT32 fgcolor)
{
xfContext* context_ = (xfContext*) context;
xfContext* xfc = (xfContext*) context;
bgcolor = freerdp_color_convert_drawing_order_color_to_gdi_color(bgcolor, context->settings->ColorDepth, xfc->clrconv);

View File

@ -321,7 +321,7 @@ rdpSettings* freerdp_settings_new(DWORD flags)
settings->DrawGdiPlusEnabled = FALSE;
settings->FrameMarkerCommandEnabled = FALSE;
settings->FrameMarkerCommandEnabled = TRUE;
settings->SurfaceFrameMarkerEnabled = TRUE;
settings->BitmapCacheV3Enabled = FALSE;

View File

@ -164,6 +164,8 @@ BOOL update_read_bitmap_update(rdpUpdate* update, wStream* s, BITMAP_UPDATE* bit
Stream_Read_UINT16(s, bitmapUpdate->number); /* numberRectangles (2 bytes) */
WLog_Print(update->log, WLOG_DEBUG, "BitmapUpdate: %d", bitmapUpdate->number);
if (bitmapUpdate->number > bitmapUpdate->count)
{
UINT16 count;

View File

@ -764,6 +764,11 @@ void gdi_ellipse_cb(rdpContext* context, ELLIPSE_CB_ORDER* ellipse_cb)
DEBUG_WARN( "EllipseCB\n");
}
void gdi_frame_marker(rdpContext* context, FRAME_MARKER_ORDER* frameMarker)
{
}
void gdi_surface_frame_marker(rdpContext* context, SURFACE_FRAME_MARKER* surface_frame_marker)
{
DEBUG_GDI("frameId %d frameAction %d",
@ -943,6 +948,8 @@ void gdi_register_update_callbacks(rdpUpdate* update)
update->SurfaceBits = gdi_surface_bits;
update->SurfaceFrameMarker = gdi_surface_frame_marker;
update->altsec->FrameMarker = gdi_frame_marker;
}
void gdi_init_primary(rdpGdi* gdi)