diff options
author | marha <marha@users.sourceforge.net> | 2009-10-05 15:13:41 +0000 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2009-10-05 15:13:41 +0000 |
commit | 78db264e7992131e0781bdfa5ede821305262b2d (patch) | |
tree | 7461ae9dab5bf69f056250fc233c1ada393dc957 /xorg-server/render | |
parent | 1d2fa791e7eb383cf2818bb2e33da546edbeade9 (diff) | |
parent | 77a4732b0637493966889fe3545966fdc12a1b5e (diff) | |
download | vcxsrv-78db264e7992131e0781bdfa5ede821305262b2d.tar.gz vcxsrv-78db264e7992131e0781bdfa5ede821305262b2d.tar.bz2 vcxsrv-78db264e7992131e0781bdfa5ede821305262b2d.zip |
svn merge https://vcxsrv.svn.sourceforge.net/svnroot/vcxsrv/branches/released .
Diffstat (limited to 'xorg-server/render')
-rw-r--r-- | xorg-server/render/glyph.c | 97 | ||||
-rw-r--r-- | xorg-server/render/picture.c | 5 | ||||
-rw-r--r-- | xorg-server/render/render.c | 6 |
3 files changed, 57 insertions, 51 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; diff --git a/xorg-server/render/picture.c b/xorg-server/render/picture.c index a3670778e..e1a297203 100644 --- a/xorg-server/render/picture.c +++ b/xorg-server/render/picture.c @@ -223,9 +223,8 @@ PictureCreateDefaultFormats (ScreenPtr pScreen, int *nformatp) b = Ones (pVisual->blueMask); type = PICT_TYPE_OTHER; /* - * Current rendering code supports only two direct formats, + * Current rendering code supports only three direct formats, * fields must be packed together at the bottom of the pixel - * and must be either RGB or BGR */ if (pVisual->offsetBlue == 0 && pVisual->offsetGreen == b && @@ -322,8 +321,6 @@ PictureCreateDefaultFormats (ScreenPtr pScreen, int *nformatp) PICT_x8r8g8b8, pDepth->depth); nformats = addFormat (formats, nformats, PICT_x8b8g8r8, pDepth->depth); - nformats = addFormat (formats, nformats, - PICT_b8g8r8x8, pDepth->depth); } if (pDepth->depth >= 30) { diff --git a/xorg-server/render/render.c b/xorg-server/render/render.c index a3067665e..a32d797a7 100644 --- a/xorg-server/render/render.c +++ b/xorg-server/render/render.c @@ -1043,7 +1043,7 @@ ProcRenderAddGlyphs (ClientPtr client) CARD32 *gids; xGlyphInfo *gi; CARD8 *bits; - int size; + unsigned int size; int err; int i, screen; PicturePtr pSrc = NULL, pDst = NULL; @@ -1131,6 +1131,10 @@ ProcRenderAddGlyphs (ClientPtr client) ScreenPtr pScreen; int error; + /* Skip work if it's invisibly small anyway */ + if (!width || !height) + break; + pScreen = screenInfo.screens[screen]; pSrcPix = GetScratchPixmapHeader (pScreen, width, height, |