70
70
free_pixman_pict(pDst, dest);
73
static pixman_glyph_cache_t *glyphCache;
76
fbDestroyGlyphCache(void)
80
pixman_glyph_cache_destroy (glyphCache);
86
fbUnrealizeGlyph(ScreenPtr pScreen,
90
pixman_glyph_cache_remove (glyphCache, pGlyph, NULL);
97
PictFormatPtr maskFormat,
99
INT16 ySrc, int nlist,
103
#define N_STACK_GLYPHS 512
104
ScreenPtr pScreen = pDst->pDrawable->pScreen;
105
pixman_glyph_t stack_glyphs[N_STACK_GLYPHS];
106
pixman_glyph_t *pglyphs = stack_glyphs;
107
pixman_image_t *srcImage, *dstImage;
108
int srcXoff, srcYoff, dstXoff, dstYoff;
113
int xDst = list->xOff, yDst = list->yOff;
115
miCompositeSourceValidate(pSrc);
118
for (i = 0; i < nlist; ++i)
119
n_glyphs += list[i].len;
122
glyphCache = pixman_glyph_cache_create();
124
pixman_glyph_cache_freeze (glyphCache);
126
if (n_glyphs > N_STACK_GLYPHS) {
127
if (!(pglyphs = malloc (n_glyphs * sizeof (pixman_glyph_t))))
142
if (!(g = pixman_glyph_cache_lookup (glyphCache, glyph, NULL))) {
143
pixman_image_t *glyphImage;
147
pPicture = GetGlyphPicture(glyph, pScreen);
153
if (!(glyphImage = image_from_pict(pPicture, FALSE, &xoff, &yoff)))
156
g = pixman_glyph_cache_insert(glyphCache, glyph, NULL,
161
free_pixman_pict(pPicture, glyphImage);
169
pglyphs[i].glyph = g;
173
x += glyph->info.xOff;
174
y += glyph->info.yOff;
179
if (!(srcImage = image_from_pict(pSrc, FALSE, &srcXoff, &srcYoff)))
182
if (!(dstImage = image_from_pict(pDst, TRUE, &dstXoff, &dstYoff)))
186
pixman_format_code_t format;
187
pixman_box32_t extents;
190
format = maskFormat->format | (maskFormat->depth << 24);
192
pixman_glyph_get_extents(glyphCache, n_glyphs, pglyphs, &extents);
197
pixman_composite_glyphs(op, srcImage, dstImage, format,
198
xSrc + srcXoff + xDst, ySrc + srcYoff + yDst,
200
x + dstXoff, y + dstYoff,
201
extents.x2 - extents.x1,
202
extents.y2 - extents.y1,
203
glyphCache, n_glyphs, pglyphs);
206
pixman_composite_glyphs_no_mask(op, srcImage, dstImage,
207
xSrc + srcXoff - xDst, ySrc + srcYoff - yDst,
209
glyphCache, n_glyphs, pglyphs);
212
free_pixman_pict(pDst, dstImage);
215
free_pixman_pict(pSrc, srcImage);
218
pixman_glyph_cache_thaw(glyphCache);
219
if (pglyphs != stack_glyphs)
73
223
static pixman_image_t *
74
224
create_solid_fill_image(PicturePtr pict)