Fixed GDI_RGN->null initialization.

This commit is contained in:
Armin Novak 2016-10-06 13:41:52 +02:00
parent 8f1adf64ee
commit 649d270ccd
14 changed files with 31 additions and 32 deletions

View File

@ -146,7 +146,7 @@ static BOOL android_begin_paint(rdpContext* context)
if (!hwnd || !hwnd->invalid)
return FALSE;
hwnd->invalid->null = 1;
hwnd->invalid->null = TRUE;
hwnd->ninvalid = 0;
return TRUE;
}

View File

@ -61,7 +61,7 @@ void df_context_free(freerdp* instance, rdpContext* context)
void df_begin_paint(rdpContext* context)
{
rdpGdi* gdi = context->gdi;
gdi->primary->hdc->hwnd->invalid->null = 1;
gdi->primary->hdc->hwnd->invalid->null = TRUE;
}
void df_end_paint(rdpContext* context)

View File

@ -1156,7 +1156,7 @@ BOOL mac_begin_paint(rdpContext* context)
if (!gdi)
return FALSE;
gdi->primary->hdc->hwnd->invalid->null = 1;
gdi->primary->hdc->hwnd->invalid->null = TRUE;
return TRUE;
}

View File

@ -59,7 +59,7 @@ static void tf_context_free(freerdp* instance, rdpContext* context)
static BOOL tf_begin_paint(rdpContext* context)
{
rdpGdi* gdi = context->gdi;
gdi->primary->hdc->hwnd->invalid->null = 1;
gdi->primary->hdc->hwnd->invalid->null = TRUE;
return TRUE;
}

View File

@ -53,7 +53,7 @@ static BOOL wl_begin_paint(rdpContext* context)
{
rdpGdi* gdi;
gdi = context->gdi;
gdi->primary->hdc->hwnd->invalid->null = 1;
gdi->primary->hdc->hwnd->invalid->null = TRUE;
return TRUE;
}

View File

@ -127,7 +127,7 @@ static BOOL wf_begin_paint(rdpContext* context)
if (!hdc || !hdc->hwnd || !hdc->hwnd->invalid)
return FALSE;
hdc->hwnd->invalid->null = 1;
hdc->hwnd->invalid->null = TRUE;
hdc->hwnd->ninvalid = 0;
return TRUE;
}

View File

@ -288,7 +288,7 @@ static BOOL xf_desktop_resize(rdpContext* context)
static BOOL xf_sw_begin_paint(rdpContext* context)
{
rdpGdi* gdi = context->gdi;
gdi->primary->hdc->hwnd->invalid->null = 1;
gdi->primary->hdc->hwnd->invalid->null = TRUE;
gdi->primary->hdc->hwnd->ninvalid = 0;
return TRUE;
}
@ -390,7 +390,7 @@ out:
static BOOL xf_hw_begin_paint(rdpContext* context)
{
xfContext* xfc = (xfContext*) context;
xfc->hdc->hwnd->invalid->null = 1;
xfc->hdc->hwnd->invalid->null = TRUE;
xfc->hdc->hwnd->ninvalid = 0;
return TRUE;
}

View File

@ -132,7 +132,7 @@ DWORD ios_ui_verify_changed_certificate(freerdp* instance,
BOOL ios_ui_begin_paint(rdpContext* context)
{
rdpGdi* gdi = context->gdi;
gdi->primary->hdc->hwnd->invalid->null = 1;
gdi->primary->hdc->hwnd->invalid->null = TRUE;
return TRUE;
}
@ -144,7 +144,7 @@ BOOL ios_ui_end_paint(rdpContext* context)
gdi->primary->hdc->hwnd->invalid->y, gdi->primary->hdc->hwnd->invalid->w,
gdi->primary->hdc->hwnd->invalid->h);
if (gdi->primary->hdc->hwnd->invalid->null == 0)
if (!gdi->primary->hdc->hwnd->invalid->null)
[mfi->session performSelectorOnMainThread:@selector(
setNeedsDisplayInRectAsValue:) withObject:[NSValue valueWithCGRect:dirty_rect]
waitUntilDone:NO];

View File

@ -61,7 +61,7 @@ HGDI_RGN gdi_GetClipRgn(HGDI_DC hdc)
BOOL gdi_SetNullClipRgn(HGDI_DC hdc)
{
gdi_SetClipRgn(hdc, 0, 0, 0, 0);
hdc->clip->null = 1;
hdc->clip->null = TRUE;
return TRUE;
}

View File

