mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2025-12-27 21:00:07 +01:00
Use dixRequestPrivate to request glyph private storage.
This commit is contained in:
parent
84ddb6de62
commit
f6328963c6
2 changed files with 4 additions and 8 deletions
|
|
@ -390,6 +390,9 @@ Bool dmxPictureInit(ScreenPtr pScreen, PictFormatPtr formats, int nformats)
|
|||
if (!dixRequestPrivate(dmxPictPrivateKey, sizeof(dmxPictPrivRec)))
|
||||
return FALSE;
|
||||
|
||||
if (!dixRequestPrivate(dmxGlyphSetPrivateKey, sizeof(dmxGlyphPrivRec)))
|
||||
return FALSE;
|
||||
|
||||
ps = GetPictureScreen(pScreen);
|
||||
|
||||
DMX_WRAP(CreatePicture, dmxCreatePicture, dmxScreen, ps);
|
||||
|
|
@ -525,11 +528,9 @@ static int dmxProcRenderCreateGlyphSet(ClientPtr client)
|
|||
|
||||
glyphSet = SecurityLookupIDByType(client, stuff->gsid, GlyphSetType,
|
||||
DixDestroyAccess);
|
||||
glyphPriv = xalloc(sizeof(dmxGlyphPrivRec));
|
||||
if (!glyphPriv) return BadAlloc;
|
||||
glyphPriv = DMX_GET_GLYPH_PRIV(glyphSet);
|
||||
glyphPriv->glyphSets = NULL;
|
||||
MAXSCREENSALLOC_RETURN(glyphPriv->glyphSets, BadAlloc);
|
||||
DMX_SET_GLYPH_PRIV(glyphSet, glyphPriv);
|
||||
|
||||
for (i = 0; i < dmxNumScreens; i++) {
|
||||
DMXScreenInfo *dmxScreen = &dmxScreens[i];
|
||||
|
|
@ -582,8 +583,6 @@ static int dmxProcRenderFreeGlyphSet(ClientPtr client)
|
|||
}
|
||||
|
||||
MAXSCREENSFREE(glyphPriv->glyphSets);
|
||||
xfree(glyphPriv);
|
||||
DMX_SET_GLYPH_PRIV(glyphSet, NULL);
|
||||
}
|
||||
|
||||
return dmxSaveRenderVector[stuff->renderReqType](client);
|
||||
|
|
|
|||
|
|
@ -124,9 +124,6 @@ extern DevPrivateKey dmxGlyphSetPrivateKey; /**< Index for glyphset private data
|
|||
#define DMX_GET_PICT_PRIV(_pPict) \
|
||||
(dmxPictPrivPtr)dixLookupPrivate(&(_pPict)->devPrivates, dmxPictPrivateKey)
|
||||
|
||||
/** Set the glyphset private data given a glyphset pointer */
|
||||
#define DMX_SET_GLYPH_PRIV(_pGlyph, _pPriv) \
|
||||
GlyphSetSetPrivate((_pGlyph), dmxGlyphSetPrivateKey, (_pPriv))
|
||||
/** Get the glyphset private data given a glyphset pointer */
|
||||
#define DMX_GET_GLYPH_PRIV(_pGlyph) \
|
||||
(dmxGlyphPrivPtr)GlyphSetGetPrivate((_pGlyph), dmxGlyphSetPrivateKey)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue