Refactor supporting new instruction set.

This commit is contained in:
Michael Jumper 2012-03-11 21:32:06 -07:00
parent 01ad7ea86e
commit acb573b965
2 changed files with 37 additions and 30 deletions

View File

@ -112,11 +112,14 @@ void guac_rdp_gdi_dstblt(rdpContext* context, DSTBLT_ORDER* dstblt) {
case 0: case 0:
/* Send black rectangle */ /* Send black rectangle */
guac_protocol_send_rect(client->socket, guac_protocol_send_rect(client->socket, current_layer,
GUAC_COMP_OVER, current_layer,
dstblt->nLeftRect, dstblt->nTopRect, dstblt->nLeftRect, dstblt->nTopRect,
dstblt->nWidth, dstblt->nHeight, dstblt->nWidth, dstblt->nHeight);
guac_protocol_send_cfill(client->socket,
GUAC_COMP_OVER, current_layer,
0, 0, 0, 255); 0, 0, 0, 255);
break; break;
/* Unsupported ROP3 */ /* Unsupported ROP3 */
@ -162,10 +165,12 @@ void guac_rdp_gdi_memblt(rdpContext* context, MEMBLT_ORDER* memblt) {
/* If blackness, send black rectangle */ /* If blackness, send black rectangle */
case 0x00: case 0x00:
guac_protocol_send_rect(client->socket, guac_protocol_send_rect(client->socket, current_layer,
GUAC_COMP_OVER, current_layer,
memblt->nLeftRect, memblt->nTopRect, memblt->nLeftRect, memblt->nTopRect,
memblt->nWidth, memblt->nHeight, memblt->nWidth, memblt->nHeight);
guac_protocol_send_cfill(client->socket,
GUAC_COMP_OVER, current_layer,
0x00, 0x00, 0x00, 0xFF); 0x00, 0x00, 0x00, 0xFF);
break; break;
@ -185,10 +190,12 @@ void guac_rdp_gdi_memblt(rdpContext* context, MEMBLT_ORDER* memblt) {
/* If whiteness, send white rectangle */ /* If whiteness, send white rectangle */
case 0xFF: case 0xFF:
guac_protocol_send_rect(client->socket, guac_protocol_send_rect(client->socket, current_layer,
GUAC_COMP_OVER, current_layer,
memblt->nLeftRect, memblt->nTopRect, memblt->nLeftRect, memblt->nTopRect,
memblt->nWidth, memblt->nHeight, memblt->nWidth, memblt->nHeight);
guac_protocol_send_cfill(client->socket,
GUAC_COMP_OVER, current_layer,
0xFF, 0xFF, 0xFF, 0xFF); 0xFF, 0xFF, 0xFF, 0xFF);
break; break;
@ -216,10 +223,12 @@ void guac_rdp_gdi_opaquerect(rdpContext* context, OPAQUE_RECT_ORDER* opaque_rect
const guac_layer* current_layer = ((rdp_guac_client_data*) client->data)->current_surface; const guac_layer* current_layer = ((rdp_guac_client_data*) client->data)->current_surface;
guac_protocol_send_rect(client->socket, guac_protocol_send_rect(client->socket, current_layer,
GUAC_COMP_OVER, current_layer,
opaque_rect->nLeftRect, opaque_rect->nTopRect, opaque_rect->nLeftRect, opaque_rect->nTopRect,
opaque_rect->nWidth, opaque_rect->nHeight, opaque_rect->nWidth, opaque_rect->nHeight);
guac_protocol_send_cfill(client->socket,
GUAC_COMP_OVER, current_layer,
(color >> 16) & 0xFF, (color >> 16) & 0xFF,
(color >> 8 ) & 0xFF, (color >> 8 ) & 0xFF,
(color ) & 0xFF, (color ) & 0xFF,
@ -240,24 +249,18 @@ void guac_rdp_gdi_set_bounds(rdpContext* context, rdpBounds* bounds) {
guac_client* client = ((rdp_freerdp_context*) context)->client; guac_client* client = ((rdp_freerdp_context*) context)->client;
const guac_layer* current_layer = ((rdp_guac_client_data*) client->data)->current_surface; const guac_layer* current_layer = ((rdp_guac_client_data*) client->data)->current_surface;
/* Reset clip */
guac_protocol_send_reset(client->socket, current_layer);
/* Set clip if specified */ /* Set clip if specified */
if (bounds != NULL) if (bounds != NULL) {
guac_protocol_send_clip( guac_protocol_send_rect(client->socket, current_layer,
client->socket, bounds->left, bounds->top,
current_layer,
bounds->left,
bounds->top,
bounds->right - bounds->left + 1, bounds->right - bounds->left + 1,
bounds->bottom - bounds->top + 1); bounds->bottom - bounds->top + 1);
/* Otherwise, reset clip */ guac_protocol_send_clip(client->socket, current_layer);
else }
guac_protocol_send_clip(
client->socket,
current_layer,
0, 0,
context->instance->settings->width,
context->instance->settings->height);
} }

View File

@ -117,9 +117,11 @@ void guac_rdp_glyph_draw(rdpContext* context, rdpGlyph* glyph, int x, int y) {
const guac_layer* current_layer = ((rdp_guac_client_data*) client->data)->current_surface; const guac_layer* current_layer = ((rdp_guac_client_data*) client->data)->current_surface;
/* Colorize glyph */ /* Colorize glyph */
guac_protocol_send_rect(client->socket, guac_protocol_send_rect(client->socket, ((guac_rdp_glyph*) glyph)->layer,
0, 0, glyph->cx, glyph->cy);
guac_protocol_send_cfill(client->socket,
GUAC_COMP_ATOP, ((guac_rdp_glyph*) glyph)->layer, GUAC_COMP_ATOP, ((guac_rdp_glyph*) glyph)->layer,
0, 0, glyph->cx, glyph->cy,
guac_client_data->foreground.red, guac_client_data->foreground.red,
guac_client_data->foreground.green, guac_client_data->foreground.green,
guac_client_data->foreground.blue, guac_client_data->foreground.blue,
@ -161,9 +163,11 @@ void guac_rdp_glyph_begindraw(rdpContext* context,
guac_client_data->background.red = (bgcolor & 0xFF0000) >> 16; guac_client_data->background.red = (bgcolor & 0xFF0000) >> 16;
/* Paint background on destination */ /* Paint background on destination */
guac_protocol_send_rect(client->socket, guac_protocol_send_rect(client->socket, current_layer,
x, y, width, height);
guac_protocol_send_cfill(client->socket,
GUAC_COMP_OVER, current_layer, GUAC_COMP_OVER, current_layer,
x, y, width, height,
guac_client_data->background.red, guac_client_data->background.red,
guac_client_data->background.green, guac_client_data->background.green,
guac_client_data->background.blue, guac_client_data->background.blue,