FreeRDP
gdi/gfx.c File Reference
#include <freerdp/config.h>
#include "../core/update.h"
#include <freerdp/api.h>
#include <freerdp/log.h>
#include <freerdp/gdi/gfx.h>
#include <freerdp/gdi/region.h>
#include <freerdp/utils/gfx.h>
#include <math.h>

Macros

#define TAG   FREERDP_TAG("gdi")
 

Functions

static BOOL is_rect_valid (const RECTANGLE_16 *rect, size_t width, size_t height)
 
static BOOL is_within_surface (const gdiGfxSurface *surface, const RDPGFX_SURFACE_COMMAND *cmd)
 
static DWORD gfx_align_scanline (DWORD widthInBytes, DWORD alignment)
 
static UINT gdi_ResetGraphics (RdpgfxClientContext *context, const RDPGFX_RESET_GRAPHICS_PDU *resetGraphics)
 
static UINT gdi_OutputUpdate (rdpGdi *gdi, gdiGfxSurface *surface)
 
static UINT gdi_WindowUpdate (RdpgfxClientContext *context, gdiGfxSurface *surface)
 
static UINT gdi_UpdateSurfaces (RdpgfxClientContext *context)
 
static UINT gdi_StartFrame (RdpgfxClientContext *context, const RDPGFX_START_FRAME_PDU *startFrame)
 
static UINT gdi_call_update_surfaces (RdpgfxClientContext *context)
 
static UINT gdi_EndFrame (RdpgfxClientContext *context, const RDPGFX_END_FRAME_PDU *endFrame)
 
static UINT gdi_interFrameUpdate (rdpGdi *gdi, RdpgfxClientContext *context)
 
static UINT gdi_SurfaceCommand_Uncompressed (rdpGdi *gdi, RdpgfxClientContext *context, const RDPGFX_SURFACE_COMMAND *cmd)
 
static UINT gdi_SurfaceCommand_RemoteFX (rdpGdi *gdi, RdpgfxClientContext *context, const RDPGFX_SURFACE_COMMAND *cmd)
 
static UINT gdi_SurfaceCommand_ClearCodec (rdpGdi *gdi, RdpgfxClientContext *context, const RDPGFX_SURFACE_COMMAND *cmd)
 
static UINT gdi_SurfaceCommand_Planar (rdpGdi *gdi, RdpgfxClientContext *context, const RDPGFX_SURFACE_COMMAND *cmd)
 
static UINT gdi_SurfaceCommand_AVC420 (rdpGdi *gdi, RdpgfxClientContext *context, const RDPGFX_SURFACE_COMMAND *cmd)
 
static UINT gdi_SurfaceCommand_AVC444 (rdpGdi *gdi, RdpgfxClientContext *context, const RDPGFX_SURFACE_COMMAND *cmd)
 
static BOOL gdi_apply_alpha (BYTE *data, UINT32 format, UINT32 stride, RECTANGLE_16 *rect, UINT32 startOffsetX, UINT32 count, BYTE a)
 
static UINT gdi_SurfaceCommand_Alpha (rdpGdi *gdi, RdpgfxClientContext *context, const RDPGFX_SURFACE_COMMAND *cmd)
 
static UINT gdi_SurfaceCommand_Progressive (rdpGdi *gdi, RdpgfxClientContext *context, const RDPGFX_SURFACE_COMMAND *cmd)
 
static UINT gdi_SurfaceCommand (RdpgfxClientContext *context, const RDPGFX_SURFACE_COMMAND *cmd)
 
static UINT gdi_DeleteEncodingContext (RdpgfxClientContext *context, const RDPGFX_DELETE_ENCODING_CONTEXT_PDU *deleteEncodingContext)
 
static UINT gdi_CreateSurface (RdpgfxClientContext *context, const RDPGFX_CREATE_SURFACE_PDU *createSurface)
 
static UINT gdi_DeleteSurface (RdpgfxClientContext *context, const RDPGFX_DELETE_SURFACE_PDU *deleteSurface)
 
