FreeRDP
gdi.c File Reference
#include <freerdp/config.h>
#include <stdio.h>
#include <stdlib.h>
#include <winpr/crt.h>
#include <winpr/assert.h>
#include <freerdp/api.h>
#include <freerdp/log.h>
#include <freerdp/freerdp.h>
#include <freerdp/gdi/gdi.h>
#include <freerdp/gdi/dc.h>
#include <freerdp/gdi/pen.h>
#include <freerdp/gdi/shape.h>
#include <freerdp/gdi/region.h>
#include <freerdp/gdi/bitmap.h>
#include "drawing.h"
#include "clipping.h"
#include "brush.h"
#include "line.h"
#include "gdi.h"
#include "../core/graphics.h"
#include "../core/update.h"
#include "../cache/cache.h"

Macros

#define TAG   FREERDP_TAG("gdi")
 

Functions

BOOL gdi_decode_color (rdpGdi *gdi, const UINT32 srcColor, UINT32 *color, UINT32 *format)
 
DWORD gdi_rop3_code (BYTE code)
 
const char * gdi_rop3_code_string (BYTE code)
 
const char * gdi_rop3_string (DWORD rop)
 
UINT32 gdi_get_pixel_format (UINT32 bitsPerPixel)
 
gdiBitmap * gdi_bitmap_new_ex (rdpGdi *gdi, int width, int height, int bpp, BYTE *data)
 
void gdi_bitmap_free_ex (gdiBitmap *bitmap)
 
BOOL gdi_bitmap_update (rdpContext *context, const BITMAP_UPDATE *bitmapUpdate)
 
static BOOL gdi_palette_update (rdpContext *context, const PALETTE_UPDATE *palette)
 
static BOOL gdi_set_bounds (rdpContext *context, const rdpBounds *bounds)
 
static BOOL gdi_dstblt (rdpContext *context, const DSTBLT_ORDER *dstblt)
 
static BOOL gdi_patblt (rdpContext *context, PATBLT_ORDER *patblt)
 
static BOOL gdi_scrblt (rdpContext *context, const SCRBLT_ORDER *scrblt)
 
static BOOL gdi_opaque_rect (rdpContext *context, const OPAQUE_RECT_ORDER *opaque_rect)
 
static BOOL gdi_multi_opaque_rect (rdpContext *context, const MULTI_OPAQUE_RECT_ORDER *multi_opaque_rect)
 
static BOOL gdi_line_to (rdpContext *context, const LINE_TO_ORDER *lineTo)
 
static BOOL gdi_polyline (rdpContext *context, const POLYLINE_ORDER *polyline)
 
static BOOL gdi_memblt (rdpContext *context, MEMBLT_ORDER *memblt)
 
static BOOL gdi_mem3blt (rdpContext *context, MEM3BLT_ORDER *mem3blt)
 
static BOOL gdi_polygon_sc (rdpContext *context, const POLYGON_SC_ORDER *polygon_sc)
 
static BOOL gdi_polygon_cb (rdpContext *context, POLYGON_CB_ORDER *polygon_cb)
 
static BOOL gdi_ellipse_sc (rdpContext *context, const ELLIPSE_SC_ORDER *ellipse_sc)
 
static BOOL gdi_ellipse_cb (rdpContext *context, const ELLIPSE_CB_ORDER *ellipse_cb)
 
static BOOL gdi_frame_marker (rdpContext *context, const FRAME_MARKER_ORDER *frameMarker)
 
static BOOL gdi_surface_frame_marker (rdpContext *context, const SURFACE_FRAME_MARKER *surfaceFrameMarker)
 
static BOOL intersect_rect (const rdpGdi *gdi, const SURFACE_BITS_COMMAND *cmd, RECTANGLE_16 *prect)
 
static BOOL gdi_surface_bits (rdpContext *context, const SURFACE_BITS_COMMAND *cmd)
 
static void gdi_register_update_callbacks (rdpUpdate *update)
 
static BOOL gdi_init_primary (rdpGdi *gdi, UINT32 stride, UINT32 format, BYTE *buffer, void(*pfree)(void *), BOOL isLocked)
 
BOOL gdi_resize (rdpGdi *gdi, UINT32 width, UINT32 height)
 
