Lines Matching refs:gi
83 static void glyph_iter_init(struct glyph_iter *gi,
86 memset(gi, 0, sizeof(*gi));
88 gi->out.dpy = &t->out;
89 test_target_create_render(&t->out, target, &gi->out.tt);
91 gi->ref.dpy = &t->ref;
92 test_target_create_render(&t->ref, target, &gi->ref.tt);
94 gi->stage = GLYPHS;
95 gi->glyph_format = -1;
96 gi->op = -1;
97 gi->dst_color = -1;
98 gi->src_color = -1;
99 gi->mask_format = -1;
100 gi->clip = -1;
199 static bool glyph_iter_next(struct glyph_iter *gi)
202 if (gi->stage == GLYPHS) {
203 if (++gi->glyph_format == PictStandardNUM)
206 if (gi->out.glyphset)
207 XRenderFreeGlyphSet(gi->out.dpy->dpy,
208 gi->out.glyphset);
209 gi->out.glyphset = create_glyphs(gi->out.dpy->dpy,
210 gi->glyph_format);
212 if (gi->ref.glyphset)
213 XRenderFreeGlyphSet(gi->ref.dpy->dpy,
214 gi->ref.glyphset);
215 gi->ref.glyphset = create_glyphs(gi->ref.dpy->dpy,
216 gi->glyph_format);
218 gi->stage++;
221 if (gi->stage == OP) {
223 if (++gi->op == 255)
225 } while (!check_op(gi->out.dpy, gi->op, &gi->out.tt) ||
226 !check_op(gi->ref.dpy, gi->op, &gi->ref.tt));
228 gi->stage++;
231 if (gi->stage == DST) {
232 if (++gi->dst_color == ARRAY_SIZE(colors))
235 gi->stage++;
238 if (gi->stage == SRC) {
239 if (++gi->src_color == ARRAY_SIZE(colors))
242 if (gi->ref.src)
243 XRenderFreePicture(gi->ref.dpy->dpy, gi->ref.src);
244 gi->ref.src = XRenderCreateSolidFill(gi->ref.dpy->dpy,
245 &colors[gi->src_color]);
247 if (gi->out.src)
248 XRenderFreePicture(gi->out.dpy->dpy, gi->out.src);
249 gi->out.src = XRenderCreateSolidFill(gi->out.dpy->dpy,
250 &colors[gi->src_color]);
252 gi->stage++;
255 if (gi->stage == MASK) {
256 if (++gi->mask_format > PictStandardNUM)
259 if (gi->mask_format == PictStandardRGB24)
260 gi->mask_format++;
262 if (gi->mask_format < PictStandardNUM) {
263 gi->out.mask_format = XRenderFindStandardFormat(gi->out.dpy->dpy,
264 gi->mask_format);
265 gi->ref.mask_format = XRenderFindStandardFormat(gi->ref.dpy->dpy,
266 gi->mask_format);
268 gi->out.mask_format = NULL;
269 gi->ref.mask_format = NULL;
272 gi->stage++;
275 if (gi->stage == CLIP) {
276 if (++gi->clip == ARRAY_SIZE(clips))
279 gi->stage++;
282 gi->stage--;
286 gi->op = -1;
288 gi->dst_color = -1;
290 gi->src_color = -1;
292 gi->mask_format = -1;
294 gi->clip = -1;
295 gi->stage--;
299 static void glyph_iter_fini(struct glyph_iter *gi)
301 if (gi->out.glyphset)
302 XRenderFreeGlyphSet (gi->out.dpy->dpy, gi->out.glyphset);
303 if (gi->ref.glyphset)
304 XRenderFreeGlyphSet (gi->ref.dpy->dpy, gi->ref.glyphset);
306 test_target_destroy_render(gi->out.dpy, &gi->out.tt);
307 test_target_destroy_render(gi->ref.dpy, &gi->ref.tt);
322 static char *glyph_iter_to_string(struct glyph_iter *gi,
331 stdformat_to_str(gi->glyph_format), gi->op,
332 xrender_color(&colors[gi->dst_color]),
333 xrender_color(&colors[gi->src_color]),
334 stdformat_to_str(gi->mask_format));
348 struct glyph_iter gi;
354 glyph_iter_init(&gi, t, target);
355 while (glyph_iter_next(&gi)) {
367 clear(gi.out.dpy, &gi.out.tt, &colors[gi.dst_color]);
368 elt.glyphset = gi.out.glyphset;
369 XRenderCompositeText8 (gi.out.dpy->dpy, gi.op,
370 gi.out.src,
371 gi.out.tt.picture,
372 gi.out.mask_format,
377 clear(gi.ref.dpy, &gi.ref.tt, &colors[gi.dst_color]);
378 elt.glyphset = gi.ref.glyphset;
379 XRenderCompositeText8 (gi.ref.dpy->dpy, gi.op,
380 gi.ref.src,
381 gi.ref.tt.picture,
382 gi.ref.mask_format,
387 gi.out.tt.draw, gi.out.tt.format,
388 gi.ref.tt.draw, gi.ref.tt.format,
389 0, 0, gi.out.tt.width, gi.out.tt.height,
390 glyph_iter_to_string(&gi,
397 clear(gi.out.dpy, &gi.out.tt, &colors[gi.dst_color]);
398 elt.glyphset = gi.out.glyphset;
399 XRenderCompositeText8 (gi.out.dpy->dpy, gi.op,
400 gi.out.src,
401 gi.out.tt.picture,
402 gi.out.mask_format,
407 clear(gi.ref.dpy, &gi.ref.tt, &colors[gi.dst_color]);
408 elt.glyphset = gi.ref.glyphset;
409 XRenderCompositeText8 (gi.ref.dpy->dpy, gi.op,
410 gi.ref.src,
411 gi.ref.tt.picture,
412 gi.ref.mask_format,
417 gi.out.tt.draw, gi.out.tt.format,
418 gi.ref.tt.draw, gi.ref.tt.format,
419 0, 0, gi.out.tt.width, gi.out.tt.height,
420 glyph_iter_to_string(&gi, "all"));
422 glyph_iter_fini(&gi);