Eliminate MAXSCREENS-sized CursorScreenKey array.
Use new per-screen privates API instead. Commit by Jamey Sharp and Josh Triplett. Signed-off-by: Jamey Sharp <jamey@minilop.net> Signed-off-by: Josh Triplett <josh@joshtriplett.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
c96a43888c
commit
8f69c935f6
|
@ -72,7 +72,7 @@ typedef struct _GlyphShare {
|
||||||
|
|
||||||
static GlyphSharePtr sharedGlyphs = (GlyphSharePtr)NULL;
|
static GlyphSharePtr sharedGlyphs = (GlyphSharePtr)NULL;
|
||||||
|
|
||||||
DevPrivateKeyRec cursorScreenDevPriv[MAXSCREENS];
|
DevScreenPrivateKeyRec cursorScreenDevPriv;
|
||||||
|
|
||||||
#ifdef XFIXES
|
#ifdef XFIXES
|
||||||
static CARD32 cursorSerial;
|
static CARD32 cursorSerial;
|
||||||
|
|
|
@ -3911,7 +3911,7 @@ AddScreen(
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
dixRegisterPrivateKey(&cursorScreenDevPriv[i], PRIVATE_CURSOR, 0);
|
dixRegisterScreenPrivateKey(&cursorScreenDevPriv, pScreen, PRIVATE_CURSOR, 0);
|
||||||
|
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
|
|
@ -64,9 +64,9 @@ extern void dmxBECreateCursor(ScreenPtr pScreen, CursorPtr pCursor);
|
||||||
extern Bool dmxBEFreeCursor(ScreenPtr pScreen, CursorPtr pCursor);
|
extern Bool dmxBEFreeCursor(ScreenPtr pScreen, CursorPtr pCursor);
|
||||||
|
|
||||||
#define DMX_GET_CURSOR_PRIV(_pCursor, _pScreen) ((dmxCursorPrivPtr) \
|
#define DMX_GET_CURSOR_PRIV(_pCursor, _pScreen) ((dmxCursorPrivPtr) \
|
||||||
dixLookupPrivate(&(_pCursor)->devPrivates, CursorScreenKey(_pScreen)))
|
dixLookupScreenPrivate(&(_pCursor)->devPrivates, CursorScreenKey, _pScreen))
|
||||||
|
|
||||||
#define DMX_SET_CURSOR_PRIV(_pCursor, _pScreen, v) \
|
#define DMX_SET_CURSOR_PRIV(_pCursor, _pScreen, v) \
|
||||||
dixSetPrivate(&(_pCursor)->devPrivates, CursorScreenKey(_pScreen), v)
|
dixSetScreenPrivate(&(_pCursor)->devPrivates, CursorScreenKey, _pScreen, v)
|
||||||
|
|
||||||
#endif /* DMXCURSOR_H */
|
#endif /* DMXCURSOR_H */
|
||||||
|
|
|
@ -252,7 +252,7 @@ xf86_set_cursor_colors (ScrnInfoPtr scrn, int bg, int fg)
|
||||||
CursorPtr cursor = xf86_config->cursor;
|
CursorPtr cursor = xf86_config->cursor;
|
||||||
int c;
|
int c;
|
||||||
CARD8 *bits = cursor ?
|
CARD8 *bits = cursor ?
|
||||||
dixLookupPrivate(&cursor->devPrivates, CursorScreenKey(screen))
|
dixLookupScreenPrivate(&cursor->devPrivates, CursorScreenKey, screen)
|
||||||
: NULL;
|
: NULL;
|
||||||
|
|
||||||
/* Save ARGB versions of these colors */
|
/* Save ARGB versions of these colors */
|
||||||
|
@ -650,7 +650,7 @@ xf86_reload_cursors (ScreenPtr screen)
|
||||||
|
|
||||||
if (cursor)
|
if (cursor)
|
||||||
{
|
{
|
||||||
void *src = dixLookupPrivate(&cursor->devPrivates, CursorScreenKey(screen));
|
void *src = dixLookupScreenPrivate(&cursor->devPrivates, CursorScreenKey, screen);
|
||||||
#ifdef ARGB_CURSOR
|
#ifdef ARGB_CURSOR
|
||||||
if (cursor->bits->argb && cursor_info->LoadCursorARGB)
|
if (cursor->bits->argb && cursor_info->LoadCursorARGB)
|
||||||
(*cursor_info->LoadCursorARGB) (scrn, cursor);
|
(*cursor_info->LoadCursorARGB) (scrn, cursor);
|
||||||
|
|
|
@ -273,7 +273,7 @@ xf86CursorRealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCurs)
|
||||||
&pScreen->devPrivates, xf86CursorScreenKey);
|
&pScreen->devPrivates, xf86CursorScreenKey);
|
||||||
|
|
||||||
if (pCurs->refcnt <= 1)
|
if (pCurs->refcnt <= 1)
|
||||||
dixSetPrivate(&pCurs->devPrivates, CursorScreenKey(pScreen), NULL);
|
dixSetScreenPrivate(&pCurs->devPrivates, CursorScreenKey, pScreen, NULL);
|
||||||
|
|
||||||
return (*ScreenPriv->spriteFuncs->RealizeCursor)(pDev, pScreen, pCurs);
|
return (*ScreenPriv->spriteFuncs->RealizeCursor)(pDev, pScreen, pCurs);
|
||||||
}
|
}
|
||||||
|
@ -286,8 +286,8 @@ xf86CursorUnrealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen,
|
||||||
&pScreen->devPrivates, xf86CursorScreenKey);
|
&pScreen->devPrivates, xf86CursorScreenKey);
|
||||||
|
|
||||||
if (pCurs->refcnt <= 1) {
|
if (pCurs->refcnt <= 1) {
|
||||||
free(dixLookupPrivate(&pCurs->devPrivates, CursorScreenKey(pScreen)));
|
free(dixLookupScreenPrivate(&pCurs->devPrivates, CursorScreenKey, pScreen));
|
||||||
dixSetPrivate(&pCurs->devPrivates, CursorScreenKey(pScreen), NULL);
|
dixSetScreenPrivate(&pCurs->devPrivates, CursorScreenKey, pScreen, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
return (*ScreenPriv->spriteFuncs->UnrealizeCursor)(pDev, pScreen, pCurs);
|
return (*ScreenPriv->spriteFuncs->UnrealizeCursor)(pDev, pScreen, pCurs);
|
||||||
|
|
|
@ -123,7 +123,7 @@ xf86SetCursor(ScreenPtr pScreen, CursorPtr pCurs, int x, int y)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
bits = dixLookupPrivate(&pCurs->devPrivates, CursorScreenKey(pScreen));
|
bits = dixLookupScreenPrivate(&pCurs->devPrivates, CursorScreenKey, pScreen);
|
||||||
|
|
||||||
x -= infoPtr->pScrn->frameX0 + ScreenPriv->HotX;
|
x -= infoPtr->pScrn->frameX0 + ScreenPriv->HotX;
|
||||||
y -= infoPtr->pScrn->frameY0 + ScreenPriv->HotY;
|
y -= infoPtr->pScrn->frameY0 + ScreenPriv->HotY;
|
||||||
|
@ -133,7 +133,7 @@ xf86SetCursor(ScreenPtr pScreen, CursorPtr pCurs, int x, int y)
|
||||||
#endif
|
#endif
|
||||||
if (!bits) {
|
if (!bits) {
|
||||||
bits = (*infoPtr->RealizeCursor)(infoPtr, pCurs);
|
bits = (*infoPtr->RealizeCursor)(infoPtr, pCurs);
|
||||||
dixSetPrivate(&pCurs->devPrivates, CursorScreenKey(pScreen), bits);
|
dixSetScreenPrivate(&pCurs->devPrivates, CursorScreenKey, pScreen, bits);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(infoPtr->Flags & HARDWARE_CURSOR_UPDATE_UNHIDDEN))
|
if (!(infoPtr->Flags & HARDWARE_CURSOR_UPDATE_UNHIDDEN))
|
||||||
|
|
|
@ -30,10 +30,10 @@ typedef struct {
|
||||||
} xnestPrivCursor;
|
} xnestPrivCursor;
|
||||||
|
|
||||||
#define xnestGetCursorPriv(pCursor, pScreen) ((xnestPrivCursor *) \
|
#define xnestGetCursorPriv(pCursor, pScreen) ((xnestPrivCursor *) \
|
||||||
dixLookupPrivate(&(pCursor)->devPrivates, CursorScreenKey(pScreen)))
|
dixLookupScreenPrivate(&(pCursor)->devPrivates, CursorScreenKey, pScreen))
|
||||||
|
|
||||||
#define xnestSetCursorPriv(pCursor, pScreen, v) \
|
#define xnestSetCursorPriv(pCursor, pScreen, v) \
|
||||||
dixSetPrivate(&(pCursor)->devPrivates, CursorScreenKey(pScreen), v)
|
dixSetScreenPrivate(&(pCursor)->devPrivates, CursorScreenKey, pScreen, v)
|
||||||
|
|
||||||
#define xnestCursor(pCursor, pScreen) \
|
#define xnestCursor(pCursor, pScreen) \
|
||||||
(xnestGetCursorPriv(pCursor, pScreen)->cursor)
|
(xnestGetCursorPriv(pCursor, pScreen)->cursor)
|
||||||
|
|
|
@ -63,8 +63,8 @@ struct _DeviceIntRec;
|
||||||
typedef struct _Cursor *CursorPtr;
|
typedef struct _Cursor *CursorPtr;
|
||||||
typedef struct _CursorMetric *CursorMetricPtr;
|
typedef struct _CursorMetric *CursorMetricPtr;
|
||||||
|
|
||||||
extern _X_EXPORT DevPrivateKeyRec cursorScreenDevPriv[MAXSCREENS];
|
extern _X_EXPORT DevScreenPrivateKeyRec cursorScreenDevPriv;
|
||||||
#define CursorScreenKey(pScreen) (cursorScreenDevPriv + (pScreen)->myNum)
|
#define CursorScreenKey (&cursorScreenDevPriv)
|
||||||
|
|
||||||
extern _X_EXPORT CursorPtr rootCursor;
|
extern _X_EXPORT CursorPtr rootCursor;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue