summaryrefslogtreecommitdiff
path: root/src/lx_cursor.c
diff options
context:
space:
mode:
authorJordan Crouse <jordan.crouse@amd.com>2008-10-07 13:12:19 -0600
committerJordan Crouse <jordan.crouse@amd.com>2008-10-07 13:36:08 -0600
commit1e3fcaaa67dde12a658206f3b0fd07b627a3b61b (patch)
tree80584ae8ba45719840dbc00743350e74ac8635f1 /src/lx_cursor.c
parentf66c9d1928ec9bcde57009c7263f6c8575ad0d0c (diff)
geode: Move the hardware cursor support to full ARGB mode
Diffstat (limited to 'src/lx_cursor.c')
-rw-r--r--src/lx_cursor.c47
1 files changed, 9 insertions, 38 deletions
diff --git a/src/lx_cursor.c b/src/lx_cursor.c
index 64ea9c9..23205c0 100644
--- a/src/lx_cursor.c
+++ b/src/lx_cursor.c
@@ -35,50 +35,21 @@
Bool
LXCursorInit(ScreenPtr pScrn)
{
- return xf86_cursors_init(pScrn, 32, 32,
+ return xf86_cursors_init(pScrn,
+ LX_CURSOR_MAX_WIDTH, LX_CURSOR_MAX_HEIGHT,
HARDWARE_CURSOR_TRUECOLOR_AT_8BPP |
HARDWARE_CURSOR_INVERT_MASK |
HARDWARE_CURSOR_AND_SOURCE_WITH_MASK |
- HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_32);
-}
-
-static int
-_getrow(unsigned char *src, int stride, int x, int y)
-{
- x = ((x & ~31) << 1) | (x & 31);
- src += y * stride;
- return (src[x >> 3] >> (x & 7)) & 1;
-}
-
-static int
-_getmask(unsigned char *src, int stride, int x, int y)
-{
- x = ((x & ~31) << 1) | (1 << 5) | (x & 31);
- src += y * stride;
- return (src[x >> 3] >> (x & 7)) & 1;
+ HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_32 |
+ HARDWARE_CURSOR_ARGB);
}
void
-LXLoadCursorImage(ScrnInfoPtr pScrni, unsigned char *src)
+LXLoadARGBCursorImage(ScrnInfoPtr pScrni, unsigned char *src)
{
GeodeRec *pGeode = GEODEPTR(pScrni);
- unsigned long andMask[32], xorMask[32];
- int y, x;
-
- for (y = 0; y < 32; y++) {
- andMask[y] = (src) ? 0 : ~0;
- xorMask[y] = 0;
- }
-
- if (src != NULL) {
- for (y = 0; y < 32; y++) {
- for (x = 0; x < 32; x++) {
- xorMask[y] |= _getrow(src, 8, x, y) << (31 - x);
- andMask[y] |= _getmask(src, 8, x, y) << (31 - x);
- }
- }
- }
-
- vg_set_mono_cursor_shape32(pGeode->CursorStartOffset, &andMask[0],
- &xorMask[0], 32, 32);
+ vg_set_color_cursor_shape(pGeode->CursorStartOffset, src,
+ LX_CURSOR_MAX_WIDTH, LX_CURSOR_MAX_HEIGHT,
+ LX_CURSOR_MAX_WIDTH * 4, 0, 0);
}
+