diff options
author | Jeremy Huddleston Sequoia <jeremyhu@apple.com> | 2014-05-31 13:14:20 -0700 |
---|---|---|
committer | Jeremy Huddleston Sequoia <jeremyhu@apple.com> | 2015-10-14 00:34:46 -0700 |
commit | f625c2ff8ed1fd195958008dd4e92598986b280b (patch) | |
tree | 1d515119d6c2c966615cf76737ef5d4777b0c5c5 | |
parent | 3f4b7f12b9a01b7144c4384a288c9660242f8ff0 (diff) |
fb: Revert fb changes that broke XQuartzXQuartz-2.7.8
http://bugs.freedesktop.org/show_bug.cgi?id=26124
Revert "Use new pixman_glyph_cache_t API that will be in pixman 0.28.0"
Revert "fb: Fix origin of source picture in fbGlyphs"
Revert "fb: Publish fbGlyphs and fbUnrealizeGlyph"
This reverts commit 9cbcb5bd6a5360a128d15b77a02d8d3351f74366.
This reverts commit 983e30361f49a67252d0b5d82630e70724d69dbf.
This reverts commit 3c2c59eed3c68c0e5a93c38cf01eedad015e3157.
-rw-r--r-- | fb/fb.h | 3 | ||||
-rw-r--r-- | fb/fbpict.c | 149 | ||||
-rw-r--r-- | fb/fbpict.h | 15 | ||||
-rw-r--r-- | fb/fbscreen.c | 1 |
4 files changed, 2 insertions, 166 deletions
@@ -1310,9 +1310,6 @@ extern _X_EXPORT void extern _X_EXPORT Bool fbPictureInit(ScreenPtr pScreen, PictFormatPtr formats, int nformats); -extern _X_EXPORT void -fbDestroyGlyphCache(void); - /* * fbpixmap.c */ diff --git a/fb/fbpict.c b/fb/fbpict.c index e7a3811f8..276ff061f 100644 --- a/fb/fbpict.c +++ b/fb/fbpict.c @@ -65,152 +65,6 @@ fbComposite(CARD8 op, free_pixman_pict(pDst, dest); } -static pixman_glyph_cache_t *glyphCache; - -void -fbDestroyGlyphCache(void) -{ - if (glyphCache) - { - pixman_glyph_cache_destroy (glyphCache); - glyphCache = NULL; - } -} - -void -fbUnrealizeGlyph(ScreenPtr pScreen, - GlyphPtr pGlyph) -{ - if (glyphCache) - pixman_glyph_cache_remove (glyphCache, pGlyph, NULL); -} - -void -fbGlyphs(CARD8 op, - PicturePtr pSrc, - PicturePtr pDst, - PictFormatPtr maskFormat, - INT16 xSrc, - INT16 ySrc, int nlist, - GlyphListPtr list, - GlyphPtr *glyphs) -{ -#define N_STACK_GLYPHS 512 - ScreenPtr pScreen = pDst->pDrawable->pScreen; - pixman_glyph_t stack_glyphs[N_STACK_GLYPHS]; - pixman_glyph_t *pglyphs = stack_glyphs; - pixman_image_t *srcImage, *dstImage; - int srcXoff, srcYoff, dstXoff, dstYoff; - GlyphPtr glyph; - int n_glyphs; - int x, y; - int i, n; - int xDst = list->xOff, yDst = list->yOff; - - miCompositeSourceValidate(pSrc); - - n_glyphs = 0; - for (i = 0; i < nlist; ++i) - n_glyphs += list[i].len; - - if (!glyphCache) - glyphCache = pixman_glyph_cache_create(); - - pixman_glyph_cache_freeze (glyphCache); - - if (n_glyphs > N_STACK_GLYPHS) { - if (!(pglyphs = malloc (n_glyphs * sizeof (pixman_glyph_t)))) - goto out; - } - - i = 0; - x = y = 0; - while (nlist--) { - x += list->xOff; - y += list->yOff; - n = list->len; - while (n--) { - const void *g; - - glyph = *glyphs++; - - if (!(g = pixman_glyph_cache_lookup (glyphCache, glyph, NULL))) { - pixman_image_t *glyphImage; - PicturePtr pPicture; - int xoff, yoff; - - pPicture = GetGlyphPicture(glyph, pScreen); - if (!pPicture) { - n_glyphs--; - goto next; - } - - if (!(glyphImage = image_from_pict(pPicture, FALSE, &xoff, &yoff))) - goto out; - - g = pixman_glyph_cache_insert(glyphCache, glyph, NULL, - glyph->info.x, - glyph->info.y, - glyphImage); - - free_pixman_pict(pPicture, glyphImage); - - if (!g) - goto out; - } - - pglyphs[i].x = x; - pglyphs[i].y = y; - pglyphs[i].glyph = g; - i++; - - next: - x += glyph->info.xOff; - y += glyph->info.yOff; - } - list++; - } - - if (!(srcImage = image_from_pict(pSrc, FALSE, &srcXoff, &srcYoff))) - goto out; - - if (!(dstImage = image_from_pict(pDst, TRUE, &dstXoff, &dstYoff))) - goto out_free_src; - - if (maskFormat) { - pixman_format_code_t format; - pixman_box32_t extents; - - format = maskFormat->format | (maskFormat->depth << 24); - - pixman_glyph_get_extents(glyphCache, n_glyphs, pglyphs, &extents); - - pixman_composite_glyphs(op, srcImage, dstImage, format, - xSrc + srcXoff + extents.x1 - xDst, ySrc + srcYoff + extents.y1 - yDst, - extents.x1, extents.y1, - extents.x1 + dstXoff, extents.y1 + dstYoff, - extents.x2 - extents.x1, - extents.y2 - extents.y1, - glyphCache, n_glyphs, pglyphs); - } - else { - pixman_composite_glyphs_no_mask(op, srcImage, dstImage, - xSrc + srcXoff - xDst, ySrc + srcYoff - yDst, - dstXoff, dstYoff, - glyphCache, n_glyphs, pglyphs); - } - - free_pixman_pict(pDst, dstImage); - -out_free_src: - free_pixman_pict(pSrc, srcImage); - -out: - pixman_glyph_cache_thaw(glyphCache); - if (pglyphs != stack_glyphs) - free(pglyphs); -} - static pixman_image_t * create_solid_fill_image(PicturePtr pict) { @@ -469,8 +323,7 @@ fbPictureInit(ScreenPtr pScreen, PictFormatPtr formats, int nformats) return FALSE; ps = GetPictureScreen(pScreen); ps->Composite = fbComposite; - ps->Glyphs = fbGlyphs; - ps->UnrealizeGlyph = fbUnrealizeGlyph; + ps->Glyphs = miGlyphs; ps->CompositeRects = miCompositeRects; ps->RasterizeTrapezoid = fbRasterizeTrapezoid; ps->AddTraps = fbAddTraps; diff --git a/fb/fbpict.h b/fb/fbpict.h index 8b0f59f7a..110f32dfe 100644 --- a/fb/fbpict.h +++ b/fb/fbpict.h @@ -65,24 +65,11 @@ fbTrapezoids(CARD8 op, INT16 xSrc, INT16 ySrc, int ntrap, xTrapezoid * traps); extern _X_EXPORT void + fbTriangles(CARD8 op, PicturePtr pSrc, PicturePtr pDst, PictFormatPtr maskFormat, INT16 xSrc, INT16 ySrc, int ntris, xTriangle * tris); -extern _X_EXPORT void -fbUnrealizeGlyph(ScreenPtr pScreen, - GlyphPtr pGlyph); - -extern _X_EXPORT void -fbGlyphs(CARD8 op, - PicturePtr pSrc, - PicturePtr pDst, - PictFormatPtr maskFormat, - INT16 xSrc, - INT16 ySrc, int nlist, - GlyphListPtr list, - GlyphPtr *glyphs); - #endif /* _FBPICT_H_ */ diff --git a/fb/fbscreen.c b/fb/fbscreen.c index 0d4d87f8b..e6ff1bde8 100644 --- a/fb/fbscreen.c +++ b/fb/fbscreen.c @@ -32,7 +32,6 @@ fbCloseScreen(ScreenPtr pScreen) int d; DepthPtr depths = pScreen->allowedDepths; - fbDestroyGlyphCache(); for (d = 0; d < pScreen->numDepths; d++) free(depths[d].vids); free(depths); |