mirror of
https://github.com/morgan9e/FreeRDP
synced 2026-04-15 00:44:19 +09:00
Fixed pointer initialisation for X11.
This commit is contained in:
@@ -837,9 +837,9 @@ static BOOL xf_get_pixmap_info(xfContext* xfc)
|
||||
if (xfc->visual)
|
||||
{
|
||||
/*
|
||||
* Detect if the server visual has an inverted colormap
|
||||
* (BGR vs RGB, or red being the least significant byte)
|
||||
*/
|
||||
* Detect if the server visual has an inverted colormap
|
||||
* (BGR vs RGB, or red being the least significant byte)
|
||||
*/
|
||||
if (vi->red_mask & 0xFF)
|
||||
{
|
||||
xfc->invert = TRUE;
|
||||
@@ -1065,15 +1065,15 @@ static void xf_button_map_init(xfContext* xfc)
|
||||
}
|
||||
|
||||
/**
|
||||
* Callback given to freerdp_connect() to process the pre-connect operations.
|
||||
* It will fill the rdp_freerdp structure (instance) with the appropriate options to use for the connection.
|
||||
*
|
||||
* @param instance - pointer to the rdp_freerdp structure that contains the connection's parameters, and will
|
||||
* be filled with the appropriate informations.
|
||||
*
|
||||
* @return TRUE if successful. FALSE otherwise.
|
||||
* Can exit with error code XF_EXIT_PARSE_ARGUMENTS if there is an error in the parameters.
|
||||
*/
|
||||
* Callback given to freerdp_connect() to process the pre-connect operations.
|
||||
* It will fill the rdp_freerdp structure (instance) with the appropriate options to use for the connection.
|
||||
*
|
||||
* @param instance - pointer to the rdp_freerdp structure that contains the connection's parameters, and will
|
||||
* be filled with the appropriate informations.
|
||||
*
|
||||
* @return TRUE if successful. FALSE otherwise.
|
||||
* Can exit with error code XF_EXIT_PARSE_ARGUMENTS if there is an error in the parameters.
|
||||
*/
|
||||
static BOOL xf_pre_connect(freerdp* instance)
|
||||
{
|
||||
rdpChannels* channels;
|
||||
@@ -1188,10 +1188,10 @@ static BOOL xf_pre_connect(freerdp* instance)
|
||||
}
|
||||
|
||||
/**
|
||||
* Callback given to freerdp_connect() to perform post-connection operations.
|
||||
* It will be called only if the connection was initialized properly, and will continue the initialization based on the
|
||||
* newly created connection.
|
||||
*/
|
||||
* Callback given to freerdp_connect() to perform post-connection operations.
|
||||
* It will be called only if the connection was initialized properly, and will continue the initialization based on the
|
||||
* newly created connection.
|
||||
*/
|
||||
static BOOL xf_post_connect(freerdp* instance)
|
||||
{
|
||||
rdpUpdate* update;
|
||||
@@ -1205,17 +1205,22 @@ static BOOL xf_post_connect(freerdp* instance)
|
||||
settings = instance->settings;
|
||||
update = context->update;
|
||||
|
||||
if (!xf_register_graphics(context->graphics))
|
||||
{
|
||||
WLog_ERR(TAG, "failed to register graphics");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (!gdi_init(instance, xfc->format))
|
||||
return FALSE;
|
||||
|
||||
if (!xf_register_pointer(context->graphics))
|
||||
return FALSE;
|
||||
|
||||
if (!settings->SoftwareGdi)
|
||||
{
|
||||
if (!xf_register_graphics(context->graphics))
|
||||
{
|
||||
WLog_ERR(TAG, "failed to register graphics");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
xf_gdi_register_update_callbacks(update);
|
||||
}
|
||||
|
||||
xfc->srcBpp = settings->ColorDepth;
|
||||
xfc->sessionWidth = settings->DesktopWidth;
|
||||
@@ -1431,12 +1436,12 @@ static BOOL xf_auto_reconnect(freerdp* instance)
|
||||
}
|
||||
|
||||
/** Main loop for the rdp connection.
|
||||
* It will be run from the thread's entry point (thread_func()).
|
||||
* It initiates the connection, and will continue to run until the session ends,
|
||||
* processing events as they are received.
|
||||
* @param instance - pointer to the rdp_freerdp structure that contains the session's settings
|
||||
* @return A code from the enum XF_EXIT_CODE (0 if successful)
|
||||
*/
|
||||
* It will be run from the thread's entry point (thread_func()).
|
||||
* It initiates the connection, and will continue to run until the session ends,
|
||||
* processing events as they are received.
|
||||
* @param instance - pointer to the rdp_freerdp structure that contains the session's settings
|
||||
* @return A code from the enum XF_EXIT_CODE (0 if successful)
|
||||
*/
|
||||
static void* xf_client_thread(void* param)
|
||||
{
|
||||
BOOL status;
|
||||
@@ -1519,10 +1524,10 @@ static void* xf_client_thread(void* param)
|
||||
while (!xfc->disconnect && !freerdp_shall_disconnect(instance))
|
||||
{
|
||||
/*
|
||||
* win8 and server 2k12 seem to have some timing issue/race condition
|
||||
* when a initial sync request is send to sync the keyboard indicators
|
||||
* sending the sync event twice fixed this problem
|
||||
*/
|
||||
* win8 and server 2k12 seem to have some timing issue/race condition
|
||||
* when a initial sync request is send to sync the keyboard indicators
|
||||
* sending the sync event twice fixed this problem
|
||||
*/
|
||||
if (freerdp_focus_required(instance))
|
||||
{
|
||||
xf_keyboard_focus_in(xfc);
|
||||
@@ -1679,8 +1684,8 @@ static void xf_PanningChangeEventHandler(rdpContext* context,
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Client Interface
|
||||
*/
|
||||
* Client Interface
|
||||
*/
|
||||
|
||||
static BOOL xfreerdp_client_global_init()
|
||||
{
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
#include <freerdp/log.h>
|
||||
#define TAG CLIENT_TAG("x11")
|
||||
|
||||
static UINT8 GDI_BS_HATCHED_PATTERNS[] =
|
||||
static const UINT8 GDI_BS_HATCHED_PATTERNS[] =
|
||||
{
|
||||
0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, /* HS_HORIZONTAL */
|
||||
0xF7, 0xF7, 0xF7, 0xF7, 0xF7, 0xF7, 0xF7, 0xF7, /* HS_VERTICAL */
|
||||
@@ -69,7 +69,7 @@ static const BYTE xf_rop2_table[] =
|
||||
GXset /* 1 */
|
||||
};
|
||||
|
||||
BOOL xf_set_rop2(xfContext* xfc, int rop2)
|
||||
static BOOL xf_set_rop2(xfContext* xfc, int rop2)
|
||||
{
|
||||
if ((rop2 < 0x01) || (rop2 > 0x10))
|
||||
{
|
||||
@@ -81,7 +81,7 @@ BOOL xf_set_rop2(xfContext* xfc, int rop2)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL xf_set_rop3(xfContext* xfc, int rop3)
|
||||
static BOOL xf_set_rop3(xfContext* xfc, int rop3)
|
||||
{
|
||||
int function = -1;
|
||||
|
||||
@@ -218,7 +218,8 @@ BOOL xf_set_rop3(xfContext* xfc, int rop3)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
Pixmap xf_brush_new(xfContext* xfc, int width, int height, int bpp, BYTE* data)
|
||||
static Pixmap xf_brush_new(xfContext* xfc, int width, int height, int bpp,
|
||||
BYTE* data)
|
||||
{
|
||||
GC gc;
|
||||
Pixmap bitmap;
|
||||
@@ -249,7 +250,8 @@ Pixmap xf_brush_new(xfContext* xfc, int width, int height, int bpp, BYTE* data)
|
||||
return bitmap;
|
||||
}
|
||||
|
||||
Pixmap xf_mono_bitmap_new(xfContext* xfc, int width, int height, BYTE* data)
|
||||
static Pixmap xf_mono_bitmap_new(xfContext* xfc, int width, int height,
|
||||
const BYTE* data)
|
||||
{
|
||||
int scanline;
|
||||
XImage* image;
|
||||
@@ -363,26 +365,6 @@ BOOL xf_gdi_bitmap_update(rdpContext* context,
|
||||
return ret;
|
||||
}
|
||||
|
||||
static BOOL xf_gdi_palette_update(rdpContext* context,
|
||||
const PALETTE_UPDATE* palette)
|
||||
{
|
||||
int index;
|
||||
const PALETTE_ENTRY* pe;
|
||||
xfContext* xfc = (xfContext*) context;
|
||||
xf_lock_x11(xfc, FALSE);
|
||||
xfc->context.gdi->palette.format = xfc->format;
|
||||
|
||||
for (index = 0; index < palette->number; index++)
|
||||
{
|
||||
pe = &(palette->entries[index]);
|
||||
xfc->context.gdi->palette.palette[index] = GetColor(xfc->format,
|
||||
pe->red, pe->green, pe->blue, 0xFF);
|
||||
}
|
||||
|
||||
xf_unlock_x11(xfc, FALSE);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static BOOL xf_gdi_set_bounds(rdpContext* context,
|
||||
const rdpBounds* bounds)
|
||||
{
|
||||
@@ -429,7 +411,6 @@ static BOOL xf_gdi_dstblt(rdpContext* context, const DSTBLT_ORDER* dstblt)
|
||||
|
||||
static BOOL xf_gdi_patblt(rdpContext* context, PATBLT_ORDER* patblt)
|
||||
{
|
||||
Pixmap pattern;
|
||||
const rdpBrush* brush;
|
||||
UINT32 foreColor;
|
||||
UINT32 backColor;
|
||||
@@ -455,8 +436,8 @@ static BOOL xf_gdi_patblt(rdpContext* context, PATBLT_ORDER* patblt)
|
||||
}
|
||||
else if (brush->style == GDI_BS_HATCHED)
|
||||
{
|
||||
pattern = xf_mono_bitmap_new(xfc, 8, 8,
|
||||
GDI_BS_HATCHED_PATTERNS + 8 * brush->hatch);
|
||||
Pixmap pattern = xf_mono_bitmap_new(xfc, 8, 8,
|
||||
&GDI_BS_HATCHED_PATTERNS[8 * brush->hatch]);
|
||||
XSetForeground(xfc->display, xfc->gc, backColor);
|
||||
XSetBackground(xfc->display, xfc->gc, foreColor);
|
||||
XSetFillStyle(xfc->display, xfc->gc, FillOpaqueStippled);
|
||||
@@ -470,7 +451,7 @@ static BOOL xf_gdi_patblt(rdpContext* context, PATBLT_ORDER* patblt)
|
||||
{
|
||||
if (brush->bpp > 1)
|
||||
{
|
||||
pattern = xf_brush_new(xfc, 8, 8, brush->bpp, brush->data);
|
||||
Pixmap pattern = xf_brush_new(xfc, 8, 8, brush->bpp, brush->data);
|
||||
XSetFillStyle(xfc->display, xfc->gc, FillTiled);
|
||||
XSetTile(xfc->display, xfc->gc, pattern);
|
||||
XSetTSOrigin(xfc->display, xfc->gc, brush->x, brush->y);
|
||||
@@ -481,7 +462,7 @@ static BOOL xf_gdi_patblt(rdpContext* context, PATBLT_ORDER* patblt)
|
||||
}
|
||||
else
|
||||
{
|
||||
pattern = xf_mono_bitmap_new(xfc, 8, 8, brush->data);
|
||||
Pixmap pattern = xf_mono_bitmap_new(xfc, 8, 8, brush->data);
|
||||
XSetForeground(xfc->display, xfc->gc, backColor);
|
||||
XSetBackground(xfc->display, xfc->gc, foreColor);
|
||||
XSetFillStyle(xfc->display, xfc->gc, FillOpaqueStippled);
|
||||
@@ -613,12 +594,6 @@ static BOOL xf_gdi_multi_opaque_rect(rdpContext* context,
|
||||
return ret;
|
||||
}
|
||||
|
||||
void xf_gdi_draw_nine_grid(rdpContext* context,
|
||||
DRAW_NINE_GRID_ORDER* draw_nine_grid)
|
||||
{
|
||||
WLog_ERR(TAG, "DrawNineGrid");
|
||||
}
|
||||
|
||||
static BOOL xf_gdi_line_to(rdpContext* context, const LINE_TO_ORDER* line_to)
|
||||
{
|
||||
UINT32 color;
|
||||
@@ -1003,20 +978,6 @@ static BOOL xf_gdi_polygon_cb(rdpContext* context,
|
||||
return ret;
|
||||
}
|
||||
|
||||
static BOOL xf_gdi_ellipse_sc(rdpContext* context,
|
||||
const ELLIPSE_SC_ORDER* ellipse_sc)
|
||||
{
|
||||
WLog_ERR(TAG, "Not implemented: EllipseSC");
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static BOOL xf_gdi_ellipse_cb(rdpContext* context,
|
||||
const ELLIPSE_CB_ORDER* ellipse_cb)
|
||||
{
|
||||
WLog_ERR(TAG, "Not implemented: EllipseCB");
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static BOOL xf_gdi_frame_marker(rdpContext* context,
|
||||
const FRAME_MARKER_ORDER* frameMarker)
|
||||
{
|
||||
@@ -1197,30 +1158,18 @@ static BOOL xf_gdi_surface_bits(rdpContext* context,
|
||||
void xf_gdi_register_update_callbacks(rdpUpdate* update)
|
||||
{
|
||||
rdpPrimaryUpdate* primary = update->primary;
|
||||
update->Palette = xf_gdi_palette_update;
|
||||
update->SetBounds = xf_gdi_set_bounds;
|
||||
primary->DstBlt = xf_gdi_dstblt;
|
||||
primary->PatBlt = xf_gdi_patblt;
|
||||
primary->ScrBlt = xf_gdi_scrblt;
|
||||
primary->OpaqueRect = xf_gdi_opaque_rect;
|
||||
primary->DrawNineGrid = NULL;
|
||||
primary->MultiDstBlt = NULL;
|
||||
primary->MultiPatBlt = NULL;
|
||||
primary->MultiScrBlt = NULL;
|
||||
primary->MultiOpaqueRect = xf_gdi_multi_opaque_rect;
|
||||
primary->MultiDrawNineGrid = NULL;
|
||||
primary->LineTo = xf_gdi_line_to;
|
||||
primary->Polyline = xf_gdi_polyline;
|
||||
primary->MemBlt = xf_gdi_memblt;
|
||||
primary->Mem3Blt = xf_gdi_mem3blt;
|
||||
primary->SaveBitmap = NULL;
|
||||
primary->GlyphIndex = NULL;
|
||||
primary->FastIndex = NULL;
|
||||
primary->FastGlyph = NULL;
|
||||
primary->PolygonSC = xf_gdi_polygon_sc;
|
||||
primary->PolygonCB = xf_gdi_polygon_cb;
|
||||
primary->EllipseSC = xf_gdi_ellipse_sc;
|
||||
primary->EllipseCB = xf_gdi_ellipse_cb;
|
||||
update->SurfaceBits = xf_gdi_surface_bits;
|
||||
update->SurfaceFrameMarker = xf_gdi_surface_frame_marker;
|
||||
update->altsec->FrameMarker = xf_gdi_frame_marker;
|
||||
|
||||
@@ -437,20 +437,34 @@ static BOOL xf_Glyph_EndDraw(rdpContext* context, UINT32 x, UINT32 y,
|
||||
}
|
||||
|
||||
/* Graphics Module */
|
||||
BOOL xf_register_pointer(rdpGraphics* graphics)
|
||||
{
|
||||
rdpPointer* pointer = NULL;
|
||||
|
||||
if (!(pointer = (rdpPointer*) calloc(1, sizeof(rdpPointer))))
|
||||
return FALSE;
|
||||
|
||||
pointer->size = sizeof(xfPointer);
|
||||
pointer->New = xf_Pointer_New;
|
||||
pointer->Free = xf_Pointer_Free;
|
||||
pointer->Set = xf_Pointer_Set;
|
||||
pointer->SetNull = xf_Pointer_SetNull;
|
||||
pointer->SetDefault = xf_Pointer_SetDefault;
|
||||
pointer->SetPosition = xf_Pointer_SetPosition;
|
||||
graphics_register_pointer(graphics, pointer);
|
||||
free(pointer);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL xf_register_graphics(rdpGraphics* graphics)
|
||||
{
|
||||
rdpBitmap* bitmap = NULL;
|
||||
rdpPointer* pointer = NULL;
|
||||
rdpGlyph* glyph = NULL;
|
||||
BOOL ret = FALSE;
|
||||
|
||||
if (!(bitmap = (rdpBitmap*) calloc(1, sizeof(rdpBitmap))))
|
||||
goto out;
|
||||
|
||||
if (!(pointer = (rdpPointer*) calloc(1, sizeof(rdpPointer))))
|
||||
goto out;
|
||||
|
||||
if (!(glyph = (rdpGlyph*) calloc(1, sizeof(rdpGlyph))))
|
||||
goto out;
|
||||
|
||||
@@ -461,14 +475,6 @@ BOOL xf_register_graphics(rdpGraphics* graphics)
|
||||
bitmap->Decompress = xf_Bitmap_Decompress;
|
||||
bitmap->SetSurface = xf_Bitmap_SetSurface;
|
||||
graphics_register_bitmap(graphics, bitmap);
|
||||
pointer->size = sizeof(xfPointer);
|
||||
pointer->New = xf_Pointer_New;
|
||||
pointer->Free = xf_Pointer_Free;
|
||||
pointer->Set = xf_Pointer_Set;
|
||||
pointer->SetNull = xf_Pointer_SetNull;
|
||||
pointer->SetDefault = xf_Pointer_SetDefault;
|
||||
pointer->SetPosition = xf_Pointer_SetPosition;
|
||||
graphics_register_pointer(graphics, pointer);
|
||||
glyph->size = sizeof(xfGlyph);
|
||||
glyph->New = xf_Glyph_New;
|
||||
glyph->Free = xf_Glyph_Free;
|
||||
@@ -479,7 +485,6 @@ BOOL xf_register_graphics(rdpGraphics* graphics)
|
||||
ret = TRUE;
|
||||
out:
|
||||
free(bitmap);
|
||||
free(pointer);
|
||||
free(glyph);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
#include "xf_client.h"
|
||||
#include "xfreerdp.h"
|
||||
|
||||
BOOL xf_register_pointer(rdpGraphics* graphics);
|
||||
BOOL xf_register_graphics(rdpGraphics* graphics);
|
||||
|
||||
#endif /* __XF_GRAPHICS_H */
|
||||
|
||||
@@ -43,33 +43,34 @@ typedef BOOL (*pBitmap_Decompress)(rdpContext* context, rdpBitmap* bitmap,
|
||||
const BYTE* data, UINT32 width, UINT32 height,
|
||||
UINT32 bpp, UINT32 length, BOOL compressed,
|
||||
UINT32 codec_id);
|
||||
typedef BOOL (*pBitmap_SetSurface)(rdpContext* context, rdpBitmap* bitmap, BOOL primary);
|
||||
typedef BOOL (*pBitmap_SetSurface)(rdpContext* context, rdpBitmap* bitmap,
|
||||
BOOL primary);
|
||||
|
||||
struct rdp_bitmap
|
||||
{
|
||||
size_t size; /* 0 */
|
||||
pBitmap_New New; /* 1 */
|
||||
pBitmap_Free Free; /* 2 */
|
||||
pBitmap_Paint Paint; /* 3 */
|
||||
pBitmap_Decompress Decompress; /* 4 */
|
||||
pBitmap_SetSurface SetSurface; /* 5 */
|
||||
UINT32 paddingA[16 - 6]; /* 6 */
|
||||
size_t size; /* 0 */
|
||||
pBitmap_New New; /* 1 */
|
||||
pBitmap_Free Free; /* 2 */
|
||||
pBitmap_Paint Paint; /* 3 */
|
||||
pBitmap_Decompress Decompress; /* 4 */
|
||||
pBitmap_SetSurface SetSurface; /* 5 */
|
||||
UINT32 paddingA[16 - 6]; /* 6 */
|
||||
|
||||
UINT32 left; /* 16 */
|
||||
UINT32 top; /* 17 */
|
||||
UINT32 right; /* 18 */
|
||||
UINT32 bottom; /* 19 */
|
||||
UINT32 width; /* 20 */
|
||||
UINT32 height; /* 21 */
|
||||
UINT32 format; /* 22 */
|
||||
UINT32 flags; /* 23 */
|
||||
UINT32 length; /* 24 */
|
||||
BYTE* data; /* 25 */
|
||||
UINT32 paddingB[32 - 26]; /* 26 */
|
||||
UINT32 left; /* 16 */
|
||||
UINT32 top; /* 17 */
|
||||
UINT32 right; /* 18 */
|
||||
UINT32 bottom; /* 19 */
|
||||
UINT32 width; /* 20 */
|
||||
UINT32 height; /* 21 */
|
||||
UINT32 format; /* 22 */
|
||||
UINT32 flags; /* 23 */
|
||||
UINT32 length; /* 24 */
|
||||
BYTE* data; /* 25 */
|
||||
UINT32 paddingB[32 - 26]; /* 26 */
|
||||
|
||||
BOOL compressed; /* 32 */
|
||||
BOOL ephemeral; /* 33 */
|
||||
UINT32 paddingC[64 - 34]; /* 34 */
|
||||
BOOL compressed; /* 32 */
|
||||
BOOL ephemeral; /* 33 */
|
||||
UINT32 paddingC[64 - 34]; /* 34 */
|
||||
};
|
||||
|
||||
FREERDP_API rdpBitmap* Bitmap_Alloc(rdpContext* context);
|
||||
@@ -80,8 +81,10 @@ FREERDP_API BOOL Bitmap_Decompress(rdpContext* context, rdpBitmap* bitmap,
|
||||
BYTE* data, int width, int height, int bpp, int length, BOOL compressed);
|
||||
FREERDP_API void Bitmap_SetRectangle(rdpContext* context, rdpBitmap* bitmap,
|
||||
UINT16 left, UINT16 top, UINT16 right, UINT16 bottom);
|
||||
FREERDP_API void Bitmap_SetDimensions(rdpContext* context, rdpBitmap* bitmap, UINT16 width, UINT16 height);
|
||||
FREERDP_API BOOL Bitmap_SetSurface(rdpContext* context, rdpBitmap* bitmap, BOOL primary);
|
||||
FREERDP_API void Bitmap_SetDimensions(rdpContext* context, rdpBitmap* bitmap,
|
||||
UINT16 width, UINT16 height);
|
||||
FREERDP_API BOOL Bitmap_SetSurface(rdpContext* context, rdpBitmap* bitmap,
|
||||
BOOL primary);
|
||||
|
||||
/* Pointer Class */
|
||||
|
||||
@@ -94,39 +97,34 @@ typedef BOOL (*pPointer_SetPosition)(rdpContext* context, UINT32 x, UINT32 y);
|
||||
|
||||
struct rdp_pointer
|
||||
{
|
||||
size_t size; /* 0 */
|
||||
pPointer_New New; /* 1 */
|
||||
pPointer_Free Free; /* 2 */
|
||||
pPointer_Set Set; /* 3 */
|
||||
pPointer_SetNull SetNull; /* 4*/
|
||||
pPointer_SetDefault SetDefault; /* 5 */
|
||||
pPointer_SetPosition SetPosition; /* 6 */
|
||||
UINT32 paddingA[16 - 7]; /* 7 */
|
||||
size_t size; /* 0 */
|
||||
pPointer_New New; /* 1 */
|
||||
pPointer_Free Free; /* 2 */
|
||||
pPointer_Set Set; /* 3 */
|
||||
pPointer_SetNull SetNull; /* 4*/
|
||||
pPointer_SetDefault SetDefault; /* 5 */
|
||||
pPointer_SetPosition SetPosition; /* 6 */
|
||||
UINT32 paddingA[16 - 7]; /* 7 */
|
||||
|
||||
UINT32 xPos; /* 16 */
|
||||
UINT32 yPos; /* 17 */
|
||||
UINT32 width; /* 18 */
|
||||
UINT32 height; /* 19 */
|
||||
UINT32 xorBpp; /* 20 */
|
||||
UINT32 lengthAndMask; /* 21 */
|
||||
UINT32 lengthXorMask; /* 22 */
|
||||
BYTE* xorMaskData; /* 23 */
|
||||
BYTE* andMaskData; /* 24 */
|
||||
UINT32 paddingB[32 - 25]; /* 25 */
|
||||
UINT32 xPos; /* 16 */
|
||||
UINT32 yPos; /* 17 */
|
||||
UINT32 width; /* 18 */
|
||||
UINT32 height; /* 19 */
|
||||
UINT32 xorBpp; /* 20 */
|
||||
UINT32 lengthAndMask; /* 21 */
|
||||
UINT32 lengthXorMask; /* 22 */
|
||||
BYTE* xorMaskData; /* 23 */
|
||||
BYTE* andMaskData; /* 24 */
|
||||
UINT32 paddingB[32 - 25]; /* 25 */
|
||||
};
|
||||
|
||||
FREERDP_API rdpPointer* Pointer_Alloc(rdpContext* context);
|
||||
FREERDP_API BOOL Pointer_New(rdpContext* context, rdpPointer* pointer);
|
||||
FREERDP_API void Pointer_Free(rdpContext* context, rdpPointer* pointer);
|
||||
FREERDP_API BOOL Pointer_Set(rdpContext* context, const rdpPointer* pointer);
|
||||
FREERDP_API BOOL Pointer_SetNull(rdpContext* context);
|
||||
FREERDP_API BOOL Pointer_SetDefault(rdpContext* context);
|
||||
FREERDP_API BOOL Pointer_SetPosition(rdpContext* context, UINT32 x, UINT32 y);
|
||||
|
||||
/* Glyph Class */
|
||||
typedef BOOL (*pGlyph_New)(rdpContext* context, rdpGlyph* glyph);
|
||||
typedef void (*pGlyph_Free)(rdpContext* context, rdpGlyph* glyph);
|
||||
typedef BOOL (*pGlyph_Draw)(rdpContext* context, rdpGlyph* glyph, UINT32 x, UINT32 y);
|
||||
typedef BOOL (*pGlyph_Draw)(rdpContext* context, rdpGlyph* glyph, UINT32 x,
|
||||
UINT32 y);
|
||||
typedef BOOL (*pGlyph_BeginDraw)(rdpContext* context, UINT32 x, UINT32 y,
|
||||
UINT32 width, UINT32 height, UINT32 bgcolor,
|
||||
UINT32 fgcolor, BOOL fOpRedundant);
|
||||
@@ -135,44 +133,49 @@ typedef BOOL (*pGlyph_EndDraw)(rdpContext* context, UINT32 x, UINT32 y,
|
||||
|
||||
struct rdp_glyph
|
||||
{
|
||||
size_t size; /* 0 */
|
||||
pGlyph_New New; /* 1 */
|
||||
pGlyph_Free Free; /* 2 */
|
||||
pGlyph_Draw Draw; /* 3 */
|
||||
pGlyph_BeginDraw BeginDraw; /* 4 */
|
||||
pGlyph_EndDraw EndDraw; /* 5 */
|
||||
UINT32 paddingA[16 - 6]; /* 6 */
|
||||
size_t size; /* 0 */
|
||||
pGlyph_New New; /* 1 */
|
||||
pGlyph_Free Free; /* 2 */
|
||||
pGlyph_Draw Draw; /* 3 */
|
||||
pGlyph_BeginDraw BeginDraw; /* 4 */
|
||||
pGlyph_EndDraw EndDraw; /* 5 */
|
||||
UINT32 paddingA[16 - 6]; /* 6 */
|
||||
|
||||
INT32 x; /* 16 */
|
||||
INT32 y; /* 17 */
|
||||
UINT32 cx; /* 18 */
|
||||
UINT32 cy; /* 19 */
|
||||
UINT32 cb; /* 20 */
|
||||
BYTE* aj; /* 21 */
|
||||
UINT32 paddingB[32 - 22]; /* 22 */
|
||||
INT32 x; /* 16 */
|
||||
INT32 y; /* 17 */
|
||||
UINT32 cx; /* 18 */
|
||||
UINT32 cy; /* 19 */
|
||||
UINT32 cb; /* 20 */
|
||||
BYTE* aj; /* 21 */
|
||||
UINT32 paddingB[32 - 22]; /* 22 */
|
||||
};
|
||||
|
||||
FREERDP_API rdpGlyph* Glyph_Alloc(rdpContext* context);
|
||||
FREERDP_API BOOL Glyph_New(rdpContext* context, rdpGlyph* glyph);
|
||||
FREERDP_API void Glyph_Free(rdpContext* context, rdpGlyph* glyph);
|
||||
FREERDP_API BOOL Glyph_Draw(rdpContext* context, rdpGlyph* glyph, int x, int y);
|
||||
FREERDP_API BOOL Glyph_BeginDraw(rdpContext* context, int x, int y, int width, int height, UINT32 bgcolor, UINT32 fgcolor, BOOL fOpRedundant);
|
||||
FREERDP_API BOOL Glyph_EndDraw(rdpContext* context, int x, int y, int width, int height, UINT32 bgcolor, UINT32 fgcolor);
|
||||
FREERDP_API BOOL Glyph_BeginDraw(rdpContext* context, int x, int y, int width,
|
||||
int height, UINT32 bgcolor, UINT32 fgcolor, BOOL fOpRedundant);
|
||||
FREERDP_API BOOL Glyph_EndDraw(rdpContext* context, int x, int y, int width,
|
||||
int height, UINT32 bgcolor, UINT32 fgcolor);
|
||||
|
||||
/* Graphics Module */
|
||||
|
||||
struct rdp_graphics
|
||||
{
|
||||
rdpContext* context; /* 0 */
|
||||
rdpBitmap* Bitmap_Prototype; /* 1 */
|
||||
rdpPointer* Pointer_Prototype; /* 2 */
|
||||
rdpGlyph* Glyph_Prototype; /* 3 */
|
||||
UINT32 paddingA[16 - 4]; /* 4 */
|
||||
rdpContext* context; /* 0 */
|
||||
rdpBitmap* Bitmap_Prototype; /* 1 */
|
||||
rdpPointer* Pointer_Prototype; /* 2 */
|
||||
rdpGlyph* Glyph_Prototype; /* 3 */
|
||||
UINT32 paddingA[16 - 4]; /* 4 */
|
||||
};
|
||||
|
||||
FREERDP_API void graphics_register_bitmap(rdpGraphics* graphics, rdpBitmap* bitmap);
|
||||
FREERDP_API void graphics_register_pointer(rdpGraphics* graphics, rdpPointer* pointer);
|
||||
FREERDP_API void graphics_register_glyph(rdpGraphics* graphics, rdpGlyph* glyph);
|
||||
FREERDP_API void graphics_register_bitmap(rdpGraphics* graphics,
|
||||
rdpBitmap* bitmap);
|
||||
FREERDP_API void graphics_register_pointer(rdpGraphics* graphics,
|
||||
rdpPointer* pointer);
|
||||
FREERDP_API void graphics_register_glyph(rdpGraphics* graphics,
|
||||
rdpGlyph* glyph);
|
||||
|
||||
FREERDP_API rdpGraphics* graphics_new(rdpContext* context);
|
||||
FREERDP_API void graphics_free(rdpGraphics* graphics);
|
||||
|
||||
90
libfreerdp/cache/pointer.c
vendored
90
libfreerdp/cache/pointer.c
vendored
@@ -34,40 +34,57 @@
|
||||
#define TAG FREERDP_TAG("cache.pointer")
|
||||
|
||||
static void pointer_cache_put(rdpPointerCache* pointer_cache, UINT32 index,
|
||||
rdpPointer* pointer);
|
||||
static const rdpPointer* pointer_cache_get(rdpPointerCache* pointer_cache, UINT32 index);
|
||||
rdpPointer* pointer);
|
||||
static const rdpPointer* pointer_cache_get(rdpPointerCache* pointer_cache,
|
||||
UINT32 index);
|
||||
|
||||
static BOOL update_pointer_position(rdpContext* context,
|
||||
const POINTER_POSITION_UPDATE* pointer_position)
|
||||
const POINTER_POSITION_UPDATE* pointer_position)
|
||||
{
|
||||
return Pointer_SetPosition(context, pointer_position->xPos, pointer_position->yPos);
|
||||
rdpPointer* pointer;
|
||||
|
||||
if (!context || !context->graphics || !context->graphics->Pointer_Prototype
|
||||
|| !pointer_position)
|
||||
return FALSE;
|
||||
|
||||
pointer = context->graphics->Pointer_Prototype;
|
||||
return pointer->SetPosition(context, pointer_position->xPos,
|
||||
pointer_position->yPos);
|
||||
}
|
||||
|
||||
static BOOL update_pointer_system(rdpContext* context,
|
||||
const POINTER_SYSTEM_UPDATE* pointer_system)
|
||||
const POINTER_SYSTEM_UPDATE* pointer_system)
|
||||
{
|
||||
rdpPointer* pointer;
|
||||
|
||||
if (!context || !context->graphics || !context->graphics->Pointer_Prototype
|
||||
|| !pointer_system)
|
||||
return FALSE;
|
||||
|
||||
pointer = context->graphics->Pointer_Prototype;
|
||||
|
||||
switch (pointer_system->type)
|
||||
{
|
||||
case SYSPTR_NULL:
|
||||
Pointer_SetNull(context);
|
||||
pointer->SetNull(context);
|
||||
break;
|
||||
|
||||
case SYSPTR_DEFAULT:
|
||||
Pointer_SetDefault(context);
|
||||
pointer->SetDefault(context);
|
||||
break;
|
||||
|
||||
default:
|
||||
WLog_ERR(TAG, "Unknown system pointer type (0x%08X)", pointer_system->type);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static BOOL update_pointer_color(rdpContext* context,
|
||||
const POINTER_COLOR_UPDATE* pointer_color)
|
||||
const POINTER_COLOR_UPDATE* pointer_color)
|
||||
{
|
||||
rdpPointer* pointer;
|
||||
rdpCache* cache = context->cache;
|
||||
|
||||
pointer = Pointer_Alloc(context);
|
||||
|
||||
if (pointer != NULL)
|
||||
@@ -83,26 +100,32 @@ static BOOL update_pointer_color(rdpContext* context,
|
||||
if (pointer->lengthAndMask && pointer_color->xorMaskData)
|
||||
{
|
||||
pointer->andMaskData = (BYTE*) malloc(pointer->lengthAndMask);
|
||||
|
||||
if (!pointer->andMaskData)
|
||||
goto out_fail;
|
||||
|
||||
CopyMemory(pointer->andMaskData, pointer_color->andMaskData, pointer->lengthAndMask);
|
||||
CopyMemory(pointer->andMaskData, pointer_color->andMaskData,
|
||||
pointer->lengthAndMask);
|
||||
}
|
||||
|
||||
if (pointer->lengthXorMask && pointer_color->xorMaskData)
|
||||
{
|
||||
pointer->xorMaskData = (BYTE*) malloc(pointer->lengthXorMask);
|
||||
|
||||
if (!pointer->xorMaskData)
|
||||
goto out_fail;
|
||||
CopyMemory(pointer->xorMaskData, pointer_color->xorMaskData, pointer->lengthXorMask);
|
||||
|
||||
CopyMemory(pointer->xorMaskData, pointer_color->xorMaskData,
|
||||
pointer->lengthXorMask);
|
||||
}
|
||||
|
||||
pointer->New(context, pointer);
|
||||
pointer_cache_put(cache->pointer, pointer_color->cacheIndex, pointer);
|
||||
Pointer_Set(context, pointer);
|
||||
pointer->Set(context, pointer);
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
|
||||
return FALSE;
|
||||
out_fail:
|
||||
free(pointer->andMaskData);
|
||||
free(pointer->xorMaskData);
|
||||
@@ -111,12 +134,12 @@ out_fail:
|
||||
}
|
||||
|
||||
static BOOL update_pointer_new(rdpContext* context,
|
||||
const POINTER_NEW_UPDATE* pointer_new)
|
||||
const POINTER_NEW_UPDATE* pointer_new)
|
||||
{
|
||||
rdpPointer* pointer;
|
||||
rdpCache* cache = context->cache;
|
||||
|
||||
pointer = Pointer_Alloc(context);
|
||||
|
||||
if (!pointer)
|
||||
return FALSE;
|
||||
|
||||
@@ -131,24 +154,31 @@ static BOOL update_pointer_new(rdpContext* context,
|
||||
if (pointer->lengthAndMask)
|
||||
{
|
||||
pointer->andMaskData = (BYTE*) malloc(pointer->lengthAndMask);
|
||||
|
||||
if (!pointer->andMaskData)
|
||||
goto out_fail;
|
||||
CopyMemory(pointer->andMaskData, pointer_new->colorPtrAttr.andMaskData, pointer->lengthAndMask);
|
||||
|
||||
CopyMemory(pointer->andMaskData, pointer_new->colorPtrAttr.andMaskData,
|
||||
pointer->lengthAndMask);
|
||||
}
|
||||
|
||||
if (pointer->lengthXorMask)
|
||||
{
|
||||
pointer->xorMaskData = (BYTE*) malloc(pointer->lengthXorMask);
|
||||
|
||||
if (!pointer->xorMaskData)
|
||||
goto out_fail;
|
||||
CopyMemory(pointer->xorMaskData, pointer_new->colorPtrAttr.xorMaskData, pointer->lengthXorMask);
|
||||
|
||||
CopyMemory(pointer->xorMaskData, pointer_new->colorPtrAttr.xorMaskData,
|
||||
pointer->lengthXorMask);
|
||||
}
|
||||
|
||||
if (!pointer->New(context, pointer))
|
||||
goto out_fail;
|
||||
pointer_cache_put(cache->pointer, pointer_new->colorPtrAttr.cacheIndex, pointer);
|
||||
return Pointer_Set(context, pointer);
|
||||
|
||||
pointer_cache_put(cache->pointer, pointer_new->colorPtrAttr.cacheIndex,
|
||||
pointer);
|
||||
return pointer->Set(context, pointer);
|
||||
out_fail:
|
||||
free(pointer->andMaskData);
|
||||
free(pointer->xorMaskData);
|
||||
@@ -157,22 +187,23 @@ out_fail:
|
||||
}
|
||||
|
||||
static BOOL update_pointer_cached(rdpContext* context,
|
||||
const POINTER_CACHED_UPDATE* pointer_cached)
|
||||
const POINTER_CACHED_UPDATE* pointer_cached)
|
||||
{
|
||||
const rdpPointer* pointer;
|
||||
rdpCache* cache = context->cache;
|
||||
|
||||
pointer = pointer_cache_get(cache->pointer, pointer_cached->cacheIndex);
|
||||
|
||||
if (pointer != NULL)
|
||||
{
|
||||
Pointer_Set(context, pointer);
|
||||
pointer->Set(context, pointer);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
const rdpPointer* pointer_cache_get(rdpPointerCache* pointer_cache, UINT32 index)
|
||||
const rdpPointer* pointer_cache_get(rdpPointerCache* pointer_cache,
|
||||
UINT32 index)
|
||||
{
|
||||
const rdpPointer* pointer;
|
||||
|
||||
@@ -183,12 +214,11 @@ const rdpPointer* pointer_cache_get(rdpPointerCache* pointer_cache, UINT32 index
|
||||
}
|
||||
|
||||
pointer = pointer_cache->entries[index];
|
||||
|
||||
return pointer;
|
||||
}
|
||||
|
||||
void pointer_cache_put(rdpPointerCache* pointer_cache, UINT32 index,
|
||||
rdpPointer* pointer)
|
||||
rdpPointer* pointer)
|
||||
{
|
||||
rdpPointer* prevPointer;
|
||||
|
||||
@@ -201,7 +231,7 @@ void pointer_cache_put(rdpPointerCache* pointer_cache, UINT32 index,
|
||||
prevPointer = pointer_cache->entries[index];
|
||||
|
||||
if (prevPointer != NULL)
|
||||
Pointer_Free(pointer_cache->update->context, prevPointer);
|
||||
prevPointer->Free(pointer_cache->update->context, prevPointer);
|
||||
|
||||
pointer_cache->entries[index] = pointer;
|
||||
}
|
||||
@@ -209,7 +239,6 @@ void pointer_cache_put(rdpPointerCache* pointer_cache, UINT32 index,
|
||||
void pointer_cache_register_callbacks(rdpUpdate* update)
|
||||
{
|
||||
rdpPointerUpdate* pointer = update->pointer;
|
||||
|
||||
pointer->PointerPosition = update_pointer_position;
|
||||
pointer->PointerSystem = update_pointer_system;
|
||||
pointer->PointerColor = update_pointer_color;
|
||||
@@ -220,16 +249,17 @@ void pointer_cache_register_callbacks(rdpUpdate* update)
|
||||
rdpPointerCache* pointer_cache_new(rdpSettings* settings)
|
||||
{
|
||||
rdpPointerCache* pointer_cache;
|
||||
|
||||
pointer_cache = (rdpPointerCache*) calloc(1, sizeof(rdpPointerCache));
|
||||
|
||||
if (!pointer_cache)
|
||||
return NULL;
|
||||
|
||||
pointer_cache->settings = settings;
|
||||
pointer_cache->cacheSize = settings->PointerCacheSize;
|
||||
pointer_cache->update = ((freerdp*) settings->instance)->update;
|
||||
pointer_cache->entries = (rdpPointer**) calloc(pointer_cache->cacheSize,
|
||||
sizeof(rdpPointer*));
|
||||
|
||||
pointer_cache->entries = (rdpPointer**) calloc(pointer_cache->cacheSize, sizeof(rdpPointer*));
|
||||
if (!pointer_cache->entries)
|
||||
{
|
||||
free(pointer_cache);
|
||||
@@ -252,7 +282,7 @@ void pointer_cache_free(rdpPointerCache* pointer_cache)
|
||||
|
||||
if (pointer != NULL)
|
||||
{
|
||||
Pointer_Free(pointer_cache->update->context, pointer);
|
||||
pointer->Free(pointer_cache->update->context, pointer);
|
||||
pointer_cache->entries[i] = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ void Bitmap_Free(rdpContext* context, rdpBitmap* bitmap)
|
||||
}
|
||||
|
||||
void Bitmap_SetRectangle(rdpContext* context, rdpBitmap* bitmap, UINT16 left,
|
||||
UINT16 top, UINT16 right, UINT16 bottom)
|
||||
UINT16 top, UINT16 right, UINT16 bottom)
|
||||
{
|
||||
bitmap->left = left;
|
||||
bitmap->top = top;
|
||||
@@ -71,7 +71,7 @@ void Bitmap_SetRectangle(rdpContext* context, rdpBitmap* bitmap, UINT16 left,
|
||||
}
|
||||
|
||||
void Bitmap_SetDimensions(rdpContext* context, rdpBitmap* bitmap, UINT16 width,
|
||||
UINT16 height)
|
||||
UINT16 height)
|
||||
{
|
||||
bitmap->width = width;
|
||||
bitmap->height = height;
|
||||
@@ -81,7 +81,7 @@ void Bitmap_SetDimensions(rdpContext* context, rdpBitmap* bitmap, UINT16 width,
|
||||
BOOL Bitmap_SetSurface(rdpContext* context, rdpBitmap* bitmap, BOOL primary)
|
||||
{
|
||||
return context->graphics->Bitmap_Prototype->SetSurface(context, bitmap,
|
||||
primary);
|
||||
primary);
|
||||
}
|
||||
|
||||
void graphics_register_bitmap(rdpGraphics* graphics, rdpBitmap* bitmap)
|
||||
@@ -105,12 +105,19 @@ rdpPointer* Pointer_Alloc(rdpContext* context)
|
||||
return pointer;
|
||||
}
|
||||
|
||||
BOOL Pointer_New(rdpContext* context, rdpPointer* pointer)
|
||||
static BOOL Pointer_New(rdpContext* context, rdpPointer* pointer)
|
||||
{
|
||||
rdpPointer* proto;
|
||||
|
||||
if (!context || !context->graphics || !context->graphics->Pointer_Prototype)
|
||||
return FALSE;
|
||||
|
||||
proto = context->graphics->Pointer_Prototype;
|
||||
*pointer = *proto;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void Pointer_Free(rdpContext* context, rdpPointer* pointer)
|
||||
static void Pointer_Free(rdpContext* context, rdpPointer* pointer)
|
||||
{
|
||||
if (pointer)
|
||||
{
|
||||
@@ -133,27 +140,6 @@ void Pointer_Free(rdpContext* context, rdpPointer* pointer)
|
||||
}
|
||||
|
||||
/* static method */
|
||||
BOOL Pointer_Set(rdpContext* context, const rdpPointer* pointer)
|
||||
{
|
||||
return context->graphics->Pointer_Prototype->Set(context, pointer);
|
||||
}
|
||||
|
||||
BOOL Pointer_SetNull(rdpContext* context)
|
||||
{
|
||||
return context->graphics->Pointer_Prototype->SetNull(context);
|
||||
}
|
||||
|
||||
BOOL Pointer_SetDefault(rdpContext* context)
|
||||
{
|
||||
return context->graphics->Pointer_Prototype->SetDefault(context);
|
||||
}
|
||||
|
||||
BOOL Pointer_SetPosition(rdpContext* context, UINT32 x, UINT32 y)
|
||||
{
|
||||
return IFCALLRESULT(TRUE, context->graphics->Pointer_Prototype->SetPosition,
|
||||
context, x, y);
|
||||
}
|
||||
|
||||
void graphics_register_pointer(rdpGraphics* graphics, rdpPointer* pointer)
|
||||
{
|
||||
CopyMemory(graphics->Pointer_Prototype, pointer, sizeof(rdpPointer));
|
||||
@@ -192,17 +178,17 @@ BOOL Glyph_Draw(rdpContext* context, rdpGlyph* glyph, int x, int y)
|
||||
}
|
||||
|
||||
BOOL Glyph_BeginDraw(rdpContext* context, int x, int y, int width, int height,
|
||||
UINT32 bgcolor, UINT32 fgcolor, BOOL fOpRedundant)
|
||||
UINT32 bgcolor, UINT32 fgcolor, BOOL fOpRedundant)
|
||||
{
|
||||
return context->graphics->Glyph_Prototype->BeginDraw(context, x, y, width,
|
||||
height, bgcolor, fgcolor, fOpRedundant);
|
||||
height, bgcolor, fgcolor, fOpRedundant);
|
||||
}
|
||||
|
||||
BOOL Glyph_EndDraw(rdpContext* context, int x, int y, int width, int height,
|
||||
UINT32 bgcolor, UINT32 fgcolor)
|
||||
UINT32 bgcolor, UINT32 fgcolor)
|
||||
{
|
||||
return context->graphics->Glyph_Prototype->EndDraw(context, x, y, width, height,
|
||||
bgcolor, fgcolor);
|
||||
bgcolor, fgcolor);
|
||||
}
|
||||
|
||||
void graphics_register_glyph(rdpGraphics* graphics, rdpGlyph* glyph)
|
||||
|
||||
@@ -1130,7 +1130,7 @@ static BOOL gdi_surface_bits(rdpContext* context,
|
||||
* @return
|
||||
*/
|
||||
|
||||
void gdi_register_update_callbacks(rdpUpdate* update)
|
||||
static void gdi_register_update_callbacks(rdpUpdate* update)
|
||||
{
|
||||
rdpPrimaryUpdate* primary = update->primary;
|
||||
update->Palette = gdi_palette_update;
|
||||
|
||||
@@ -243,7 +243,12 @@ static BOOL gdi_Glyph_Draw(rdpContext* context, rdpGlyph* glyph, UINT32 x,
|
||||
UINT32 y)
|
||||
{
|
||||
gdiGlyph* gdi_glyph;
|
||||
rdpGdi* gdi = context->gdi;
|
||||
rdpGdi* gdi;
|
||||
|
||||
if (!context || !glyph)
|
||||
return FALSE;
|
||||
|
||||
gdi = context->gdi;
|
||||
gdi_glyph = (gdiGlyph*) glyph;
|
||||
return gdi_BitBlt(gdi->drawing->hdc, x, y, gdi_glyph->bitmap->width,
|
||||
gdi_glyph->bitmap->height, gdi_glyph->hdc, 0, 0,
|
||||
@@ -266,7 +271,7 @@ static BOOL gdi_Glyph_BeginDraw(rdpContext* context, UINT32 x, UINT32 y,
|
||||
return FALSE;
|
||||
|
||||
if (!(brush = gdi_CreateSolidBrush(fgcolor)))
|
||||
goto out;
|
||||
return FALSE;
|
||||
|
||||
gdi_CRgnToRect(x, y, width, height, &rect);
|
||||
|
||||
@@ -282,7 +287,6 @@ static BOOL gdi_Glyph_BeginDraw(rdpContext* context, UINT32 x, UINT32 y,
|
||||
}
|
||||
|
||||
gdi_DeleteObject((HGDIOBJECT) brush);
|
||||
out:
|
||||
gdi->textColor = gdi_SetTextColor(gdi->drawing->hdc, bgcolor);
|
||||
return ret;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user