mirror of
https://github.com/morgan9e/FreeRDP
synced 2026-04-15 00:44:19 +09:00
[warnings] fix -Wunused-function
* delete unused functions that are no longer required * define guard functions only used while debugging
This commit is contained in:
@@ -48,6 +48,8 @@
|
||||
|
||||
#define TAG SERVER_TAG("shadow.x11")
|
||||
|
||||
// #define USE_SHADOW_BLEND_CURSOR
|
||||
|
||||
static UINT32 x11_shadow_enum_monitors(MONITOR_DEF* monitors, UINT32 maxMonitors);
|
||||
|
||||
#ifdef WITH_PAM
|
||||
@@ -589,54 +591,19 @@ static int x11_shadow_handle_xevent(x11ShadowSubsystem* subsystem, XEvent* xeven
|
||||
return 1;
|
||||
}
|
||||
|
||||
static void x11_shadow_validate_region(x11ShadowSubsystem* subsystem, int x, int y, int width,
|
||||
int height)
|
||||
{
|
||||
XRectangle region;
|
||||
|
||||
if (!subsystem->use_xfixes || !subsystem->use_xdamage)
|
||||
return;
|
||||
|
||||
region.x = WINPR_ASSERTING_INT_CAST(INT16, x);
|
||||
region.y = WINPR_ASSERTING_INT_CAST(INT16, y);
|
||||
region.width = WINPR_ASSERTING_INT_CAST(UINT16, width);
|
||||
region.height = WINPR_ASSERTING_INT_CAST(UINT16, height);
|
||||
#if defined(WITH_XFIXES) && defined(WITH_XDAMAGE)
|
||||
XLockDisplay(subsystem->display);
|
||||
XFixesSetRegion(subsystem->display, subsystem->xdamage_region, ®ion, 1);
|
||||
XDamageSubtract(subsystem->display, subsystem->xdamage, subsystem->xdamage_region, None);
|
||||
XUnlockDisplay(subsystem->display);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if defined(USE_SHADOW_BLEND_CURSOR)
|
||||
static int x11_shadow_blend_cursor(x11ShadowSubsystem* subsystem)
|
||||
{
|
||||
UINT32 nXSrc = 0;
|
||||
UINT32 nYSrc = 0;
|
||||
INT64 nXDst = 0;
|
||||
INT64 nYDst = 0;
|
||||
UINT32 nWidth = 0;
|
||||
UINT32 nHeight = 0;
|
||||
UINT32 nSrcStep = 0;
|
||||
UINT32 nDstStep = 0;
|
||||
BYTE* pSrcData = NULL;
|
||||
BYTE* pDstData = NULL;
|
||||
BYTE A = 0;
|
||||
BYTE R = 0;
|
||||
BYTE G = 0;
|
||||
BYTE B = 0;
|
||||
rdpShadowSurface* surface = NULL;
|
||||
|
||||
if (!subsystem)
|
||||
return -1;
|
||||
|
||||
surface = subsystem->common.server->surface;
|
||||
nXSrc = 0;
|
||||
nYSrc = 0;
|
||||
nWidth = subsystem->cursorWidth;
|
||||
nHeight = subsystem->cursorHeight;
|
||||
nXDst = subsystem->common.pointerX - subsystem->cursorHotX;
|
||||
nYDst = subsystem->common.pointerY - subsystem->cursorHotY;
|
||||
rdpShadowSurface* surface = subsystem->common.server->surface;
|
||||
UINT32 nXSrc = 0;
|
||||
UINT32 nYSrc = 0;
|
||||
UINT32 nWidth = subsystem->cursorWidth;
|
||||
UINT32 nHeight = subsystem->cursorHeight;
|
||||
INT64 nXDst = subsystem->common.pointerX - subsystem->cursorHotX;
|
||||
INT64 nYDst = subsystem->common.pointerY - subsystem->cursorHotY;
|
||||
|
||||
if (nXDst >= surface->width)
|
||||
return 1;
|
||||
@@ -674,10 +641,10 @@ static int x11_shadow_blend_cursor(x11ShadowSubsystem* subsystem)
|
||||
if ((nYDst + nHeight) > surface->height)
|
||||
nHeight = (nYDst > surface->height) ? 0 : (UINT32)(surface->height - nYDst);
|
||||
|
||||
pSrcData = subsystem->cursorPixels;
|
||||
nSrcStep = subsystem->cursorWidth * 4;
|
||||
pDstData = surface->data;
|
||||
nDstStep = surface->scanline;
|
||||
const BYTE* pSrcData = subsystem->cursorPixels;
|
||||
const UINT32 nSrcStep = subsystem->cursorWidth * 4;
|
||||
BYTE* pDstData = surface->data;
|
||||
const UINT32 nDstStep = surface->scanline;
|
||||
|
||||
for (size_t y = 0; y < nHeight; y++)
|
||||
{
|
||||
@@ -687,10 +654,10 @@ static int x11_shadow_blend_cursor(x11ShadowSubsystem* subsystem)
|
||||
|
||||
for (size_t x = 0; x < nWidth; x++)
|
||||
{
|
||||
B = *pSrcPixel++;
|
||||
G = *pSrcPixel++;
|
||||
R = *pSrcPixel++;
|
||||
A = *pSrcPixel++;
|
||||
const BYTE B = *pSrcPixel++;
|
||||
const BYTE G = *pSrcPixel++;
|
||||
const BYTE R = *pSrcPixel++;
|
||||
const BYTE A = *pSrcPixel++;
|
||||
|
||||
if (A == 0xFF)
|
||||
{
|
||||
@@ -712,6 +679,7 @@ static int x11_shadow_blend_cursor(x11ShadowSubsystem* subsystem)
|
||||
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
static BOOL x11_shadow_check_resize(x11ShadowSubsystem* subsystem)
|
||||
{
|
||||
@@ -876,7 +844,10 @@ static int x11_shadow_screen_grab(x11ShadowSubsystem* subsystem)
|
||||
if (!success)
|
||||
goto fail_capture;
|
||||
|
||||
// x11_shadow_blend_cursor(subsystem);
|
||||
#if defined(USE_SHADOW_BLEND_CURSOR)
|
||||
if (x11_shadow_blend_cursor(subsystem) < 0)
|
||||
goto fail_capture;
|
||||
#endif
|
||||
count = ArrayList_Count(server->clients);
|
||||
shadow_subsystem_frame_update(&subsystem->common);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user