static BOOL intersect_rect (const RECTANGLE_16 *rect, const gdiGfxSurface *surface, RECTANGLE_16 *prect)
 
static UINT gdi_SolidFill (RdpgfxClientContext *context, const RDPGFX_SOLID_FILL_PDU *solidFill)
 
static UINT gdi_SurfaceToSurface (RdpgfxClientContext *context, const RDPGFX_SURFACE_TO_SURFACE_PDU *surfaceToSurface)
 
static void gdi_GfxCacheEntryFree (gdiGfxCacheEntry *entry)
 
static gdiGfxCacheEntry * gdi_GfxCacheEntryNew (UINT64 cacheKey, UINT32 width, UINT32 height, UINT32 format)
 
static UINT gdi_SurfaceToCache (RdpgfxClientContext *context, const RDPGFX_SURFACE_TO_CACHE_PDU *surfaceToCache)
 
static UINT gdi_CacheToSurface (RdpgfxClientContext *context, const RDPGFX_CACHE_TO_SURFACE_PDU *cacheToSurface)
 
static UINT gdi_CacheImportReply (RdpgfxClientContext *context, const RDPGFX_CACHE_IMPORT_REPLY_PDU *cacheImportReply)
 
static UINT gdi_ImportCacheEntry (RdpgfxClientContext *context, UINT16 cacheSlot, const PERSISTENT_CACHE_ENTRY *importCacheEntry)
 
static UINT gdi_ExportCacheEntry (RdpgfxClientContext *context, UINT16 cacheSlot, PERSISTENT_CACHE_ENTRY *exportCacheEntry)
 
static UINT gdi_EvictCacheEntry (RdpgfxClientContext *context, const RDPGFX_EVICT_CACHE_ENTRY_PDU *evictCacheEntry)
 
static UINT gdi_MapSurfaceToOutput (RdpgfxClientContext *context, const RDPGFX_MAP_SURFACE_TO_OUTPUT_PDU *surfaceToOutput)
 
static UINT gdi_MapSurfaceToScaledOutput (RdpgfxClientContext *context, const RDPGFX_MAP_SURFACE_TO_SCALED_OUTPUT_PDU *surfaceToOutput)
 
static UINT gdi_MapSurfaceToWindow (RdpgfxClientContext *context, const RDPGFX_MAP_SURFACE_TO_WINDOW_PDU *surfaceToWindow)
 
static UINT gdi_MapSurfaceToScaledWindow (RdpgfxClientContext *context, const RDPGFX_MAP_SURFACE_TO_SCALED_WINDOW_PDU *surfaceToWindow)
 
BOOL gdi_graphics_pipeline_init (rdpGdi *gdi, RdpgfxClientContext *gfx)
 
BOOL gdi_graphics_pipeline_init_ex (rdpGdi *gdi, RdpgfxClientContext *gfx, pcRdpgfxMapWindowForSurface map, pcRdpgfxUnmapWindowForSurface unmap, pcRdpgfxUpdateSurfaceArea update)
 
void gdi_graphics_pipeline_uninit (rdpGdi *gdi, RdpgfxClientContext *gfx)
 
const char * rdpgfx_caps_version_str (UINT32 capsVersion)
 

Macro Definition Documentation

◆ TAG

#define TAG   FREERDP_TAG("gdi")

FreeRDP: A Remote Desktop Protocol Implementation GDI Graphics Pipeline

Copyright 2014 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_apply_alpha()