BOOL gdi_resize_ex (rdpGdi *gdi, UINT32 width, UINT32 height, UINT32 stride, UINT32 format, BYTE *buffer, void(*pfree)(void *))
 
BOOL gdi_init (freerdp *instance, UINT32 format)
 
BOOL gdi_init_ex (freerdp *instance, UINT32 format, UINT32 stride, BYTE *buffer, void(*pfree)(void *))
 
void gdi_free (freerdp *instance)
 
BOOL gdi_send_suppress_output (rdpGdi *gdi, BOOL suppress)
 

Variables

static const rop_table_entry rop3_code_table []
 
static const BYTE GDI_BS_HATCHED_PATTERNS []
 

Macro Definition Documentation

◆ TAG

#define TAG   FREERDP_TAG("gdi")

FreeRDP: A Remote Desktop Protocol Implementation GDI Library

Copyright 2010-2011 Marc-Andre Moreau marca.nosp@m.ndre.nosp@m..more.nosp@m.au@g.nosp@m.mail..nosp@m.com Copyright 2016 Armin Novak armin.nosp@m..nov.nosp@m.ak@th.nosp@m.inca.nosp@m.st.co.nosp@m.m Copyright 2016 Thincast Technologies GmbH

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

  http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Function Documentation

◆ gdi_bitmap_free_ex()

void gdi_bitmap_free_ex ( gdiBitmap *  bitmap)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ gdi_bitmap_new_ex()

gdiBitmap* gdi_bitmap_new_ex ( rdpGdi *  gdi,
int  width,
int  height,
int  bpp,
BYTE data 
)
Here is the call graph for this function:

◆ gdi_bitmap_update()

BOOL gdi_bitmap_update ( rdpContext *  context,
const BITMAP_UPDATE bitmapUpdate 
)

FreeRDP: A Remote Desktop Protocol Implementation GDI Library

Copyright 2010-2011 Marc-Andre Moreau marca.nosp@m.ndre.nosp@m..more.nosp@m.au@g.nosp@m.mail..nosp@m.com

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

  http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ gdi_decode_color()

