gdi: don't pollute invalid region with empty rects

This commit is contained in:
Norbert Federa 2014-12-05 19:40:40 +01:00
parent 3baaa9a523
commit 443ee42db5
2 changed files with 9 additions and 6 deletions

View File

@ -128,12 +128,6 @@ static void xf_draw_screen_scaled(xfContext* xfc, int x, int y, int w, int h)
return; return;
} }
if (!w || !h)
{
WLog_ERR(TAG, "invalid width and/or height specified");
return;
}
xScalingFactor = xfc->width / (double)xfc->scaledWidth; xScalingFactor = xfc->width / (double)xfc->scaledWidth;
yScalingFactor = xfc->height / (double)xfc->scaledHeight; yScalingFactor = xfc->height / (double)xfc->scaledHeight;
@ -207,6 +201,12 @@ BOOL xf_picture_transform_required(xfContext* xfc)
void xf_draw_screen(xfContext* xfc, int x, int y, int w, int h) void xf_draw_screen(xfContext* xfc, int x, int y, int w, int h)
{ {
if (w == 0 || h == 0)
{
WLog_WARN(TAG, "invalid width and/or height specified: w=%d h=%d", w, h);
return;
}
#ifdef WITH_XRENDER #ifdef WITH_XRENDER
if (xf_picture_transform_required(xfc)) { if (xf_picture_transform_required(xfc)) {
xf_draw_screen_scaled(xfc, x, y, w, h); xf_draw_screen_scaled(xfc, x, y, w, h);

View File

@ -377,6 +377,9 @@ INLINE int gdi_InvalidateRegion(HGDI_DC hdc, int x, int y, int w, int h)
if (!hdc->hwnd->invalid) if (!hdc->hwnd->invalid)
return 0; return 0;
if (w == 0 || h == 0)
return 0;
cinvalid = hdc->hwnd->cinvalid; cinvalid = hdc->hwnd->cinvalid;
if ((hdc->hwnd->ninvalid + 1) > hdc->hwnd->count) if ((hdc->hwnd->ninvalid + 1) > hdc->hwnd->count)