summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichel Dänzer <michel.daenzer@amd.com>2015-12-24 16:20:49 +0900
committerMichel Dänzer <michel@daenzer.net>2016-03-09 15:58:19 +0900
commitc3e4e9fc5d84bfc17b3ed63f67488ea25ba150ce (patch)
treeb5ef357c14caddc40fbc47c0e1d28a60c8bdefcf
parenta3e681eafa5355b8bb3b099d47983f14f0d5e197 (diff)
xfree86/modes: Refactor xf86_use_hw_cursor_argb to use xf86_use_hw_cursor (v2)
This reduces code duplication. v2: No functional change this time. Reviewed-by: Keith Packard <keithp@keithp.com>
-rw-r--r--hw/xfree86/modes/xf86Cursors.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/hw/xfree86/modes/xf86Cursors.c b/hw/xfree86/modes/xf86Cursors.c
index 321cde775..d3baf0d7e 100644
--- a/hw/xfree86/modes/xf86Cursors.c
+++ b/hw/xfree86/modes/xf86Cursors.c
@@ -535,19 +535,13 @@ xf86_use_hw_cursor_argb(ScreenPtr screen, CursorPtr cursor)
xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
xf86CursorInfoPtr cursor_info = xf86_config->cursor_info;
- cursor = RefCursor(cursor);
- if (xf86_config->cursor)
- FreeCursor(xf86_config->cursor, None);
- xf86_config->cursor = cursor;
+ if (!xf86_use_hw_cursor(screen, cursor))
+ return FALSE;
/* Make sure ARGB support is available */
if ((cursor_info->Flags & HARDWARE_CURSOR_ARGB) == 0)
return FALSE;
- if (cursor->bits->width > cursor_info->MaxWidth ||
- cursor->bits->height > cursor_info->MaxHeight)
- return FALSE;
-
return TRUE;
}