@ -58,7 +58,7 @@ HGDI_DC gdi_GetDC(void)
return NULL;
}
hDC->clip->null = 1;
hDC->clip->null = TRUE;
hDC->hwnd = NULL;
return hDC;
}
@ -81,7 +81,7 @@ HGDI_DC gdi_CreateDC(UINT32 format)
if (!(hDC->clip = gdi_CreateRectRgn(0, 0, 0, 0)))
goto fail;
hDC->clip->null = 1;
hDC->clip->null = TRUE;
hDC->hwnd = NULL;
hDC->format = format;
@ -91,7 +91,7 @@ HGDI_DC gdi_CreateDC(UINT32 format)
if (!(hDC->hwnd->invalid = gdi_CreateRectRgn(0, 0, 0, 0)))
goto fail;
hDC->hwnd->invalid->null = 1;
hDC->hwnd->invalid->null = TRUE;
hDC->hwnd->count = 32;
if (!(hDC->hwnd->cinvalid = (HGDI_RGN) calloc(hDC->hwnd->count,
@ -125,7 +125,7 @@ HGDI_DC gdi_CreateCompatibleDC(HGDI_DC hdc)
return NULL;
}
hDC->clip->null = 1;
hDC->clip->null = TRUE;
hDC->format = hdc->format;
hDC->drawMode = hdc->drawMode;
hDC->hwnd = NULL;

View File

@ -1146,7 +1146,7 @@ static BOOL gdi_init_primary(rdpGdi* gdi, UINT32 stride, UINT32 format,
if (!(gdi->primary->hdc->hwnd->invalid = gdi_CreateRectRgn(0, 0, 0, 0)))
goto fail_hwnd;
gdi->primary->hdc->hwnd->invalid->null = 1;
gdi->primary->hdc->hwnd->invalid->null = TRUE;
gdi->primary->hdc->hwnd->count = 32;
if (!(gdi->primary->hdc->hwnd->cinvalid = (HGDI_RGN) calloc(

View File

@ -60,7 +60,7 @@ HGDI_RGN gdi_CreateRectRgn(UINT32 nLeftRect, UINT32 nTopRect,
hRgn->y = nTopRect;
hRgn->w = nRightRect - nLeftRect + 1;
hRgn->h = nBottomRect - nTopRect + 1;
hRgn->null = 0;
hRgn->null = FALSE;
return hRgn;
}
@ -312,7 +312,7 @@ INLINE BOOL gdi_SetRgn(HGDI_RGN hRgn, UINT32 nXLeft, UINT32 nYLeft,
hRgn->y = nYLeft;
hRgn->w = nWidth;
hRgn->h = nHeight;
hRgn->null = 0;
hRgn->null = FALSE;
return TRUE;
}
@ -330,7 +330,7 @@ INLINE BOOL gdi_SetRectRgn(HGDI_RGN hRgn, UINT32 nLeftRect, UINT32 nTopRect,
UINT32 nRightRect, UINT32 nBottomRect)
{
gdi_CRectToRgn(nLeftRect, nTopRect, nRightRect, nBottomRect, hRgn);
hRgn->null = 0;
hRgn->null = FALSE;
return TRUE;
}
@ -452,7 +452,7 @@ INLINE BOOL gdi_InvalidateRegion(HGDI_DC hdc, UINT32 x, UINT32 y, UINT32 w,
invalid->y = y;
invalid->w = w;
invalid->h = h;
invalid->null = 0;
invalid->null = FALSE;
return TRUE;
}

View File

@ -33,8 +33,8 @@ static int test_gdi_ClipCoords(void)
gdi_SetNullClipRgn(hdc);
rgn1 = gdi_CreateRectRgn(0, 0, 0, 0);
rgn2 = gdi_CreateRectRgn(0, 0, 0, 0);
rgn1->null = 1;
rgn2->null = 1;
rgn1->null = TRUE;
rgn2->null = TRUE;
/* null clipping region */
gdi_SetNullClipRgn(hdc);
gdi_SetRgn(rgn1, 20, 20, 100, 100);
@ -180,16 +180,16 @@ static int test_gdi_InvalidateRegion(void)
gdi_SetNullClipRgn(hdc);
hdc->hwnd = (HGDI_WND) calloc(1, sizeof(GDI_WND));
hdc->hwnd->invalid = gdi_CreateRectRgn(0, 0, 0, 0);
hdc->hwnd->invalid->null = 1;
hdc->hwnd->invalid->null = TRUE;
invalid = hdc->hwnd->invalid;
hdc->hwnd->count = 16;
hdc->hwnd->cinvalid = (HGDI_RGN) calloc(hdc->hwnd->count, sizeof(GDI_RGN));
rgn1 = gdi_CreateRectRgn(0, 0, 0, 0);
rgn2 = gdi_CreateRectRgn(0, 0, 0, 0);
rgn1->null = 1;
rgn2->null = 1;
rgn1->null = TRUE;
rgn2->null = TRUE;
/* no previous invalid region */
invalid->null = 1;
invalid->null = TRUE;
gdi_SetRgn(rgn1, 300, 300, 100, 100);
gdi_SetRgn(rgn2, 300, 300, 100, 100);
gdi_InvalidateRegion(hdc, rgn1->x, rgn1->y, rgn1->w, rgn1->h);

View File

@ -47,7 +47,7 @@ BOOL shw_begin_paint(rdpContext* context)
shwContext* shw;
rdpGdi* gdi = context->gdi;
shw = (shwContext*) context;
gdi->primary->hdc->hwnd->invalid->null = 1;
gdi->primary->hdc->hwnd->invalid->null = TRUE;
gdi->primary->hdc->hwnd->ninvalid = 0;
return TRUE;
}
@ -62,7 +62,6 @@ BOOL shw_end_paint(rdpContext* context)
shwContext* shw = (shwContext*) context;
winShadowSubsystem* subsystem = shw->subsystem;
rdpShadowSurface* surface = subsystem->server->surface;
ninvalid = gdi->primary->hdc->hwnd->ninvalid;
cinvalid = gdi->primary->hdc->hwnd->cinvalid;
@ -72,8 +71,8 @@ BOOL shw_end_paint(rdpContext* context)
invalidRect.top = cinvalid[index].y;
invalidRect.right = cinvalid[index].x + cinvalid[index].w;
invalidRect.bottom = cinvalid[index].y + cinvalid[index].h;
region16_union_rect(&(surface->invalidRegion), &(surface->invalidRegion), &invalidRect);
region16_union_rect(&(surface->invalidRegion), &(surface->invalidRegion),
&invalidRect);
}
SetEvent(subsystem->RdpUpdateEnterEvent);