static BOOL gdi_apply_alpha ( BYTE data,
UINT32  format,
UINT32  stride,
RECTANGLE_16 rect,
UINT32  startOffsetX,
UINT32  count,
BYTE  a 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ gdi_CacheImportReply()

static UINT gdi_CacheImportReply ( RdpgfxClientContext *  context,
const RDPGFX_CACHE_IMPORT_REPLY_PDU cacheImportReply 
)
static

Function description

Returns
0 on success, otherwise a Win32 error code
Here is the call graph for this function:
Here is the caller graph for this function:

◆ gdi_CacheToSurface()

static UINT gdi_CacheToSurface ( RdpgfxClientContext *  context,
const RDPGFX_CACHE_TO_SURFACE_PDU cacheToSurface 
)
static

Function description

Returns
0 on success, otherwise a Win32 error code
Here is the call graph for this function:
Here is the caller graph for this function:

◆ gdi_call_update_surfaces()

static UINT gdi_call_update_surfaces ( RdpgfxClientContext *  context)
static
Here is the caller graph for this function:

◆ gdi_CreateSurface()

static UINT gdi_CreateSurface ( RdpgfxClientContext *  context,
const RDPGFX_CREATE_SURFACE_PDU createSurface 
)
static

Function description

Returns
0 on success, otherwise a Win32 error code
Here is the call graph for this function:
Here is the caller graph for this function:

◆ gdi_DeleteEncodingContext()

static UINT gdi_DeleteEncodingContext ( RdpgfxClientContext *  context,
const RDPGFX_DELETE_ENCODING_CONTEXT_PDU deleteEncodingContext 
)
static

Function description

Returns
0 on success, otherwise a Win32 error code
Here is the caller graph for this function:

◆ gdi_DeleteSurface()

static UINT gdi_DeleteSurface ( RdpgfxClientContext *  context,
const RDPGFX_DELETE_SURFACE_PDU deleteSurface 
)
static

Function description

Returns
0 on success, otherwise a Win32 error code
Here is the call graph for this function:
Here is the caller graph for this function:

◆ gdi_EndFrame()

static UINT gdi_EndFrame ( RdpgfxClientContext *  context,
const RDPGFX_END_FRAME_PDU endFrame 
)
static

Function description

Returns
0 on success, otherwise a Win32 error code
Here is the call graph for this function:
Here is the caller graph for this function:

◆ gdi_EvictCacheEntry()

static UINT gdi_EvictCacheEntry ( RdpgfxClientContext *  context,
const RDPGFX_EVICT_CACHE_ENTRY_PDU evictCacheEntry 
)
static

Function description

Returns
0 on success, otherwise a Win32 error code
Here is the call graph for this function:
Here is the caller graph for this function:

◆ gdi_ExportCacheEntry()

static UINT gdi_ExportCacheEntry ( RdpgfxClientContext *  context,
UINT16  cacheSlot,
PERSISTENT_CACHE_ENTRY exportCacheEntry 
)
static
Here is the caller graph for this function:

◆ gdi_GfxCacheEntryFree()

static void gdi_GfxCacheEntryFree ( gdiGfxCacheEntry *  entry)
static
Here is the caller graph for this function:

◆ gdi_GfxCacheEntryNew()

static gdiGfxCacheEntry* gdi_GfxCacheEntryNew ( UINT64  cacheKey,
UINT32  width,
UINT32  height,
UINT32  format 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ gdi_graphics_pipeline_init()

BOOL gdi_graphics_pipeline_init ( rdpGdi *  gdi,
RdpgfxClientContext *  gfx 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ gdi_graphics_pipeline_init_ex()

BOOL gdi_graphics_pipeline_init_ex ( rdpGdi *  gdi,
RdpgfxClientContext *  gfx,
pcRdpgfxMapWindowForSurface  map,
pcRdpgfxUnmapWindowForSurface  unmap,
pcRdpgfxUpdateSurfaceArea  update 
)

gdi->graphicsReset will be removed in FreeRDP v3 from public headers, since the EGFX Reset Graphics PDU seems to be optional. There are still some clients that expect and check it and therefore we simply initialize it with TRUE here for now.

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

◆ gdi_graphics_pipeline_uninit()

void gdi_graphics_pipeline_uninit ( rdpGdi *  gdi,
RdpgfxClientContext *  gfx 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ gdi_ImportCacheEntry()

static UINT gdi_ImportCacheEntry ( RdpgfxClientContext *  context,
UINT16  cacheSlot,
const PERSISTENT_CACHE_ENTRY importCacheEntry 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ gdi_interFrameUpdate()

static UINT gdi_interFrameUpdate ( rdpGdi *  gdi,
RdpgfxClientContext *  context 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ gdi_MapSurfaceToOutput()

static UINT gdi_MapSurfaceToOutput ( RdpgfxClientContext *  context,
const RDPGFX_MAP_SURFACE_TO_OUTPUT_PDU surfaceToOutput 
)
static

Function description

Returns
0 on success, otherwise a Win32 error code
Here is the call graph for this function:
Here is the caller graph for this function:

◆ gdi_MapSurfaceToScaledOutput()

static UINT gdi_MapSurfaceToScaledOutput ( RdpgfxClientContext *  context,
const RDPGFX_MAP_SURFACE_TO_SCALED_OUTPUT_PDU surfaceToOutput 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ gdi_MapSurfaceToScaledWindow()

static UINT gdi_MapSurfaceToScaledWindow ( RdpgfxClientContext *  context,
const RDPGFX_MAP_SURFACE_TO_SCALED_WINDOW_PDU surfaceToWindow 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ gdi_MapSurfaceToWindow()

static UINT gdi_MapSurfaceToWindow ( RdpgfxClientContext *  context,
const RDPGFX_MAP_SURFACE_TO_WINDOW_PDU surfaceToWindow 
)
static

Function description

Returns
0 on success, otherwise a Win32 error code
Here is the call graph for this function:
Here is the caller graph for this function:

◆ gdi_OutputUpdate()

static UINT gdi_OutputUpdate ( rdpGdi *  gdi,
gdiGfxSurface *  surface 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ gdi_ResetGraphics()

static UINT gdi_ResetGraphics ( RdpgfxClientContext *  context,
const RDPGFX_RESET_GRAPHICS_PDU resetGraphics 
)
static

Function description

Returns
0 on success, otherwise a Win32 error code
Here is the call graph for this function:
Here is the caller graph for this function:

◆ gdi_SolidFill()

static UINT gdi_SolidFill ( RdpgfxClientContext *  context,
const RDPGFX_SOLID_FILL_PDU solidFill 
)
static

Function description

Returns
0 on success, otherwise a Win32 error code
Here is the call graph for this function:
Here is the caller graph for this function:

◆ gdi_StartFrame()

static UINT gdi_StartFrame ( RdpgfxClientContext *  context,
const RDPGFX_START_FRAME_PDU startFrame 
)
static

Function description

Returns
0 on success, otherwise a Win32 error code
Here is the caller graph for this function:

◆ gdi_SurfaceCommand()

static UINT gdi_SurfaceCommand ( RdpgfxClientContext *  context,
const RDPGFX_SURFACE_COMMAND cmd 
)
static

Function description

Returns
0 on success, otherwise a Win32 error code
Here is the call graph for this function:
Here is the caller graph for this function:

◆ gdi_SurfaceCommand_Alpha()

static UINT gdi_SurfaceCommand_Alpha ( rdpGdi *  gdi,
RdpgfxClientContext *  context,
const RDPGFX_SURFACE_COMMAND cmd 
)
static

Function description

Returns
0 on success, otherwise a Win32 error code
Here is the call graph for this function:
Here is the caller graph for this function:

◆ gdi_SurfaceCommand_AVC420()

static UINT gdi_SurfaceCommand_AVC420 ( rdpGdi *  gdi,
RdpgfxClientContext *  context,
const RDPGFX_SURFACE_COMMAND cmd 
)
static

Function description

Returns
0 on success, otherwise a Win32 error code
Here is the call graph for this function:
Here is the caller graph for this function:

◆ gdi_SurfaceCommand_AVC444()

static UINT gdi_SurfaceCommand_AVC444 ( rdpGdi *  gdi,
RdpgfxClientContext *  context,
const RDPGFX_SURFACE_COMMAND cmd 
)
static

Function description

Returns
0 on success, otherwise a Win32 error code
Here is the call graph for this function:
Here is the caller graph for this function:

◆ gdi_SurfaceCommand_ClearCodec()

static UINT gdi_SurfaceCommand_ClearCodec ( rdpGdi *  gdi,
RdpgfxClientContext *  context,
const RDPGFX_SURFACE_COMMAND cmd 
)
static

Function description

Returns
0 on success, otherwise a Win32 error code
Here is the call graph for this function:
Here is the caller graph for this function:

◆ gdi_SurfaceCommand_Planar()

static UINT gdi_SurfaceCommand_Planar ( rdpGdi *  gdi,
RdpgfxClientContext *  context,
const RDPGFX_SURFACE_COMMAND cmd 
)
static

Function description

Returns
0 on success, otherwise a Win32 error code
Here is the call graph for this function:
Here is the caller graph for this function:

◆ gdi_SurfaceCommand_Progressive()

static UINT gdi_SurfaceCommand_Progressive ( rdpGdi *  gdi,
RdpgfxClientContext *  context,
const RDPGFX_SURFACE_COMMAND cmd 
)
static

Function description

Returns
0 on success, otherwise a Win32 error code

Note: Since this comes via a Wire-To-Surface-2 PDU the cmd's top/left/right/bottom/width/height members are always zero! The update region is determined during decompression.

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

◆ gdi_SurfaceCommand_RemoteFX()

static UINT gdi_SurfaceCommand_RemoteFX ( rdpGdi *  gdi,
RdpgfxClientContext *  context,
const RDPGFX_SURFACE_COMMAND cmd 
)
static

Function description

Returns
0 on success, otherwise a Win32 error code
Here is the call graph for this function:
Here is the caller graph for this function:

◆ gdi_SurfaceCommand_Uncompressed()

static UINT gdi_SurfaceCommand_Uncompressed ( rdpGdi *  gdi,
RdpgfxClientContext *  context,
const RDPGFX_SURFACE_COMMAND cmd 
)
static

Function description

Returns
0 on success, otherwise a Win32 error code
Here is the call graph for this function:
Here is the caller graph for this function:

◆ gdi_SurfaceToCache()

static UINT gdi_SurfaceToCache ( RdpgfxClientContext *  context,
const RDPGFX_SURFACE_TO_CACHE_PDU surfaceToCache 
)
static

Function description

Returns
0 on success, otherwise a Win32 error code
Here is the call graph for this function:
Here is the caller graph for this function:

◆ gdi_SurfaceToSurface()

static UINT gdi_SurfaceToSurface ( RdpgfxClientContext *  context,
const RDPGFX_SURFACE_TO_SURFACE_PDU surfaceToSurface 
)
static

Function description

Returns
0 on success, otherwise a Win32 error code
Here is the call graph for this function:
Here is the caller graph for this function:

◆ gdi_UpdateSurfaces()

static UINT gdi_UpdateSurfaces ( RdpgfxClientContext *  context)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ gdi_WindowUpdate()

static UINT gdi_WindowUpdate ( RdpgfxClientContext *  context,
gdiGfxSurface *  surface 
)
static
Here is the caller graph for this function:

◆ gfx_align_scanline()

static DWORD gfx_align_scanline ( DWORD  widthInBytes,
DWORD  alignment 
)
static
Here is the caller graph for this function:

◆ intersect_rect()

static BOOL intersect_rect ( const RECTANGLE_16 rect,
const gdiGfxSurface *  surface,
RECTANGLE_16 prect 
)
static
Here is the caller graph for this function:

◆ is_rect_valid()

static BOOL is_rect_valid ( const RECTANGLE_16 rect,
size_t  width,
size_t  height 
)
static
Here is the caller graph for this function:

◆ is_within_surface()

static BOOL is_within_surface ( const gdiGfxSurface *  surface,
const RDPGFX_SURFACE_COMMAND cmd 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ rdpgfx_caps_version_str()

const char* rdpgfx_caps_version_str ( UINT32  capsVersion)

FreeRDP: A Remote Desktop Protocol Implementation

GFX Utils - Helper functions converting something to string

Copyright 2022 Armin Novak armin.nosp@m..nov.nosp@m.ak@th.nosp@m.inca.nosp@m.st.co.nosp@m.m Copyright 2022 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.

Here is the caller graph for this function: