uxtheme: Fix colour errors in UXTHEME_StretchBlt.

This commit is contained in:
Mark Harmstone 2015-04-08 07:43:36 +01:00 committed by Alexandre Julliard
parent b0a9fb6b0d
commit c6b4b4b93e
1 changed files with 16 additions and 5 deletions

View File

@ -293,22 +293,33 @@ static inline BOOL UXTHEME_StretchBlt(HDC hdcDst, int nXOriginDst, int nYOriginD
255, /* SourceConstantAlpha */
AC_SRC_ALPHA /* AlphaFormat */
};
BOOL ret = TRUE;
int old_stretch_mode;
POINT old_brush_org;
old_stretch_mode = SetStretchBltMode(hdcDst, HALFTONE);
SetBrushOrgEx(hdcDst, nXOriginDst, nYOriginDst, &old_brush_org);
if (transparent == ALPHABLEND_BINARY) {
/* Ensure we don't pass any negative values to TransparentBlt */
return TransparentBlt(hdcDst, nXOriginDst, nYOriginDst, abs(nWidthDst), abs(nHeightDst),
ret = TransparentBlt(hdcDst, nXOriginDst, nYOriginDst, abs(nWidthDst), abs(nHeightDst),
hdcSrc, nXOriginSrc, nYOriginSrc, abs(nWidthSrc), abs(nHeightSrc),
transcolor);
}
if ((transparent == ALPHABLEND_NONE) ||
} else if ((transparent == ALPHABLEND_NONE) ||
!AlphaBlend(hdcDst, nXOriginDst, nYOriginDst, nWidthDst, nHeightDst,
hdcSrc, nXOriginSrc, nYOriginSrc, nWidthSrc, nHeightSrc,
blendFunc))
{
return StretchBlt(hdcDst, nXOriginDst, nYOriginDst, nWidthDst, nHeightDst,
ret = StretchBlt(hdcDst, nXOriginDst, nYOriginDst, nWidthDst, nHeightDst,
hdcSrc, nXOriginSrc, nYOriginSrc, nWidthSrc, nHeightSrc,
SRCCOPY);
}
return TRUE;
SetBrushOrgEx(hdcDst, old_brush_org.x, old_brush_org.y, NULL);
SetStretchBltMode(hdcDst, old_stretch_mode);
return ret;
}
/***********************************************************************