aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/render/glyph.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2009-10-04 19:13:27 +0000
committermarha <marha@users.sourceforge.net>2009-10-04 19:13:27 +0000
commit77a4732b0637493966889fe3545966fdc12a1b5e (patch)
tree42ab7f9667a7b3bdd89e6bb5c50793dad170b974 /xorg-server/render/glyph.c
parent67b353c9ce039b254ba2e92cd6f842c505a8bd21 (diff)
downloadvcxsrv-77a4732b0637493966889fe3545966fdc12a1b5e.tar.gz
vcxsrv-77a4732b0637493966889fe3545966fdc12a1b5e.tar.bz2
vcxsrv-77a4732b0637493966889fe3545966fdc12a1b5e.zip
Updated to
xkeyboard-config-1.7 pixman-0.16.2 libX11-1.3 libXinerama-1.1 xkbcomp-1.1.1 recordproto-1.14 xineramaproto-1.2 inputproto-2.0 compositeproto-0.4.1 xorg-server-1.7.0
Diffstat (limited to 'xorg-server/render/glyph.c')
-rw-r--r--xorg-server/render/glyph.c97
1 files changed, 51 insertions, 46 deletions
diff --git a/xorg-server/render/glyph.c b/xorg-server/render/glyph.c
index 7c044aada..7fcdfd9d1 100644
--- a/xorg-server/render/glyph.c
+++ b/xorg-server/render/glyph.c
@@ -272,13 +272,32 @@ CheckDuplicates (GlyphHashPtr hash, char *where)
#define DuplicateRef(a,b)
#endif
+static void
+FreeGlyphPicture(GlyphPtr glyph)
+{
+ PictureScreenPtr ps;
+ int i;
+
+ for (i = 0; i < screenInfo.numScreens; i++)
+ {
+ ScreenPtr pScreen = screenInfo.screens[i];
+
+ if (GlyphPicture(glyph)[i])
+ FreePicture ((pointer) GlyphPicture (glyph)[i], 0);
+
+ ps = GetPictureScreenIfSet (pScreen);
+ if (ps)
+ (*ps->UnrealizeGlyph) (pScreen, glyph);
+ }
+}
+
+
void
FreeGlyph (GlyphPtr glyph, int format)
{
CheckDuplicates (&globalGlyphs[format], "FreeGlyph");
if (--glyph->refcnt == 0)
{
- PictureScreenPtr ps;
GlyphRefPtr gr;
int i;
int first;
@@ -305,17 +324,7 @@ FreeGlyph (GlyphPtr glyph, int format)
globalGlyphs[format].tableEntries--;
}
- for (i = 0; i < screenInfo.numScreens; i++)
- {
- ScreenPtr pScreen = screenInfo.screens[i];
-
- FreePicture ((pointer) GlyphPicture (glyph)[i], 0);
-
- ps = GetPictureScreenIfSet (pScreen);
- if (ps)
- (*ps->UnrealizeGlyph) (pScreen, glyph);
- }
-
+ FreeGlyphPicture(glyph);
FreeGlyphPrivates(glyph);
xfree (glyph);
}
@@ -334,15 +343,7 @@ AddGlyph (GlyphSetPtr glyphSet, GlyphPtr glyph, Glyph id)
TRUE, glyph->sha1);
if (gr->glyph && gr->glyph != DeletedGlyph && gr->glyph != glyph)
{
- PictureScreenPtr ps;
- int i;
-
- for (i = 0; i < screenInfo.numScreens; i++)
- {
- ps = GetPictureScreenIfSet (screenInfo.screens[i]);
- if (ps)
- (*ps->UnrealizeGlyph) (screenInfo.screens[i], glyph);
- }
+ FreeGlyphPicture(glyph);
FreeGlyphPrivates(glyph);
xfree (glyph);
glyph = gr->glyph;
@@ -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,32 +723,35 @@ miGlyphs (CARD8 op,
glyph = *glyphs++;
pPicture = GlyphPicture (glyph)[pScreen->myNum];
- if (maskFormat)
- {
- CompositePicture (PictOpAdd,
- pPicture,
- None,
- pMask,
- 0, 0,
- 0, 0,
- x - glyph->info.x,
- y - glyph->info.y,
- glyph->info.width,
- glyph->info.height);
- }
- else
+ if (pPicture)
{
- CompositePicture (op,
- pSrc,
- pPicture,
- pDst,
- xSrc + (x - glyph->info.x) - xDst,
- ySrc + (y - glyph->info.y) - yDst,
- 0, 0,
- x - glyph->info.x,
- y - glyph->info.y,
- glyph->info.width,
- glyph->info.height);
+ if (maskFormat)
+ {
+ CompositePicture (PictOpAdd,
+ pPicture,
+ None,
+ pMask,
+ 0, 0,
+ 0, 0,
+ x - glyph->info.x,
+ y - glyph->info.y,
+ glyph->info.width,
+ glyph->info.height);
+ }
+ else
+ {
+ CompositePicture (op,
+ pSrc,
+ pPicture,
+ pDst,
+ xSrc + (x - glyph->info.x) - xDst,
+ ySrc + (y - glyph->info.y) - yDst,
+ 0, 0,
+ x - glyph->info.x,
+ y - glyph->info.y,
+ glyph->info.width,
+ glyph->info.height);
+ }
}
x += glyph->info.xOff;