cursor: drop ARGB_CURSOR
I doubt anyone builds with this turned off or has done for a long time. It helps my eyes bleed slightly less when reading the code, I've left the define in place as some drivers use it. Reviewed-by: Aaron Plattner <aplattner@nvidia.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
This commit is contained in:
parent
fa12f2c150
commit
8218dadd30
|
@ -80,9 +80,7 @@ FreeCursorBits(CursorBitsPtr bits)
|
||||||
return;
|
return;
|
||||||
free(bits->source);
|
free(bits->source);
|
||||||
free(bits->mask);
|
free(bits->mask);
|
||||||
#ifdef ARGB_CURSOR
|
|
||||||
free(bits->argb);
|
free(bits->argb);
|
||||||
#endif
|
|
||||||
dixFiniPrivates(bits, PRIVATE_CURSOR_BITS);
|
dixFiniPrivates(bits, PRIVATE_CURSOR_BITS);
|
||||||
if (bits->refcnt == 0) {
|
if (bits->refcnt == 0) {
|
||||||
GlyphSharePtr *prev, this;
|
GlyphSharePtr *prev, this;
|
||||||
|
@ -165,7 +163,6 @@ CheckForEmptyMask(CursorBitsPtr bits)
|
||||||
while (n--)
|
while (n--)
|
||||||
if (*(msk++) != 0)
|
if (*(msk++) != 0)
|
||||||
return;
|
return;
|
||||||
#ifdef ARGB_CURSOR
|
|
||||||
if (bits->argb) {
|
if (bits->argb) {
|
||||||
CARD32 *argb = bits->argb;
|
CARD32 *argb = bits->argb;
|
||||||
|
|
||||||
|
@ -174,7 +171,6 @@ CheckForEmptyMask(CursorBitsPtr bits)
|
||||||
if (*argb++ & 0xff000000)
|
if (*argb++ & 0xff000000)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
bits->emptyMask = TRUE;
|
bits->emptyMask = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -259,9 +255,7 @@ AllocARGBCursor(unsigned char *psrcbits, unsigned char *pmaskbits,
|
||||||
dixInitPrivates(bits, bits + 1, PRIVATE_CURSOR_BITS)
|
dixInitPrivates(bits, bits + 1, PRIVATE_CURSOR_BITS)
|
||||||
bits->source = psrcbits;
|
bits->source = psrcbits;
|
||||||
bits->mask = pmaskbits;
|
bits->mask = pmaskbits;
|
||||||
#ifdef ARGB_CURSOR
|
|
||||||
bits->argb = argb;
|
bits->argb = argb;
|
||||||
#endif
|
|
||||||
bits->width = cm->width;
|
bits->width = cm->width;
|
||||||
bits->height = cm->height;
|
bits->height = cm->height;
|
||||||
bits->xhot = cm->xhot;
|
bits->xhot = cm->xhot;
|
||||||
|
@ -400,9 +394,7 @@ AllocGlyphCursor(Font source, unsigned sourceChar, Font mask, unsigned maskChar,
|
||||||
dixInitPrivates(bits, bits + 1, PRIVATE_CURSOR_BITS);
|
dixInitPrivates(bits, bits + 1, PRIVATE_CURSOR_BITS);
|
||||||
bits->source = srcbits;
|
bits->source = srcbits;
|
||||||
bits->mask = mskbits;
|
bits->mask = mskbits;
|
||||||
#ifdef ARGB_CURSOR
|
|
||||||
bits->argb = 0;
|
bits->argb = 0;
|
||||||
#endif
|
|
||||||
bits->width = cm.width;
|
bits->width = cm.width;
|
||||||
bits->height = cm.height;
|
bits->height = cm.height;
|
||||||
bits->xhot = cm.xhot;
|
bits->xhot = cm.xhot;
|
||||||
|
|
|
@ -100,7 +100,6 @@ ephyrRealizeCoreCursor(EphyrScrPriv *scr, CursorPtr cursor)
|
||||||
xcb_free_pixmap(conn, mask);
|
xcb_free_pixmap(conn, mask);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef ARGB_CURSOR
|
|
||||||
static xcb_render_pictformat_t
|
static xcb_render_pictformat_t
|
||||||
get_argb_format(void)
|
get_argb_format(void)
|
||||||
{
|
{
|
||||||
|
@ -170,7 +169,6 @@ can_argb_cursor(void)
|
||||||
|
|
||||||
return v->major_version == 0 && v->minor_version >= 5;
|
return v->major_version == 0 && v->minor_version >= 5;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
static Bool
|
static Bool
|
||||||
ephyrRealizeCursor(DeviceIntPtr dev, ScreenPtr screen, CursorPtr cursor)
|
ephyrRealizeCursor(DeviceIntPtr dev, ScreenPtr screen, CursorPtr cursor)
|
||||||
|
@ -179,11 +177,9 @@ ephyrRealizeCursor(DeviceIntPtr dev, ScreenPtr screen, CursorPtr cursor)
|
||||||
KdScreenInfo *kscr = pScreenPriv->screen;
|
KdScreenInfo *kscr = pScreenPriv->screen;
|
||||||
EphyrScrPriv *scr = kscr->driver;
|
EphyrScrPriv *scr = kscr->driver;
|
||||||
|
|
||||||
#ifdef ARGB_CURSOR
|
|
||||||
if (cursor->bits->argb && can_argb_cursor())
|
if (cursor->bits->argb && can_argb_cursor())
|
||||||
ephyrRealizeARGBCursor(scr, cursor);
|
ephyrRealizeARGBCursor(scr, cursor);
|
||||||
else
|
else
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
ephyrRealizeCoreCursor(scr, cursor);
|
ephyrRealizeCoreCursor(scr, cursor);
|
||||||
}
|
}
|
||||||
|
|
|
@ -258,9 +258,7 @@ xf86_crtc_convert_cursor_to_argb(xf86CrtcPtr crtc, unsigned char *src)
|
||||||
CARD32 bits;
|
CARD32 bits;
|
||||||
const Rotation rotation = xf86_crtc_cursor_rotation(crtc);
|
const Rotation rotation = xf86_crtc_cursor_rotation(crtc);
|
||||||
|
|
||||||
#ifdef ARGB_CURSOR
|
|
||||||
crtc->cursor_argb = FALSE;
|
crtc->cursor_argb = FALSE;
|
||||||
#endif
|
|
||||||
|
|
||||||
for (y = 0; y < cursor_info->MaxHeight; y++)
|
for (y = 0; y < cursor_info->MaxHeight; y++)
|
||||||
for (x = 0; x < cursor_info->MaxWidth; x++) {
|
for (x = 0; x < cursor_info->MaxWidth; x++) {
|
||||||
|
@ -458,9 +456,7 @@ xf86_crtc_load_cursor_image(xf86CrtcPtr crtc, CARD8 *src)
|
||||||
CARD8 *cursor_image;
|
CARD8 *cursor_image;
|
||||||
const Rotation rotation = xf86_crtc_cursor_rotation(crtc);
|
const Rotation rotation = xf86_crtc_cursor_rotation(crtc);
|
||||||
|
|
||||||
#ifdef ARGB_CURSOR
|
|
||||||
crtc->cursor_argb = FALSE;
|
crtc->cursor_argb = FALSE;
|
||||||
#endif
|
|
||||||
|
|
||||||
if (rotation == RR_Rotate_0)
|
if (rotation == RR_Rotate_0)
|
||||||
cursor_image = src;
|
cursor_image = src;
|
||||||
|
@ -632,12 +628,10 @@ xf86_cursors_init(ScreenPtr screen, int max_width, int max_height, int flags)
|
||||||
cursor_info->HideCursor = xf86_hide_cursors;
|
cursor_info->HideCursor = xf86_hide_cursors;
|
||||||
cursor_info->ShowCursor = xf86_show_cursors;
|
cursor_info->ShowCursor = xf86_show_cursors;
|
||||||
cursor_info->UseHWCursor = xf86_use_hw_cursor;
|
cursor_info->UseHWCursor = xf86_use_hw_cursor;
|
||||||
#ifdef ARGB_CURSOR
|
|
||||||
if (flags & HARDWARE_CURSOR_ARGB) {
|
if (flags & HARDWARE_CURSOR_ARGB) {
|
||||||
cursor_info->UseHWCursorARGB = xf86_use_hw_cursor_argb;
|
cursor_info->UseHWCursorARGB = xf86_use_hw_cursor_argb;
|
||||||
cursor_info->LoadCursorARGBCheck = xf86_load_cursor_argb;
|
cursor_info->LoadCursorARGBCheck = xf86_load_cursor_argb;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
xf86_config->cursor = NULL;
|
xf86_config->cursor = NULL;
|
||||||
xf86_hide_cursors(scrn);
|
xf86_hide_cursors(scrn);
|
||||||
|
@ -691,11 +685,9 @@ xf86_reload_cursors(ScreenPtr screen)
|
||||||
void *src =
|
void *src =
|
||||||
dixLookupScreenPrivate(&cursor->devPrivates, CursorScreenKey,
|
dixLookupScreenPrivate(&cursor->devPrivates, CursorScreenKey,
|
||||||
screen);
|
screen);
|
||||||
#ifdef ARGB_CURSOR
|
|
||||||
if (cursor->bits->argb && xf86DriverHasLoadCursorARGB(cursor_info))
|
if (cursor->bits->argb && xf86DriverHasLoadCursorARGB(cursor_info))
|
||||||
xf86DriverLoadCursorARGB(cursor_info, cursor);
|
xf86DriverLoadCursorARGB(cursor_info, cursor);
|
||||||
else if (src)
|
else if (src)
|
||||||
#endif
|
|
||||||
xf86DriverLoadCursorImage(cursor_info, src);
|
xf86DriverLoadCursorImage(cursor_info, src);
|
||||||
|
|
||||||
x += scrn->frameX0 + cursor_screen_priv->HotX;
|
x += scrn->frameX0 + cursor_screen_priv->HotX;
|
||||||
|
|
|
@ -340,12 +340,10 @@ xf86CursorSetCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCurs,
|
||||||
if (infoPtr->pScrn->vtSema && xorg_list_is_empty(&pScreen->pixmap_dirty_list) &&
|
if (infoPtr->pScrn->vtSema && xorg_list_is_empty(&pScreen->pixmap_dirty_list) &&
|
||||||
(ScreenPriv->ForceHWCursorCount ||
|
(ScreenPriv->ForceHWCursorCount ||
|
||||||
((
|
((
|
||||||
#ifdef ARGB_CURSOR
|
|
||||||
cursor->bits->argb &&
|
cursor->bits->argb &&
|
||||||
infoPtr->UseHWCursorARGB &&
|
infoPtr->UseHWCursorARGB &&
|
||||||
(*infoPtr->UseHWCursorARGB)(pScreen, cursor)) ||
|
(*infoPtr->UseHWCursorARGB)(pScreen, cursor)) ||
|
||||||
(cursor->bits->argb == 0 &&
|
(cursor->bits->argb == 0 &&
|
||||||
#endif
|
|
||||||
(cursor->bits->height <= infoPtr->MaxHeight) &&
|
(cursor->bits->height <= infoPtr->MaxHeight) &&
|
||||||
(cursor->bits->width <= infoPtr->MaxWidth) &&
|
(cursor->bits->width <= infoPtr->MaxWidth) &&
|
||||||
(!infoPtr->UseHWCursor || (*infoPtr->UseHWCursor) (pScreen, cursor)))))) {
|
(!infoPtr->UseHWCursor || (*infoPtr->UseHWCursor) (pScreen, cursor)))))) {
|
||||||
|
|
|
@ -19,11 +19,9 @@ typedef struct _xf86CursorInfoRec {
|
||||||
unsigned char *(*RealizeCursor) (struct _xf86CursorInfoRec *, CursorPtr);
|
unsigned char *(*RealizeCursor) (struct _xf86CursorInfoRec *, CursorPtr);
|
||||||
Bool (*UseHWCursor) (ScreenPtr, CursorPtr);
|
Bool (*UseHWCursor) (ScreenPtr, CursorPtr);
|
||||||
|
|
||||||
#ifdef ARGB_CURSOR
|
|
||||||
Bool (*UseHWCursorARGB) (ScreenPtr, CursorPtr);
|
Bool (*UseHWCursorARGB) (ScreenPtr, CursorPtr);
|
||||||
void (*LoadCursorARGB) (ScrnInfoPtr, CursorPtr);
|
void (*LoadCursorARGB) (ScrnInfoPtr, CursorPtr);
|
||||||
Bool (*LoadCursorARGBCheck) (ScrnInfoPtr, CursorPtr);
|
Bool (*LoadCursorARGBCheck) (ScrnInfoPtr, CursorPtr);
|
||||||
#endif
|
|
||||||
|
|
||||||
} xf86CursorInfoRec, *xf86CursorInfoPtr;
|
} xf86CursorInfoRec, *xf86CursorInfoPtr;
|
||||||
|
|
||||||
|
@ -77,8 +75,6 @@ extern _X_EXPORT void xf86ForceHWCursor(ScreenPtr pScreen, Bool on);
|
||||||
#define HARDWARE_CURSOR_NIBBLE_SWAPPED 0x00000800
|
#define HARDWARE_CURSOR_NIBBLE_SWAPPED 0x00000800
|
||||||
#define HARDWARE_CURSOR_SHOW_TRANSPARENT 0x00001000
|
#define HARDWARE_CURSOR_SHOW_TRANSPARENT 0x00001000
|
||||||
#define HARDWARE_CURSOR_UPDATE_UNHIDDEN 0x00002000
|
#define HARDWARE_CURSOR_UPDATE_UNHIDDEN 0x00002000
|
||||||
#ifdef ARGB_CURSOR
|
|
||||||
#define HARDWARE_CURSOR_ARGB 0x00004000
|
#define HARDWARE_CURSOR_ARGB 0x00004000
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* _XF86CURSOR_H */
|
#endif /* _XF86CURSOR_H */
|
||||||
|
|
|
@ -139,9 +139,7 @@ xf86SetCursor(ScreenPtr pScreen, CursorPtr pCurs, int x, int y)
|
||||||
x -= infoPtr->pScrn->frameX0 + ScreenPriv->HotX;
|
x -= infoPtr->pScrn->frameX0 + ScreenPriv->HotX;
|
||||||
y -= infoPtr->pScrn->frameY0 + ScreenPriv->HotY;
|
y -= infoPtr->pScrn->frameY0 + ScreenPriv->HotY;
|
||||||
|
|
||||||
#ifdef ARGB_CURSOR
|
|
||||||
if (!pCurs->bits->argb || !xf86DriverHasLoadCursorARGB(infoPtr))
|
if (!pCurs->bits->argb || !xf86DriverHasLoadCursorARGB(infoPtr))
|
||||||
#endif
|
|
||||||
if (!bits) {
|
if (!bits) {
|
||||||
bits = (*infoPtr->RealizeCursor) (infoPtr, pCurs);
|
bits = (*infoPtr->RealizeCursor) (infoPtr, pCurs);
|
||||||
dixSetScreenPrivate(&pCurs->devPrivates, CursorScreenKey, pScreen,
|
dixSetScreenPrivate(&pCurs->devPrivates, CursorScreenKey, pScreen,
|
||||||
|
@ -151,12 +149,10 @@ xf86SetCursor(ScreenPtr pScreen, CursorPtr pCurs, int x, int y)
|
||||||
if (!(infoPtr->Flags & HARDWARE_CURSOR_UPDATE_UNHIDDEN))
|
if (!(infoPtr->Flags & HARDWARE_CURSOR_UPDATE_UNHIDDEN))
|
||||||
(*infoPtr->HideCursor) (infoPtr->pScrn);
|
(*infoPtr->HideCursor) (infoPtr->pScrn);
|
||||||
|
|
||||||
#ifdef ARGB_CURSOR
|
|
||||||
if (pCurs->bits->argb && xf86DriverHasLoadCursorARGB(infoPtr)) {
|
if (pCurs->bits->argb && xf86DriverHasLoadCursorARGB(infoPtr)) {
|
||||||
if (!xf86DriverLoadCursorARGB (infoPtr, pCurs))
|
if (!xf86DriverLoadCursorARGB (infoPtr, pCurs))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
} else
|
} else
|
||||||
#endif
|
|
||||||
if (bits)
|
if (bits)
|
||||||
if (!xf86DriverLoadCursorImage (infoPtr, bits))
|
if (!xf86DriverLoadCursorImage (infoPtr, bits))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
@ -213,12 +209,10 @@ xf86RecolorCursor(ScreenPtr pScreen, CursorPtr pCurs, Bool displayed)
|
||||||
xf86CursorScreenKey);
|
xf86CursorScreenKey);
|
||||||
xf86CursorInfoPtr infoPtr = ScreenPriv->CursorInfoPtr;
|
xf86CursorInfoPtr infoPtr = ScreenPriv->CursorInfoPtr;
|
||||||
|
|
||||||
#ifdef ARGB_CURSOR
|
|
||||||
/* recoloring isn't applicable to ARGB cursors and drivers
|
/* recoloring isn't applicable to ARGB cursors and drivers
|
||||||
shouldn't have to ignore SetCursorColors requests */
|
shouldn't have to ignore SetCursorColors requests */
|
||||||
if (pCurs->bits->argb)
|
if (pCurs->bits->argb)
|
||||||
return;
|
return;
|
||||||
#endif
|
|
||||||
|
|
||||||
if (ScreenPriv->PalettedCursor) {
|
if (ScreenPriv->PalettedCursor) {
|
||||||
xColorItem sourceColor, maskColor;
|
xColorItem sourceColor, maskColor;
|
||||||
|
|
|
@ -85,7 +85,6 @@ load_cursor(CursorPtr src, int screen)
|
||||||
hot_x = src->bits->xhot;
|
hot_x = src->bits->xhot;
|
||||||
hot_y = src->bits->yhot;
|
hot_y = src->bits->yhot;
|
||||||
|
|
||||||
#ifdef ARGB_CURSOR
|
|
||||||
if (src->bits->argb != NULL) {
|
if (src->bits->argb != NULL) {
|
||||||
#if BITMAP_BIT_ORDER == MSBFirst
|
#if BITMAP_BIT_ORDER == MSBFirst
|
||||||
rowbytes = src->bits->width * sizeof(CARD32);
|
rowbytes = src->bits->width * sizeof(CARD32);
|
||||||
|
@ -104,7 +103,6 @@ load_cursor(CursorPtr src, int screen)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
fg_color = 0xFF00 | (src->foreRed >> 8);
|
fg_color = 0xFF00 | (src->foreRed >> 8);
|
||||||
fg_color <<= 16;
|
fg_color <<= 16;
|
||||||
|
|
|
@ -64,9 +64,7 @@ typedef struct _CursorBits {
|
||||||
unsigned short width, height, xhot, yhot; /* metrics */
|
unsigned short width, height, xhot, yhot; /* metrics */
|
||||||
int refcnt; /* can be shared */
|
int refcnt; /* can be shared */
|
||||||
PrivateRec *devPrivates; /* set by pScr->RealizeCursor */
|
PrivateRec *devPrivates; /* set by pScr->RealizeCursor */
|
||||||
#ifdef ARGB_CURSOR
|
|
||||||
CARD32 *argb; /* full-color alpha blended */
|
CARD32 *argb; /* full-color alpha blended */
|
||||||
#endif
|
|
||||||
} CursorBits, *CursorBitsPtr;
|
} CursorBits, *CursorBitsPtr;
|
||||||
|
|
||||||
#define CURSOR_BITS_SIZE (sizeof(CursorBits) + dixPrivatesSize(PRIVATE_CURSOR_BITS))
|
#define CURSOR_BITS_SIZE (sizeof(CursorBits) + dixPrivatesSize(PRIVATE_CURSOR_BITS))
|
||||||
|
|
|
@ -46,9 +46,7 @@ in this Software without prior written authorization from The Open Group.
|
||||||
#include "misprite.h"
|
#include "misprite.h"
|
||||||
#include "gcstruct.h"
|
#include "gcstruct.h"
|
||||||
|
|
||||||
#ifdef ARGB_CURSOR
|
|
||||||
#include "picturestr.h"
|
#include "picturestr.h"
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "inputstr.h"
|
#include "inputstr.h"
|
||||||
|
|
||||||
|
@ -68,9 +66,7 @@ typedef struct {
|
||||||
GCPtr pSourceGC, pMaskGC;
|
GCPtr pSourceGC, pMaskGC;
|
||||||
GCPtr pSaveGC, pRestoreGC;
|
GCPtr pSaveGC, pRestoreGC;
|
||||||
PixmapPtr pSave;
|
PixmapPtr pSave;
|
||||||
#ifdef ARGB_CURSOR
|
|
||||||
PicturePtr pRootPicture;
|
PicturePtr pRootPicture;
|
||||||
#endif
|
|
||||||
} miDCBufferRec, *miDCBufferPtr;
|
} miDCBufferRec, *miDCBufferPtr;
|
||||||
|
|
||||||
#define miGetDCDevice(dev, screen) \
|
#define miGetDCDevice(dev, screen) \
|
||||||
|
@ -86,9 +82,7 @@ typedef struct {
|
||||||
CloseScreenProcPtr CloseScreen;
|
CloseScreenProcPtr CloseScreen;
|
||||||
PixmapPtr sourceBits; /* source bits */
|
PixmapPtr sourceBits; /* source bits */
|
||||||
PixmapPtr maskBits; /* mask bits */
|
PixmapPtr maskBits; /* mask bits */
|
||||||
#ifdef ARGB_CURSOR
|
|
||||||
PicturePtr pPicture;
|
PicturePtr pPicture;
|
||||||
#endif
|
|
||||||
CursorPtr pCursor;
|
CursorPtr pCursor;
|
||||||
} miDCScreenRec, *miDCScreenPtr;
|
} miDCScreenRec, *miDCScreenPtr;
|
||||||
|
|
||||||
|
@ -133,11 +127,9 @@ miDCSwitchScreenCursor(ScreenPtr pScreen, CursorPtr pCursor, PixmapPtr sourceBit
|
||||||
(*pScreen->DestroyPixmap)(pScreenPriv->maskBits);
|
(*pScreen->DestroyPixmap)(pScreenPriv->maskBits);
|
||||||
pScreenPriv->maskBits = maskBits;
|
pScreenPriv->maskBits = maskBits;
|
||||||
|
|
||||||
#ifdef ARGB_CURSOR
|
|
||||||
if (pScreenPriv->pPicture)
|
if (pScreenPriv->pPicture)
|
||||||
FreePicture(pScreenPriv->pPicture, 0);
|
FreePicture(pScreenPriv->pPicture, 0);
|
||||||
pScreenPriv->pPicture = pPicture;
|
pScreenPriv->pPicture = pPicture;
|
||||||
#endif
|
|
||||||
|
|
||||||
pScreenPriv->pCursor = pCursor;
|
pScreenPriv->pCursor = pCursor;
|
||||||
}
|
}
|
||||||
|
@ -162,7 +154,6 @@ miDCRealizeCursor(ScreenPtr pScreen, CursorPtr pCursor)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef ARGB_CURSOR
|
|
||||||
#define EnsurePicture(picture,draw,win) (picture || miDCMakePicture(&picture,draw,win))
|
#define EnsurePicture(picture,draw,win) (picture || miDCMakePicture(&picture,draw,win))
|
||||||
|
|
||||||
static PicturePtr
|
static PicturePtr
|
||||||
|
@ -182,7 +173,6 @@ miDCMakePicture(PicturePtr * ppPicture, DrawablePtr pDraw, WindowPtr pWin)
|
||||||
*ppPicture = pPicture;
|
*ppPicture = pPicture;
|
||||||
return pPicture;
|
return pPicture;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
static Bool
|
static Bool
|
||||||
miDCRealize(ScreenPtr pScreen, CursorPtr pCursor)
|
miDCRealize(ScreenPtr pScreen, CursorPtr pCursor)
|
||||||
|
@ -195,8 +185,6 @@ miDCRealize(ScreenPtr pScreen, CursorPtr pCursor)
|
||||||
if (pScreenPriv->pCursor == pCursor)
|
if (pScreenPriv->pCursor == pCursor)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
#ifdef ARGB_CURSOR
|
|
||||||
|
|
||||||
if (pCursor->bits->argb) {
|
if (pCursor->bits->argb) {
|
||||||
PixmapPtr pPixmap;
|
PixmapPtr pPixmap;
|
||||||
PictFormatPtr pFormat;
|
PictFormatPtr pFormat;
|
||||||
|
@ -233,7 +221,7 @@ miDCRealize(ScreenPtr pScreen, CursorPtr pCursor)
|
||||||
miDCSwitchScreenCursor(pScreen, pCursor, NULL, NULL, pPicture);
|
miDCSwitchScreenCursor(pScreen, pCursor, NULL, NULL, pPicture);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
sourceBits = (*pScreen->CreatePixmap) (pScreen, pCursor->bits->width,
|
sourceBits = (*pScreen->CreatePixmap) (pScreen, pCursor->bits->width,
|
||||||
pCursor->bits->height, 1, 0);
|
pCursor->bits->height, 1, 0);
|
||||||
if (!sourceBits)
|
if (!sourceBits)
|
||||||
|
@ -373,7 +361,6 @@ miDCPutUpCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor,
|
||||||
pWin = pScreen->root;
|
pWin = pScreen->root;
|
||||||
pBuffer = miGetDCDevice(pDev, pScreen);
|
pBuffer = miGetDCDevice(pDev, pScreen);
|
||||||
|
|
||||||
#ifdef ARGB_CURSOR
|
|
||||||
if (pScreenPriv->pPicture) {
|
if (pScreenPriv->pPicture) {
|
||||||
if (!EnsurePicture(pBuffer->pRootPicture, &pWin->drawable, pWin))
|
if (!EnsurePicture(pBuffer->pRootPicture, &pWin->drawable, pWin))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
@ -385,7 +372,6 @@ miDCPutUpCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor,
|
||||||
x, y, pCursor->bits->width, pCursor->bits->height);
|
x, y, pCursor->bits->width, pCursor->bits->height);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
miDCPutBits((DrawablePtr) pWin,
|
miDCPutBits((DrawablePtr) pWin,
|
||||||
pBuffer->pSourceGC, pBuffer->pMaskGC,
|
pBuffer->pSourceGC, pBuffer->pMaskGC,
|
||||||
|
@ -486,9 +472,7 @@ miDCDeviceInitialize(DeviceIntPtr pDev, ScreenPtr pScreen)
|
||||||
if (!pBuffer->pRestoreGC)
|
if (!pBuffer->pRestoreGC)
|
||||||
goto failure;
|
goto failure;
|
||||||
|
|
||||||
#ifdef ARGB_CURSOR
|
|
||||||
pBuffer->pRootPicture = NULL;
|
pBuffer->pRootPicture = NULL;
|
||||||
#endif
|
|
||||||
|
|
||||||
/* (re)allocated lazily depending on the cursor size */
|
/* (re)allocated lazily depending on the cursor size */
|
||||||
pBuffer->pSave = NULL;
|
pBuffer->pSave = NULL;
|
||||||
|
@ -525,11 +509,9 @@ miDCDeviceCleanup(DeviceIntPtr pDev, ScreenPtr pScreen)
|
||||||
if (pBuffer->pRestoreGC)
|
if (pBuffer->pRestoreGC)
|
||||||
FreeGC(pBuffer->pRestoreGC, (GContext) 0);
|
FreeGC(pBuffer->pRestoreGC, (GContext) 0);
|
||||||
|
|
||||||
#ifdef ARGB_CURSOR
|
|
||||||
/* If a pRootPicture was allocated for a root window, it
|
/* If a pRootPicture was allocated for a root window, it
|
||||||
* is freed when that root window is destroyed, so don't
|
* is freed when that root window is destroyed, so don't
|
||||||
* free it again here. */
|
* free it again here. */
|
||||||
#endif
|
|
||||||
|
|
||||||
if (pBuffer->pSave)
|
if (pBuffer->pSave)
|
||||||
(*pScreen->DestroyPixmap) (pBuffer->pSave);
|
(*pScreen->DestroyPixmap) (pBuffer->pSave);
|
||||||
|
|
|
@ -306,11 +306,9 @@ CopyCursorToImage(CursorPtr pCursor, CARD32 *image)
|
||||||
int height = pCursor->bits->height;
|
int height = pCursor->bits->height;
|
||||||
int npixels = width * height;
|
int npixels = width * height;
|
||||||
|
|
||||||
#ifdef ARGB_CURSOR
|
|
||||||
if (pCursor->bits->argb)
|
if (pCursor->bits->argb)
|
||||||
memcpy(image, pCursor->bits->argb, npixels * sizeof(CARD32));
|
memcpy(image, pCursor->bits->argb, npixels * sizeof(CARD32));
|
||||||
else
|
else
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
unsigned char *srcLine = pCursor->bits->source;
|
unsigned char *srcLine = pCursor->bits->source;
|
||||||
unsigned char *mskLine = pCursor->bits->mask;
|
unsigned char *mskLine = pCursor->bits->mask;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user