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>
This commit is contained in:
parent
b5fcc5553e
commit
758ab55d2d
|
@ -282,6 +282,7 @@ FreeGlyphPicture(GlyphPtr glyph)
|
||||||
{
|
{
|
||||||
ScreenPtr pScreen = screenInfo.screens[i];
|
ScreenPtr pScreen = screenInfo.screens[i];
|
||||||
|
|
||||||
|
if (GlyphPicture(glyph)[i])
|
||||||
FreePicture ((pointer) GlyphPicture (glyph)[i], 0);
|
FreePicture ((pointer) GlyphPicture (glyph)[i], 0);
|
||||||
|
|
||||||
ps = GetPictureScreenIfSet (pScreen);
|
ps = GetPictureScreenIfSet (pScreen);
|
||||||
|
@ -414,6 +415,7 @@ AllocateGlyph (xGlyphInfo *gi, int fdepth)
|
||||||
|
|
||||||
for (i = 0; i < screenInfo.numScreens; i++)
|
for (i = 0; i < screenInfo.numScreens; i++)
|
||||||
{
|
{
|
||||||
|
GlyphPicture(glyph)[i] = NULL;
|
||||||
ps = GetPictureScreenIfSet (screenInfo.screens[i]);
|
ps = GetPictureScreenIfSet (screenInfo.screens[i]);
|
||||||
|
|
||||||
if (ps)
|
if (ps)
|
||||||
|
@ -721,6 +723,8 @@ miGlyphs (CARD8 op,
|
||||||
glyph = *glyphs++;
|
glyph = *glyphs++;
|
||||||
pPicture = GlyphPicture (glyph)[pScreen->myNum];
|
pPicture = GlyphPicture (glyph)[pScreen->myNum];
|
||||||
|
|
||||||
|
if (pPicture)
|
||||||
|
{
|
||||||
if (maskFormat)
|
if (maskFormat)
|
||||||
{
|
{
|
||||||
CompositePicture (PictOpAdd,
|
CompositePicture (PictOpAdd,
|
||||||
|
@ -748,6 +752,7 @@ miGlyphs (CARD8 op,
|
||||||
glyph->info.width,
|
glyph->info.width,
|
||||||
glyph->info.height);
|
glyph->info.height);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
x += glyph->info.xOff;
|
x += glyph->info.xOff;
|
||||||
y += glyph->info.yOff;
|
y += glyph->info.yOff;
|
||||||
|
|
Loading…
Reference in New Issue