mirror of
https://github.com/X11Libre/xserver.git
synced 2026-04-14 17:18:09 +00:00
Create a Picture as well as a Pixmap at the time of AllocateGlyph
This avoids some inefficiency in creating a temporary Picture for every glyph at rendering time. My measurements with an i965 showed the previous patch causing a 10-15% slowdown for NoAccel and XAA cases, (while providing an 18% speedup for EXA). With this change, the NoAccel and XAA performance regression is eliminated, and the overall EXA speedup, (before any of the glyphs-as-pixmaps work), is now 32%.
This commit is contained in:
@@ -573,7 +573,7 @@ FreeGlyph (GlyphPtr glyph, int format)
|
||||
{
|
||||
ScreenPtr pScreen = screenInfo.screens[i];
|
||||
|
||||
(pScreen->DestroyPixmap) (GlyphPixmap (glyph)[i]);
|
||||
FreePicture ((pointer) GlyphPicture (glyph)[i], 0);
|
||||
|
||||
ps = GetPictureScreenIfSet (pScreen);
|
||||
if (ps)
|
||||
@@ -669,7 +669,7 @@ AllocateGlyph (xGlyphInfo *gi, int fdepth)
|
||||
GlyphPtr glyph;
|
||||
int i;
|
||||
|
||||
size = screenInfo.numScreens * sizeof (PixmapPtr);
|
||||
size = screenInfo.numScreens * sizeof (PicturePtr);
|
||||
glyph = (GlyphPtr) xalloc (size + sizeof (GlyphRec));
|
||||
if (!glyph)
|
||||
return 0;
|
||||
@@ -689,21 +689,12 @@ AllocateGlyph (xGlyphInfo *gi, int fdepth)
|
||||
|
||||
for (i = 0; i < screenInfo.numScreens; i++)
|
||||
{
|
||||
ScreenPtr pScreen = screenInfo.screens[i];
|
||||
ps = GetPictureScreenIfSet (screenInfo.screens[i]);
|
||||
|
||||
GlyphPixmap (glyph)[i] = (pScreen->CreatePixmap) (pScreen,
|
||||
gi->width, gi->height,
|
||||
glyphDepths[fdepth]);
|
||||
if (! GlyphPixmap (glyph)[i])
|
||||
goto bail;
|
||||
|
||||
ps = GetPictureScreenIfSet (pScreen);
|
||||
if (! ps)
|
||||
continue;
|
||||
|
||||
if (!(*ps->RealizeGlyph) (pScreen, glyph)) {
|
||||
(pScreen->DestroyPixmap) (GlyphPixmap (glyph)[i]);
|
||||
goto bail;
|
||||
if (ps)
|
||||
{
|
||||
if (!(*ps->RealizeGlyph) (screenInfo.screens[i], glyph))
|
||||
goto bail;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user