summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2009-10-01 15:22:19 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2009-10-01 16:00:13 +1000
commit758ab55d2defc78d0169fd61a7036eb9f889e9e7 (patch)
tree85886fecbfe51352246e0fc98448743fead4056f
parentb5fcc5553eb784c9f4826936e839079c0cdee55a (diff)
render: set the glyph picture to NULL by default.
In a follow-up patch we may have glyphs with a NULL picture. To cope with that, always set the pictures for glyphs to NULL at creation time and cope with cleaning up such glyphs. Also, since compositing a NULL source doesn't do a lot anyway, skip trying to do so. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Keith Packard <keithp@keithp.com>
-rw-r--r--render/glyph.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/render/glyph.c b/render/glyph.c
index 6327c9fda..7fcdfd9d1 100644
--- a/render/glyph.c
+++ b/render/glyph.c
@@ -282,6 +282,7 @@ FreeGlyphPicture(GlyphPtr glyph)
{
ScreenPtr pScreen = screenInfo.screens[i];
+ if (GlyphPicture(glyph)[i])
FreePicture ((pointer) GlyphPicture (glyph)[i], 0);
ps = GetPictureScreenIfSet (pScreen);
@@ -414,6 +415,7 @@ AllocateGlyph (xGlyphInfo *gi, int fdepth)
for (i = 0; i < screenInfo.numScreens; i++)
{
+ GlyphPicture(glyph)[i] = NULL;
ps = GetPictureScreenIfSet (screenInfo.screens[i]);
if (ps)
@@ -721,6 +723,8 @@ miGlyphs (CARD8 op,
glyph = *glyphs++;
pPicture = GlyphPicture (glyph)[pScreen->myNum];
+ if (pPicture)
+ {
if (maskFormat)
{
CompositePicture (PictOpAdd,
@@ -748,6 +752,7 @@ miGlyphs (CARD8 op,
glyph->info.width,
glyph->info.height);
}
+ }
x += glyph->info.xOff;
y += glyph->info.yOff;