BOOL gdi_decode_color ( rdpGdi *  gdi,
const UINT32  srcColor,
UINT32 *  color,
UINT32 *  format 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ gdi_dstblt()

static BOOL gdi_dstblt ( rdpContext *  context,
const DSTBLT_ORDER dstblt 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ gdi_ellipse_cb()

static BOOL gdi_ellipse_cb ( rdpContext *  context,
const ELLIPSE_CB_ORDER ellipse_cb 
)
static
Here is the caller graph for this function:

◆ gdi_ellipse_sc()

static BOOL gdi_ellipse_sc ( rdpContext *  context,
const ELLIPSE_SC_ORDER ellipse_sc 
)
static
Here is the caller graph for this function:

◆ gdi_frame_marker()

static BOOL gdi_frame_marker ( rdpContext *  context,
const FRAME_MARKER_ORDER frameMarker 
)
static
Here is the caller graph for this function:

◆ gdi_free()

void gdi_free ( freerdp *  instance)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ gdi_get_pixel_format()

UINT32 gdi_get_pixel_format ( UINT32  bitsPerPixel)
Here is the caller graph for this function:

◆ gdi_init()

BOOL gdi_init ( freerdp *  instance,
UINT32  format 
)

Initialize GDI

Parameters
instanceA pointer to the instance to use
formatThe color format for the local framebuffer
Returns
TRUE for success, FALSE for failure
Here is the call graph for this function:
Here is the caller graph for this function:

◆ gdi_init_ex()

BOOL gdi_init_ex ( freerdp *  instance,
UINT32  format,
UINT32  stride,
BYTE buffer,
void(*)(void *)  pfree 
)

Initialize GDI

Parameters
instanceA pointer to the instance to use
formatThe color format for the local framebuffer
strideThe size of a framebuffer line in bytes
bufferA pointer to a buffer to be used as framebuffer
pfreeA custom function pointer to use to free the framebuffer
Returns
TRUE for success, FALSE for failure
Here is the call graph for this function:
Here is the caller graph for this function:

◆ gdi_init_primary()

static BOOL gdi_init_primary ( rdpGdi *  gdi,
UINT32  stride,
UINT32  format,
BYTE buffer,
void(*)(void *)  pfree,
BOOL  isLocked 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ gdi_line_to()

static BOOL gdi_line_to ( rdpContext *  context,
const LINE_TO_ORDER lineTo 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ gdi_mem3blt()

static BOOL gdi_mem3blt ( rdpContext *  context,
MEM3BLT_ORDER mem3blt 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ gdi_memblt()

static BOOL gdi_memblt ( rdpContext *  context,
MEMBLT_ORDER memblt 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ gdi_multi_opaque_rect()

static BOOL gdi_multi_opaque_rect ( rdpContext *  context,
const MULTI_OPAQUE_RECT_ORDER multi_opaque_rect 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ gdi_opaque_rect()

static BOOL gdi_opaque_rect ( rdpContext *  context,
const OPAQUE_RECT_ORDER opaque_rect 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ gdi_palette_update()

static BOOL gdi_palette_update ( rdpContext *  context,
const PALETTE_UPDATE palette 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ gdi_patblt()

static BOOL gdi_patblt ( rdpContext *  context,
PATBLT_ORDER patblt 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ gdi_polygon_cb()

static BOOL gdi_polygon_cb ( rdpContext *  context,
POLYGON_CB_ORDER polygon_cb 
)
static
Here is the caller graph for this function:

◆ gdi_polygon_sc()

static BOOL gdi_polygon_sc ( rdpContext *  context,
const POLYGON_SC_ORDER polygon_sc 
)
static
Here is the caller graph for this function:

◆ gdi_polyline()

static BOOL gdi_polyline ( rdpContext *  context,
const POLYLINE_ORDER polyline 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ gdi_register_update_callbacks()

static void gdi_register_update_callbacks ( rdpUpdate *  update)
static

Register GDI callbacks with libfreerdp-core.

Parameters
updatecurrent instance
Here is the call graph for this function:
Here is the caller graph for this function:

◆ gdi_resize()

BOOL gdi_resize ( rdpGdi *  gdi,
UINT32  width,
UINT32  height 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ gdi_resize_ex()

BOOL gdi_resize_ex ( rdpGdi *  gdi,
UINT32  width,
UINT32  height,
UINT32  stride,
UINT32  format,
BYTE buffer,
void(*)(void *)  pfree 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ gdi_rop3_code()

DWORD gdi_rop3_code ( BYTE  code)
Here is the caller graph for this function:

◆ gdi_rop3_code_string()

const char* gdi_rop3_code_string ( BYTE  code)
Here is the caller graph for this function:

◆ gdi_rop3_string()

const char* gdi_rop3_string ( DWORD  rop)

◆ gdi_scrblt()

static BOOL gdi_scrblt ( rdpContext *  context,
const SCRBLT_ORDER scrblt 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ gdi_send_suppress_output()

BOOL gdi_send_suppress_output ( rdpGdi *  gdi,
BOOL  suppress 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ gdi_set_bounds()

static BOOL gdi_set_bounds ( rdpContext *  context,
const rdpBounds *  bounds 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ gdi_surface_bits()

static BOOL gdi_surface_bits ( rdpContext *  context,
const SURFACE_BITS_COMMAND cmd 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ gdi_surface_frame_marker()

static BOOL gdi_surface_frame_marker ( rdpContext *  context,
const SURFACE_FRAME_MARKER surfaceFrameMarker 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ intersect_rect()

static BOOL intersect_rect ( const rdpGdi *  gdi,
const SURFACE_BITS_COMMAND cmd,
RECTANGLE_16 prect 
)
static
Here is the caller graph for this function:

Variable Documentation

◆ GDI_BS_HATCHED_PATTERNS

const BYTE GDI_BS_HATCHED_PATTERNS[]
static
Initial value:
= {
0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF,
0xF7, 0xF7, 0xF7, 0xF7, 0xF7, 0xF7, 0xF7, 0xF7,
0xFE, 0xFD, 0xFB, 0xF7, 0xEF, 0xDF, 0xBF, 0x7F,
0x7F, 0xBF, 0xDF, 0xEF, 0xF7, 0xFB, 0xFD, 0xFE,
0xF7, 0xF7, 0xF7, 0x00, 0xF7, 0xF7, 0xF7, 0xF7,
0x7E, 0xBD, 0xDB, 0xE7, 0xE7, 0xDB, 0xBD, 0x7E
}

◆ rop3_code_table

const rop_table_entry rop3_code_table[]
static