libfreerdp-core: add update->SurfaceBits call.

This commit is contained in:
Vic Lee 2011-08-10 00:38:52 +08:00
parent 9b52d59f09
commit a2added869
3 changed files with 56 additions and 6 deletions

View File

@ -72,6 +72,19 @@ void df_end_paint(rdpUpdate* update)
dfi->primary->Blit(dfi->primary, dfi->surface, &(dfi->update_rect), dfi->update_rect.x, dfi->update_rect.y);
}
void df_surface_bits(rdpUpdate* update, SURFACE_BITS_COMMAND* surface_bits_command)
{
#if 0
printf("df_surface_bits: destLeft %d destTop %d destRight %d destBottom %d "
"bpp %d codecID %d width %d height %d length %d\n",
surface_bits_command->destLeft, surface_bits_command->destTop,
surface_bits_command->destRight, surface_bits_command->destBottom,
surface_bits_command->bpp, surface_bits_command->codecID,
surface_bits_command->width, surface_bits_command->height,
surface_bits_command->bitmapDataLength);
#endif
}
boolean df_get_fds(freerdp* instance, void** rfds, int* rcount, void** wfds, int* wcount)
{
dfInfo* dfi;
@ -181,6 +194,7 @@ boolean df_post_connect(freerdp* instance)
instance->update->BeginPaint = df_begin_paint;
instance->update->EndPaint = df_end_paint;
instance->update->SurfaceBits = df_surface_bits;
df_keyboard_init();

View File

@ -21,6 +21,7 @@
#define __UPDATE_API_H
#include <freerdp/types.h>
#include <freerdp/utils/stream.h>
/* Common */
@ -675,6 +676,22 @@ struct _DRAW_GDIPLUS_CACHE_END_ORDER
};
typedef struct _DRAW_GDIPLUS_CACHE_END_ORDER DRAW_GDIPLUS_CACHE_END_ORDER;
struct _SURFACE_BITS_COMMAND
{
uint16 cmdType;
uint16 destLeft;
uint16 destTop;
uint16 destRight;
uint16 destBottom;
uint8 bpp;
uint8 codecID;
uint16 width;
uint16 height;
uint32 bitmapDataLength;
STREAM* bitmapData;
};
typedef struct _SURFACE_BITS_COMMAND SURFACE_BITS_COMMAND;
/* Constants */
#define CACHED_BRUSH 0x80
@ -768,6 +785,8 @@ typedef void (*pcDrawGdiPlusCacheFirst)(rdpUpdate* update, DRAW_GDIPLUS_CACHE_FI
typedef void (*pcDrawGdiPlusCacheNext)(rdpUpdate* update, DRAW_GDIPLUS_CACHE_NEXT_ORDER* draw_gdiplus_cache_next);
typedef void (*pcDrawGdiPlusCacheEnd)(rdpUpdate* update, DRAW_GDIPLUS_CACHE_END_ORDER* draw_gdiplus_cache_end);
typedef void (*pcSurfaceBits)(rdpUpdate* update, SURFACE_BITS_COMMAND* surface_bits_command);
struct rdp_update
{
void* rdp;
@ -827,6 +846,8 @@ struct rdp_update
pcDrawGdiPlusCacheNext DrawGdiPlusCacheNext;
pcDrawGdiPlusCacheEnd DrawGdiPlusCacheEnd;
pcSurfaceBits SurfaceBits;
BITMAP_UPDATE bitmap_update;
PALETTE_UPDATE palette_update;
ORDER_INFO order_info;
@ -874,6 +895,8 @@ struct rdp_update
DRAW_GDIPLUS_FIRST_ORDER draw_gdiplus_first;
DRAW_GDIPLUS_NEXT_ORDER draw_gdiplus_next;
DRAW_GDIPLUS_END_ORDER draw_gdiplus_end;
SURFACE_BITS_COMMAND surface_bits_command;
};
#endif /* __UPDATE_API_H */

View File

@ -66,15 +66,28 @@ uint16 fastpath_read_header(rdpFastPath* fastpath, STREAM* s)
static int fastpath_recv_update_surfcmd_surface_bits(rdpFastPath* fastpath, STREAM* s)
{
uint32 bitmapDataLength;
rdpUpdate* update = fastpath->rdp->update;
SURFACE_BITS_COMMAND* cmd = &update->surface_bits_command;
int pos;
stream_seek(s, 16);
stream_read_uint32(s, bitmapDataLength);
stream_seek(s, bitmapDataLength);
stream_read_uint16(s, cmd->destLeft);
stream_read_uint16(s, cmd->destTop);
stream_read_uint16(s, cmd->destRight);
stream_read_uint16(s, cmd->destBottom);
stream_read_uint8(s, cmd->bpp);
stream_seek(s, 2); /* reserved1, reserved2 */
stream_read_uint8(s, cmd->codecID);
stream_read_uint16(s, cmd->width);
stream_read_uint16(s, cmd->height);
stream_read_uint32(s, cmd->bitmapDataLength);
pos = stream_get_pos(s) + cmd->bitmapDataLength;
cmd->bitmapData = s;
/*printf("surface_bits %d\n", bitmapDataLength);*/
IFCALL(update->SurfaceBits, update, cmd);
return 20 + bitmapDataLength;
stream_set_pos(s, pos);
return 20 + cmd->bitmapDataLength;
}
static int fastpath_recv_update_surfcmd_frame_marker(rdpFastPath* fastpath, STREAM* s)