hw/xwin: Fix ARGB cursor conversion on x86_64
Fix erroneous use of unsigned long * for lpBits in winXCursorToHCURSOR() which leads to ARGB cursors being vertically streched on x86_64 by interleaving blank rows of pixels. Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net> Reviewed-by: Marc Haesen <marha@users.sourceforge.net>
This commit is contained in:
parent
4bfb2dce5e
commit
8fa882a980
|
@ -162,7 +162,7 @@ winLoadCursor(ScreenPtr pScreen, CursorPtr pCursor, int screen)
|
||||||
HDC hDC;
|
HDC hDC;
|
||||||
BITMAPV4HEADER bi;
|
BITMAPV4HEADER bi;
|
||||||
BITMAPINFO *pbmi;
|
BITMAPINFO *pbmi;
|
||||||
unsigned long *lpBits;
|
uint32_t *lpBits;
|
||||||
|
|
||||||
WIN_DEBUG_MSG("winLoadCursor: Win32: %dx%d X11: %dx%d hotspot: %d,%d\n",
|
WIN_DEBUG_MSG("winLoadCursor: Win32: %dx%d X11: %dx%d hotspot: %d,%d\n",
|
||||||
pScreenPriv->cursor.sm_cx, pScreenPriv->cursor.sm_cy,
|
pScreenPriv->cursor.sm_cx, pScreenPriv->cursor.sm_cy,
|
||||||
|
@ -256,15 +256,14 @@ winLoadCursor(ScreenPtr pScreen, CursorPtr pCursor, int screen)
|
||||||
bi.bV4AlphaMask = 0xFF000000;
|
bi.bV4AlphaMask = 0xFF000000;
|
||||||
|
|
||||||
lpBits =
|
lpBits =
|
||||||
(unsigned long *) calloc(pScreenPriv->cursor.sm_cx *
|
(uint32_t *) calloc(pScreenPriv->cursor.sm_cx *
|
||||||
pScreenPriv->cursor.sm_cy,
|
pScreenPriv->cursor.sm_cy,
|
||||||
sizeof(unsigned long));
|
sizeof(uint32_t));
|
||||||
|
|
||||||
if (lpBits) {
|
if (lpBits) {
|
||||||
int y;
|
int y;
|
||||||
for (y = 0; y < nCY; y++) {
|
for (y = 0; y < nCY; y++) {
|
||||||
unsigned long *src, *dst;
|
void *src, *dst;
|
||||||
|
|
||||||
src = &(pCursor->bits->argb[y * pCursor->bits->width]);
|
src = &(pCursor->bits->argb[y * pCursor->bits->width]);
|
||||||
dst = &(lpBits[y * pScreenPriv->cursor.sm_cx]);
|
dst = &(lpBits[y * pScreenPriv->cursor.sm_cx]);
|
||||||
memcpy(dst, src, 4 * nCX);
|
memcpy(dst, src, 4 * nCX);
|
||||||
|
@ -304,8 +303,8 @@ winLoadCursor(ScreenPtr pScreen, CursorPtr pCursor, int screen)
|
||||||
pbmiColors[2].rgbReserved = 0;
|
pbmiColors[2].rgbReserved = 0;
|
||||||
|
|
||||||
lpBits =
|
lpBits =
|
||||||
(unsigned long *) calloc(pScreenPriv->cursor.sm_cx *
|
(uint32_t *) calloc(pScreenPriv->cursor.sm_cx *
|
||||||
pScreenPriv->cursor.sm_cy, sizeof(char));
|
pScreenPriv->cursor.sm_cy, sizeof(char));
|
||||||
|
|
||||||
pCur = (unsigned char *) lpBits;
|
pCur = (unsigned char *) lpBits;
|
||||||
if (lpBits) {
|
if (lpBits) {
|
||||||
|
|
Loading…
Reference in New Issue