From 8fa882a980abea6f05b4b59447a187aea2c793a1 Mon Sep 17 00:00:00 2001 From: Jon TURNEY Date: Sat, 10 Aug 2013 12:41:07 +0100 Subject: [PATCH] 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 Reviewed-by: Colin Harrison Reviewed-by: Marc Haesen --- hw/xwin/wincursor.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/hw/xwin/wincursor.c b/hw/xwin/wincursor.c index 285e1bcc2..a35336a34 100644 --- a/hw/xwin/wincursor.c +++ b/hw/xwin/wincursor.c @@ -162,7 +162,7 @@ winLoadCursor(ScreenPtr pScreen, CursorPtr pCursor, int screen) HDC hDC; BITMAPV4HEADER bi; BITMAPINFO *pbmi; - unsigned long *lpBits; + uint32_t *lpBits; WIN_DEBUG_MSG("winLoadCursor: Win32: %dx%d X11: %dx%d hotspot: %d,%d\n", pScreenPriv->cursor.sm_cx, pScreenPriv->cursor.sm_cy, @@ -256,15 +256,14 @@ winLoadCursor(ScreenPtr pScreen, CursorPtr pCursor, int screen) bi.bV4AlphaMask = 0xFF000000; lpBits = - (unsigned long *) calloc(pScreenPriv->cursor.sm_cx * - pScreenPriv->cursor.sm_cy, - sizeof(unsigned long)); + (uint32_t *) calloc(pScreenPriv->cursor.sm_cx * + pScreenPriv->cursor.sm_cy, + sizeof(uint32_t)); if (lpBits) { int y; for (y = 0; y < nCY; y++) { - unsigned long *src, *dst; - + void *src, *dst; src = &(pCursor->bits->argb[y * pCursor->bits->width]); dst = &(lpBits[y * pScreenPriv->cursor.sm_cx]); memcpy(dst, src, 4 * nCX); @@ -304,8 +303,8 @@ winLoadCursor(ScreenPtr pScreen, CursorPtr pCursor, int screen) pbmiColors[2].rgbReserved = 0; lpBits = - (unsigned long *) calloc(pScreenPriv->cursor.sm_cx * - pScreenPriv->cursor.sm_cy, sizeof(char)); + (uint32_t *) calloc(pScreenPriv->cursor.sm_cx * + pScreenPriv->cursor.sm_cy, sizeof(char)); pCur = (unsigned char *) lpBits; if (lpBits) {