[uxtheme]

- Unfortunately ExtCreateRegion does not seem to work, so for the time being use a simpler (and slower) implementation of UXTHEME_RegionFromDibBits that uses multiple calls to CombineRgn

svn path=/branches/GSoC_2011/ThemesSupport/; revision=53224
This commit is contained in:
Giannis Adamopoulos 2011-08-14 10:52:13 +00:00
parent cae9fb95e4
commit 5ceabc031a

View file

@ -1771,8 +1771,12 @@ static HRGN UXTHEME_RegionFromDibBits(RGBQUAD* pBuffer, RGBQUAD* pclrTransparent
{ {
int x, y, xstart; int x, y, xstart;
int cMaxRgnRects, cRgnDataSize, cRgnRects; int cMaxRgnRects, cRgnDataSize, cRgnRects;
#ifdef EXTCREATEREGION_WORKS
RECT* prcCurrent; RECT* prcCurrent;
PRGNDATA prgnData; PRGNDATA prgnData;
#else
HRGN hrgnTemp;
#endif
ULONG clrTransparent, *pclrCurrent; ULONG clrTransparent, *pclrCurrent;
HRGN hrgnRet; HRGN hrgnRet;
@ -1784,10 +1788,14 @@ static HRGN UXTHEME_RegionFromDibBits(RGBQUAD* pBuffer, RGBQUAD* pclrTransparent
cMaxRgnRects = 4* (pRect->bottom-pRect->top); cMaxRgnRects = 4* (pRect->bottom-pRect->top);
cRgnDataSize = sizeof(RGNDATA) + cMaxRgnRects * sizeof(RECT); cRgnDataSize = sizeof(RGNDATA) + cMaxRgnRects * sizeof(RECT);
#ifdef EXTCREATEREGION_WORKS
/* Allocate the region data */ /* Allocate the region data */
prgnData = (PRGNDATA)HeapAlloc(GetProcessHeap(), 0, cRgnDataSize); prgnData = (PRGNDATA)HeapAlloc(GetProcessHeap(), 0, cRgnDataSize);
prcCurrent = (PRECT)prgnData->Buffer; prcCurrent = (PRECT)prgnData->Buffer;
#else
hrgnRet = CreateRectRgn(0,0,0,0);
#endif
/* Calculate the region rects */ /* Calculate the region rects */
y=0; y=0;
@ -1811,6 +1819,7 @@ static HRGN UXTHEME_RegionFromDibBits(RGBQUAD* pBuffer, RGBQUAD* pclrTransparent
pclrCurrent++; pclrCurrent++;
} }
#ifdef EXTCREATEREGION_WORKS
/* Add the scaned line to the region */ /* Add the scaned line to the region */
SetRect(prcCurrent, xstart, y,x,y+1); SetRect(prcCurrent, xstart, y,x,y+1);
prcCurrent++; prcCurrent++;
@ -1827,6 +1836,11 @@ static HRGN UXTHEME_RegionFromDibBits(RGBQUAD* pBuffer, RGBQUAD* pclrTransparent
cRgnDataSize); cRgnDataSize);
prcCurrent = (RECT*)prgnData->Buffer + cRgnRects; prcCurrent = (RECT*)prgnData->Buffer + cRgnRects;
} }
#else
hrgnTemp = CreateRectRgn(xstart, y,x,y+1);
CombineRgn(hrgnRet, hrgnRet, hrgnTemp, RGN_OR );
DeleteObject(hrgnTemp);
#endif
} }
else else
{ {
@ -1837,6 +1851,7 @@ static HRGN UXTHEME_RegionFromDibBits(RGBQUAD* pBuffer, RGBQUAD* pclrTransparent
y++; y++;
} }
#ifdef EXTCREATEREGION_WORKS
/* Fill the region data header */ /* Fill the region data header */
prgnData->rdh.dwSize = sizeof(prgnData->rdh); prgnData->rdh.dwSize = sizeof(prgnData->rdh);
prgnData->rdh.iType = RDH_RECTANGLES; prgnData->rdh.iType = RDH_RECTANGLES;
@ -1849,6 +1864,7 @@ static HRGN UXTHEME_RegionFromDibBits(RGBQUAD* pBuffer, RGBQUAD* pclrTransparent
/* Free the region data*/ /* Free the region data*/
HeapFree(GetProcessHeap(),0,prgnData); HeapFree(GetProcessHeap(),0,prgnData);
#endif
/* return the region*/ /* return the region*/
return hrgnRet; return hrgnRet;