summaryrefslogtreecommitdiff
path: root/hw/xwin/wincursor.c
diff options
context:
space:
mode:
authorJon TURNEY <jon.turney@dronecode.org.uk>2013-08-10 12:41:07 +0100
committerJon TURNEY <jon.turney@dronecode.org.uk>2013-08-30 12:58:54 +0100
commit8fa882a980abea6f05b4b59447a187aea2c793a1 (patch)
treee742a9e35681f472749fc3649a4a3f101f723036 /hw/xwin/wincursor.c
parent4bfb2dce5eea4923eaf86eca33b96087b28235f5 (diff)
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>
Diffstat (limited to 'hw/xwin/wincursor.c')
-rw-r--r--hw/xwin/wincursor.c15
1 files 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) {