aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/render/glyph.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2010-06-11 14:16:16 +0000
committermarha <marha@users.sourceforge.net>2010-06-11 14:16:16 +0000
commitd1e4f4b8546c7955c66dd023bfd6ef437db9d21d (patch)
tree529985e77bfc95aa95fe5b540e8f42b0ef041206 /xorg-server/render/glyph.c
parent13919cf85a6ca41d97238de13344aba59e0f7680 (diff)
parent4c61bf84b11e26e6f22648668c95ea760a379163 (diff)
downloadvcxsrv-d1e4f4b8546c7955c66dd023bfd6ef437db9d21d.tar.gz
vcxsrv-d1e4f4b8546c7955c66dd023bfd6ef437db9d21d.tar.bz2
vcxsrv-d1e4f4b8546c7955c66dd023bfd6ef437db9d21d.zip
svn merge ^/branches/released .
Diffstat (limited to 'xorg-server/render/glyph.c')
-rw-r--r--xorg-server/render/glyph.c38
1 files changed, 16 insertions, 22 deletions
diff --git a/xorg-server/render/glyph.c b/xorg-server/render/glyph.c
index b147331c8..ab20da625 100644
--- a/xorg-server/render/glyph.c
+++ b/xorg-server/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,8 +102,12 @@ 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);
}
}
}
@@ -301,8 +299,7 @@ FreeGlyph (GlyphPtr glyph, int format)
}
FreeGlyphPicture(glyph);
- FreeGlyphPrivates(glyph);
- free(glyph);
+ dixFreeObjectWithPrivates(glyph, PRIVATE_GLYPH);
}
}
@@ -320,8 +317,7 @@ AddGlyph (GlyphSetPtr glyphSet, GlyphPtr glyph, Glyph id)
if (gr->glyph && gr->glyph != DeletedGlyph && gr->glyph != glyph)
{
FreeGlyphPicture(glyph);
- FreeGlyphPrivates(glyph);
- free(glyph);
+ dixFreeObjectWithPrivates(glyph, PRIVATE_GLYPH);
glyph = gr->glyph;
}
else if (gr->glyph != glyph)
@@ -379,15 +375,17 @@ AllocateGlyph (xGlyphInfo *gi, int fdepth)
int size;
GlyphPtr glyph;
int i;
+ int head_size;
- size = screenInfo.numScreens * sizeof (PicturePtr);
- glyph = (GlyphPtr) malloc(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++)
{
@@ -411,8 +409,7 @@ bail:
(*ps->UnrealizeGlyph) (screenInfo.screens[i], glyph);
}
- FreeGlyphPrivates(glyph);
- free(glyph);
+ dixFreeObjectWithPrivates(glyph, PRIVATE_GLYPH);
return 0;
}
@@ -481,7 +478,6 @@ GlyphSetPtr
AllocateGlyphSet (int fdepth, PictFormatPtr format)
{
GlyphSetPtr glyphSet;
- int size;
if (!globalGlyphs[fdepth].hashSet)
{
@@ -489,8 +485,7 @@ AllocateGlyphSet (int fdepth, PictFormatPtr format)
return FALSE;
}
- size = sizeof (GlyphSetRec);
- glyphSet = calloc(1, size);
+ glyphSet = dixAllocateObjectWithPrivates(GlyphSetRec, PRIVATE_GLYPHSET);
if (!glyphSet)
return FALSE;
@@ -532,8 +527,7 @@ FreeGlyphSet (pointer value,
else
ResizeGlyphHash (&globalGlyphs[glyphSet->fdepth], 0, TRUE);
free(table);
- dixFreePrivates(glyphSet->devPrivates);
- free(glyphSet);
+ dixFreeObjectWithPrivates(glyphSet, PRIVATE_GLYPHSET);
}
return Success;
}