summaryrefslogtreecommitdiff
path: root/xserver/render/glyph.c
diff options
context:
space:
mode:
authorMatthieu Herrb <matthieu@cvs.openbsd.org>2010-12-05 15:36:12 +0000
committerMatthieu Herrb <matthieu@cvs.openbsd.org>2010-12-05 15:36:12 +0000
commita90ee792d96752ad1b71b9ada922fa6afe478c99 (patch)
tree6143b00f7646951d23dfe2a4fe2992ca40b77069 /xserver/render/glyph.c
parentbc97d4ecc0aa9e1b823565b07282f848700bd11a (diff)
Upgrade to xorg-server 1.9.2.
Tested by ajacoutot@, krw@, shadchin@ and jasper@ on various configurations including multihead with both zaphod and xrandr.
Diffstat (limited to 'xserver/render/glyph.c')
-rw-r--r--xserver/render/glyph.c57
1 files changed, 21 insertions, 36 deletions
diff --git a/xserver/render/glyph.c b/xserver/render/glyph.c
index f0f3b1913..7193d4763 100644
--- a/xserver/render/glyph.c
+++ b/xserver/render/glyph.c
@@ -84,19 +84,13 @@ static const CARD8 glyphDepths[GlyphFormatNum] = { 1, 4, 8, 16, 32 };
static GlyphHashRec globalGlyphs[GlyphFormatNum];
-static void
-FreeGlyphPrivates (GlyphPtr glyph)
-{
- dixFreePrivates(glyph->devPrivates);
- glyph->devPrivates = NULL;
-}
-
void
GlyphUninit (ScreenPtr pScreen)
{
PictureScreenPtr ps = GetPictureScreen (pScreen);
GlyphPtr glyph;
int fdepth, i;
+ int scrno = pScreen->myNum;
for (fdepth = 0; fdepth < GlyphFormatNum; fdepth++)
{
@@ -108,20 +102,15 @@ GlyphUninit (ScreenPtr pScreen)
glyph = globalGlyphs[fdepth].table[i].glyph;
if (glyph && glyph != DeletedGlyph)
{
+ if (GlyphPicture(glyph)[scrno])
+ {
+ FreePicture ((pointer) GlyphPicture (glyph)[scrno], 0);
+ GlyphPicture(glyph)[scrno] = NULL;
+ }
(*ps->UnrealizeGlyph) (pScreen, glyph);
- FreeGlyphPrivates(glyph);
}
}
}
-
- for (fdepth = 0; fdepth < GlyphFormatNum; fdepth++)
- {
- if (!globalGlyphs[fdepth].hashSet)
- continue;
-
- for (i = 0; i < globalGlyphs[fdepth].hashSet->size; i++)
- glyph = globalGlyphs[fdepth].table[i].glyph;
- }
}
GlyphHashSetPtr
@@ -310,8 +299,7 @@ FreeGlyph (GlyphPtr glyph, int format)
}
FreeGlyphPicture(glyph);
- FreeGlyphPrivates(glyph);
- xfree (glyph);
+ dixFreeObjectWithPrivates(glyph, PRIVATE_GLYPH);
}
}
@@ -329,8 +317,7 @@ AddGlyph (GlyphSetPtr glyphSet, GlyphPtr glyph, Glyph id)
if (gr->glyph && gr->glyph != DeletedGlyph && gr->glyph != glyph)
{
FreeGlyphPicture(glyph);
- FreeGlyphPrivates(glyph);
- xfree (glyph);
+ dixFreeObjectWithPrivates(glyph, PRIVATE_GLYPH);
glyph = gr->glyph;
}
else if (gr->glyph != glyph)
@@ -388,15 +375,17 @@ AllocateGlyph (xGlyphInfo *gi, int fdepth)
int size;
GlyphPtr glyph;
int i;
+ int head_size;
- size = screenInfo.numScreens * sizeof (PicturePtr);
- glyph = (GlyphPtr) xalloc (size + sizeof (GlyphRec));
+ head_size = sizeof (GlyphRec) + screenInfo.numScreens * sizeof (PicturePtr);
+ size = (head_size + dixPrivatesSize(PRIVATE_GLYPH));
+ glyph = (GlyphPtr) malloc (size);
if (!glyph)
return 0;
glyph->refcnt = 0;
glyph->size = size + sizeof (xGlyphInfo);
glyph->info = *gi;
- glyph->devPrivates = NULL;
+ dixInitPrivates(glyph, (char *) glyph + head_size, PRIVATE_GLYPH);
for (i = 0; i < screenInfo.numScreens; i++)
{
@@ -420,15 +409,14 @@ bail:
(*ps->UnrealizeGlyph) (screenInfo.screens[i], glyph);
}
- FreeGlyphPrivates(glyph);
- xfree (glyph);
+ dixFreeObjectWithPrivates(glyph, PRIVATE_GLYPH);
return 0;
}
Bool
AllocateGlyphHash (GlyphHashPtr hash, GlyphHashSetPtr hashSet)
{
- hash->table = xcalloc (hashSet->size, sizeof (GlyphRefRec));
+ hash->table = calloc(hashSet->size, sizeof (GlyphRefRec));
if (!hash->table)
return FALSE;
hash->hashSet = hashSet;
@@ -471,7 +459,7 @@ ResizeGlyphHash (GlyphHashPtr hash, CARD32 change, Bool global)
++newHash.tableEntries;
}
}
- xfree (hash->table);
+ free(hash->table);
}
*hash = newHash;
if (global)
@@ -490,7 +478,6 @@ GlyphSetPtr
AllocateGlyphSet (int fdepth, PictFormatPtr format)
{
GlyphSetPtr glyphSet;
- int size;
if (!globalGlyphs[fdepth].hashSet)
{
@@ -498,14 +485,13 @@ AllocateGlyphSet (int fdepth, PictFormatPtr format)
return FALSE;
}
- size = sizeof (GlyphSetRec);
- glyphSet = xcalloc (1, size);
+ glyphSet = dixAllocateObjectWithPrivates(GlyphSetRec, PRIVATE_GLYPHSET);
if (!glyphSet)
return FALSE;
if (!AllocateGlyphHash (&glyphSet->hash, &glyphHashSets[0]))
{
- xfree (glyphSet);
+ free(glyphSet);
return FALSE;
}
glyphSet->refcnt = 1;
@@ -534,15 +520,14 @@ FreeGlyphSet (pointer value,
}
if (!globalGlyphs[glyphSet->fdepth].tableEntries)
{
- xfree (globalGlyphs[glyphSet->fdepth].table);
+ free(globalGlyphs[glyphSet->fdepth].table);
globalGlyphs[glyphSet->fdepth].table = 0;
globalGlyphs[glyphSet->fdepth].hashSet = 0;
}
else
ResizeGlyphHash (&globalGlyphs[glyphSet->fdepth], 0, TRUE);
- xfree (table);
- dixFreePrivates(glyphSet->devPrivates);
- xfree (glyphSet);
+ free(table);
+ dixFreeObjectWithPrivates(glyphSet, PRIVATE_GLYPHSET);
}
return Success;
}