w32tex
About: TeX Live provides a comprehensive TeX system including all the major TeX-related programs, macro packages, and fonts that are free software. Windows sources.
  Fossies Dox: w32tex-src.tar.xz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

pixman-glyph.c
Go to the documentation of this file.
1 /*
2  * Copyright 2010, 2012, Soren Sandmann <sandmann@cs.au.dk>
3  * Copyright 2010, 2011, 2012, Red Hat, Inc
4  *
5  * Permission is hereby granted, free of charge, to any person obtaining a
6  * copy of this software and associated documentation files (the "Software"),
7  * to deal in the Software without restriction, including without limitation
8  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9  * and/or sell copies of the Software, and to permit persons to whom the
10  * Software is furnished to do so, subject to the following conditions:
11  *
12  * The above copyright notice and this permission notice (including the next
13  * paragraph) shall be included in all copies or substantial portions of the
14  * Software.
15  *
16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22  * DEALINGS IN THE SOFTWARE.
23  *
24  * Author: Soren Sandmann <sandmann@cs.au.dk>
25  */
26 
27 #ifdef HAVE_CONFIG_H
28 #include <config.h>
29 #endif
30 #include "pixman-private.h"
31 
32 #include <stdlib.h>
33 
34 typedef struct glyph_metrics_t glyph_metrics_t;
35 typedef struct glyph_t glyph_t;
36 
37 #define TOMBSTONE ((glyph_t *)0x1)
38 
39 /* XXX: These numbers are arbitrary---we've never done any measurements.
40  */
41 #define N_GLYPHS_HIGH_WATER (16384)
42 #define N_GLYPHS_LOW_WATER (8192)
43 #define HASH_SIZE (2 * N_GLYPHS_HIGH_WATER)
44 #define HASH_MASK (HASH_SIZE - 1)
45 
46 struct glyph_t
47 {
48  void * font_key;
49  void * glyph_key;
50  int origin_x;
51  int origin_y;
54 };
55 
57 {
58  int n_glyphs;
63 };
64 
65 static void
67 {
68  pixman_list_unlink (&glyph->mru_link);
69  pixman_image_unref (glyph->image);
70  free (glyph);
71 }
72 
73 static unsigned int
74 hash (const void *font_key, const void *glyph_key)
75 {
76  size_t key = (size_t)font_key + (size_t)glyph_key;
77 
78  /* This hash function is based on one found on Thomas Wang's
79  * web page at
80  *
81  * http://www.concentric.net/~Ttwang/tech/inthash.htm
82  *
83  */
84  key = (key << 15) - key - 1;
85  key = key ^ (key >> 12);
86  key = key + (key << 2);
87  key = key ^ (key >> 4);
88  key = key + (key << 3) + (key << 11);
89  key = key ^ (key >> 16);
90 
91  return key;
92 }
93 
94 static glyph_t *
96  void *font_key,
97  void *glyph_key)
98 {
99  unsigned idx;
100  glyph_t *g;
101 
102  idx = hash (font_key, glyph_key);
103  while ((g = cache->glyphs[idx++ & HASH_MASK]))
104  {
105  if (g != TOMBSTONE &&
106  g->font_key == font_key &&
107  g->glyph_key == glyph_key)
108  {
109  return g;
110  }
111  }
112 
113  return NULL;
114 }
115 
116 static void
118  glyph_t *glyph)
119 {
120  unsigned idx;
121  glyph_t **loc;
122 
123  idx = hash (glyph->font_key, glyph->glyph_key);
124 
125  /* Note: we assume that there is room in the table. If there isn't,
126  * this will be an infinite loop.
127  */
128  do
129  {
130  loc = &cache->glyphs[idx++ & HASH_MASK];
131  } while (*loc && *loc != TOMBSTONE);
132 
133  if (*loc == TOMBSTONE)
134  cache->n_tombstones--;
135  cache->n_glyphs++;
136 
137  *loc = glyph;
138 }
139 
140 static void
142  glyph_t *glyph)
143 {
144  unsigned idx;
145 
146  idx = hash (glyph->font_key, glyph->glyph_key);
147  while (cache->glyphs[idx & HASH_MASK] != glyph)
148  idx++;
149 
150  cache->glyphs[idx & HASH_MASK] = TOMBSTONE;
151  cache->n_tombstones++;
152  cache->n_glyphs--;
153 
154  /* Eliminate tombstones if possible */
155  if (cache->glyphs[(idx + 1) & HASH_MASK] == NULL)
156  {
157  while (cache->glyphs[idx & HASH_MASK] == TOMBSTONE)
158  {
159  cache->glyphs[idx & HASH_MASK] = NULL;
160  cache->n_tombstones--;
161  idx--;
162  }
163  }
164 }
165 
166 static void
168 {
169  int i;
170 
171  for (i = 0; i < HASH_SIZE; ++i)
172  {
173  glyph_t *glyph = cache->glyphs[i];
174 
175  if (glyph && glyph != TOMBSTONE)
176  free_glyph (glyph);
177 
178  cache->glyphs[i] = NULL;
179  }
180 
181  cache->n_glyphs = 0;
182  cache->n_tombstones = 0;
183 }
184 
187 {
189 
190  if (!(cache = malloc (sizeof *cache)))
191  return NULL;
192 
193  memset (cache->glyphs, 0, sizeof (cache->glyphs));
194  cache->n_glyphs = 0;
195  cache->n_tombstones = 0;
196  cache->freeze_count = 0;
197 
198  pixman_list_init (&cache->mru);
199 
200  return cache;
201 }
202 
203 PIXMAN_EXPORT void
205 {
206  return_if_fail (cache->freeze_count == 0);
207 
208  clear_table (cache);
209 
210  free (cache);
211 }
212 
213 PIXMAN_EXPORT void
215 {
216  cache->freeze_count++;
217 }
218 
219 PIXMAN_EXPORT void
221 {
222  if (--cache->freeze_count == 0 &&
223  cache->n_glyphs + cache->n_tombstones > N_GLYPHS_HIGH_WATER)
224  {
225  if (cache->n_tombstones > N_GLYPHS_HIGH_WATER)
226  {
227  /* More than half the entries are
228  * tombstones. Just dump the whole table.
229  */
230  clear_table (cache);
231  }
232 
233  while (cache->n_glyphs > N_GLYPHS_LOW_WATER)
234  {
235  glyph_t *glyph = CONTAINER_OF (glyph_t, mru_link, cache->mru.tail);
236 
238  free_glyph (glyph);
239  }
240  }
241 }
242 
243 PIXMAN_EXPORT const void *
245  void *font_key,
246  void *glyph_key)
247 {
248  return lookup_glyph (cache, font_key, glyph_key);
249 }
250 
251 PIXMAN_EXPORT const void *
253  void *font_key,
254  void *glyph_key,
255  int origin_x,
256  int origin_y,
258 {
259  glyph_t *glyph;
261 
262  return_val_if_fail (cache->freeze_count > 0, NULL);
263  return_val_if_fail (image->type == BITS, NULL);
264 
265  width = image->bits.width;
266  height = image->bits.height;
267 
268  if (cache->n_glyphs >= HASH_SIZE)
269  return NULL;
270 
271  if (!(glyph = malloc (sizeof *glyph)))
272  return NULL;
273 
274  glyph->font_key = font_key;
275  glyph->glyph_key = glyph_key;
276  glyph->origin_x = origin_x;
277  glyph->origin_y = origin_y;
278 
279  if (!(glyph->image = pixman_image_create_bits (
280  image->bits.format, width, height, NULL, -1)))
281  {
282  free (glyph);
283  return NULL;
284  }
285 
287  image, NULL, glyph->image, 0, 0, 0, 0, 0, 0,
288  width, height);
289 
290  if (PIXMAN_FORMAT_A (glyph->image->bits.format) != 0 &&
291  PIXMAN_FORMAT_RGB (glyph->image->bits.format) != 0)
292  {
294  }
295 
296  pixman_list_prepend (&cache->mru, &glyph->mru_link);
297 
298  _pixman_image_validate (glyph->image);
300 
301  return glyph;
302 }
303 
304 PIXMAN_EXPORT void
306  void *font_key,
307  void *glyph_key)
308 {
309  glyph_t *glyph;
310 
311  if ((glyph = lookup_glyph (cache, font_key, glyph_key)))
312  {
314 
315  free_glyph (glyph);
316  }
317 }
318 
319 PIXMAN_EXPORT void
321  int n_glyphs,
324 {
325  int i;
326 
327  extents->x1 = extents->y1 = INT32_MAX;
328  extents->x2 = extents->y2 = INT32_MIN;
329 
330  for (i = 0; i < n_glyphs; ++i)
331  {
333  int x1, y1, x2, y2;
334 
335  x1 = glyphs[i].x - glyph->origin_x;
336  y1 = glyphs[i].y - glyph->origin_y;
337  x2 = glyphs[i].x - glyph->origin_x + glyph->image->bits.width;
338  y2 = glyphs[i].y - glyph->origin_y + glyph->image->bits.height;
339 
340  if (x1 < extents->x1)
341  extents->x1 = x1;
342  if (y1 < extents->y1)
343  extents->y1 = y1;
344  if (x2 > extents->x2)
345  extents->x2 = x2;
346  if (y2 > extents->y2)
347  extents->y2 = y2;
348  }
349 }
350 
351 /* This function returns a format that is suitable for use as a mask for the
352  * set of glyphs in question.
353  */
356  int n_glyphs,
357  const pixman_glyph_t *glyphs)
358 {
360  int i;
361 
362  for (i = 0; i < n_glyphs; ++i)
363  {
364  const glyph_t *glyph = glyphs[i].glyph;
365  pixman_format_code_t glyph_format = glyph->image->bits.format;
366 
367  if (PIXMAN_FORMAT_TYPE (glyph_format) == PIXMAN_TYPE_A)
368  {
369  if (PIXMAN_FORMAT_A (glyph_format) > PIXMAN_FORMAT_A (format))
370  format = glyph_format;
371  }
372  else
373  {
374  return PIXMAN_a8r8g8b8;
375  }
376  }
377 
378  return format;
379 }
380 
381 static pixman_bool_t
383  const pixman_box32_t *box1,
384  const pixman_box32_t *box2)
385 {
386  dest->x1 = MAX (box1->x1, box2->x1);
387  dest->y1 = MAX (box1->y1, box2->y1);
388  dest->x2 = MIN (box1->x2, box2->x2);
389  dest->y2 = MIN (box1->y2, box2->y2);
390 
391  return dest->x2 > dest->x1 && dest->y2 > dest->y1;
392 }
393 
394 #if defined(__GNUC__) && !defined(__x86_64__) && !defined(__amd64__)
395 __attribute__((__force_align_arg_pointer__))
396 #endif
397 PIXMAN_EXPORT void
401  int32_t src_x,
402  int32_t src_y,
403  int32_t dest_x,
404  int32_t dest_y,
406  int n_glyphs,
407  const pixman_glyph_t *glyphs)
408 {
410  pixman_format_code_t glyph_format = PIXMAN_null;
411  uint32_t glyph_flags = 0;
412  pixman_format_code_t dest_format;
413  uint32_t dest_flags;
415  pixman_implementation_t *implementation = NULL;
417  int i;
418 
421 
422  dest_format = dest->common.extended_format_code;
423  dest_flags = dest->common.flags;
424 
427  &region,
428  src, NULL, dest,
429  src_x - dest_x, src_y - dest_y, 0, 0, 0, 0,
430  dest->bits.width, dest->bits.height))
431  {
432  goto out;
433  }
434 
435  info.op = op;
436  info.src_image = src;
437  info.dest_image = dest;
438  info.src_flags = src->common.flags;
439  info.dest_flags = dest->common.flags;
440 
441  for (i = 0; i < n_glyphs; ++i)
442  {
444  pixman_image_t *glyph_img = glyph->image;
445  pixman_box32_t glyph_box;
446  pixman_box32_t *pbox;
449  int n;
450 
451  glyph_box.x1 = dest_x + glyphs[i].x - glyph->origin_x;
452  glyph_box.y1 = dest_y + glyphs[i].y - glyph->origin_y;
453  glyph_box.x2 = glyph_box.x1 + glyph->image->bits.width;
454  glyph_box.y2 = glyph_box.y1 + glyph->image->bits.height;
455 
456  pbox = pixman_region32_rectangles (&region, &n);
457 
458  info.mask_image = glyph_img;
459 
460  while (n--)
461  {
462  if (box32_intersect (&composite_box, pbox, &glyph_box))
463  {
464  if (glyph_img->common.extended_format_code != glyph_format ||
465  glyph_img->common.flags != glyph_flags)
466  {
467  glyph_format = glyph_img->common.extended_format_code;
468  glyph_flags = glyph_img->common.flags;
469 
472  src->common.extended_format_code, src->common.flags,
473  glyph_format, glyph_flags | extra,
474  dest_format, dest_flags,
475  &implementation, &func);
476  }
477 
478  info.src_x = src_x + composite_box.x1 - dest_x;
479  info.src_y = src_y + composite_box.y1 - dest_y;
480  info.mask_x = composite_box.x1 - (dest_x + glyphs[i].x - glyph->origin_x);
481  info.mask_y = composite_box.y1 - (dest_y + glyphs[i].y - glyph->origin_y);
482  info.dest_x = composite_box.x1;
483  info.dest_y = composite_box.y1;
484  info.width = composite_box.x2 - composite_box.x1;
485  info.height = composite_box.y2 - composite_box.y1;
486 
487  info.mask_flags = glyph_flags;
488 
489  func (implementation, &info);
490  }
491 
492  pbox++;
493  }
494  pixman_list_move_to_front (&cache->mru, &glyph->mru_link);
495  }
496 
497 out:
499 }
500 
501 static void
504  int off_x, int off_y,
505  int n_glyphs, const pixman_glyph_t *glyphs)
506 {
507  pixman_format_code_t glyph_format = PIXMAN_null;
508  uint32_t glyph_flags = 0;
510  pixman_implementation_t *implementation = NULL;
511  pixman_format_code_t dest_format;
512  uint32_t dest_flags;
513  pixman_box32_t dest_box;
515  pixman_image_t *white_img = NULL;
516  pixman_bool_t white_src = FALSE;
517  int i;
518 
520 
521  dest_format = dest->common.extended_format_code;
522  dest_flags = dest->common.flags;
523 
524  info.op = PIXMAN_OP_ADD;
525  info.dest_image = dest;
526  info.src_x = 0;
527  info.src_y = 0;
528  info.dest_flags = dest_flags;
529 
530  dest_box.x1 = 0;
531  dest_box.y1 = 0;
532  dest_box.x2 = dest->bits.width;
533  dest_box.y2 = dest->bits.height;
534 
535  for (i = 0; i < n_glyphs; ++i)
536  {
538  pixman_image_t *glyph_img = glyph->image;
539  pixman_box32_t glyph_box;
541 
542  if (glyph_img->common.extended_format_code != glyph_format ||
543  glyph_img->common.flags != glyph_flags)
544  {
545  pixman_format_code_t src_format, mask_format;
546 
547  glyph_format = glyph_img->common.extended_format_code;
548  glyph_flags = glyph_img->common.flags;
549 
550  if (glyph_format == dest->bits.format)
551  {
552  src_format = glyph_format;
553  mask_format = PIXMAN_null;
554  info.src_flags = glyph_flags | FAST_PATH_SAMPLES_COVER_CLIP_NEAREST;
555  info.mask_flags = FAST_PATH_IS_OPAQUE;
556  info.mask_image = NULL;
557  white_src = FALSE;
558  }
559  else
560  {
561  if (!white_img)
562  {
563  static const pixman_color_t white = { 0xffff, 0xffff, 0xffff, 0xffff };
564 
565  if (!(white_img = pixman_image_create_solid_fill (&white)))
566  goto out;
567 
568  _pixman_image_validate (white_img);
569  }
570 
571  src_format = PIXMAN_solid;
572  mask_format = glyph_format;
573  info.src_flags = white_img->common.flags;
574  info.mask_flags = glyph_flags | FAST_PATH_SAMPLES_COVER_CLIP_NEAREST;
575  info.src_image = white_img;
576  white_src = TRUE;
577  }
578 
581  src_format, info.src_flags,
582  mask_format, info.mask_flags,
583  dest_format, dest_flags,
584  &implementation, &func);
585  }
586 
587  glyph_box.x1 = glyphs[i].x - glyph->origin_x + off_x;
588  glyph_box.y1 = glyphs[i].y - glyph->origin_y + off_y;
589  glyph_box.x2 = glyph_box.x1 + glyph->image->bits.width;
590  glyph_box.y2 = glyph_box.y1 + glyph->image->bits.height;
591 
592  if (box32_intersect (&composite_box, &glyph_box, &dest_box))
593  {
594  int src_x = composite_box.x1 - glyph_box.x1;
595  int src_y = composite_box.y1 - glyph_box.y1;
596 
597  if (white_src)
598  info.mask_image = glyph_img;
599  else
600  info.src_image = glyph_img;
601 
602  info.mask_x = info.src_x = src_x;
603  info.mask_y = info.src_y = src_y;
604  info.dest_x = composite_box.x1;
605  info.dest_y = composite_box.y1;
606  info.width = composite_box.x2 - composite_box.x1;
607  info.height = composite_box.y2 - composite_box.y1;
608 
609  func (implementation, &info);
610 
611  pixman_list_move_to_front (&cache->mru, &glyph->mru_link);
612  }
613  }
614 
615 out:
616  if (white_img)
617  pixman_image_unref (white_img);
618 }
619 
620 /* Conceptually, for each glyph, (white IN glyph) is PIXMAN_OP_ADDed to an
621  * infinitely big mask image at the position such that the glyph origin point
622  * is positioned at the (glyphs[i].x, glyphs[i].y) point.
623  *
624  * Then (mask_x, mask_y) in the infinite mask and (src_x, src_y) in the source
625  * image are both aligned with (dest_x, dest_y) in the destination image. Then
626  * these three images are composited within the
627  *
628  * (dest_x, dest_y, dst_x + width, dst_y + height)
629  *
630  * rectangle.
631  *
632  * TODO:
633  * - Trim the mask to the destination clip/image?
634  * - Trim composite region based on sources, when the op ignores 0s.
635  */
636 #if defined(__GNUC__) && !defined(__x86_64__) && !defined(__amd64__)
637 __attribute__((__force_align_arg_pointer__))
638 #endif
639 PIXMAN_EXPORT void
643  pixman_format_code_t mask_format,
644  int32_t src_x,
645  int32_t src_y,
646  int32_t mask_x,
647  int32_t mask_y,
648  int32_t dest_x,
649  int32_t dest_y,
650  int32_t width,
651  int32_t height,
653  int n_glyphs,
654  const pixman_glyph_t *glyphs)
655 {
657 
658  if (!(mask = pixman_image_create_bits (mask_format, width, height, NULL, -1)))
659  return;
660 
661  if (PIXMAN_FORMAT_A (mask_format) != 0 &&
662  PIXMAN_FORMAT_RGB (mask_format) != 0)
663  {
665  }
666 
667  add_glyphs (cache, mask, - mask_x, - mask_y, n_glyphs, glyphs);
668 
670  src_x, src_y,
671  0, 0,
672  dest_x, dest_y,
673  width, height);
674 
676 }
#define width(a)
Definition: aptex-macros.h:198
#define loc
Definition: aptex-macros.h:65
#define height(a)
Definition: aptex-macros.h:200
static void composite_box(void *closure, int16_t x, int16_t y, int16_t w, int16_t h, uint16_t coverage)
#define n
Definition: t4ht.c:1290
@ FALSE
Definition: dd.h:101
@ TRUE
Definition: dd.h:102
#define free(a)
Definition: decNumber.cpp:310
void glyphs(int opcode)
Definition: disdvi.c:775
#define white(x)
#define info
Definition: dviinfo.c:42
FILE * out
Definition: hbf2gf.c:286
#define MIN(a, b)
Definition: jpegint.h:269
#define MAX(a, b)
Definition: jpegint.h:267
#define NULL
Definition: ftobjs.h:61
small capitals from c petite p scientific i
Definition: afcover.h:80
sizeof(AF_ModuleRec)
FT_UInt idx
Definition: cffcmap.c:135
#define INT32_MAX
Definition: stdint.h:137
unsigned int uint32_t
Definition: stdint.h:80
#define INT32_MIN
Definition: stdint.h:136
signed int int32_t
Definition: stdint.h:77
#define malloc
Definition: alloca.c:91
static const key_entry font_key[(10+1)]
Definition: ptexlib.h:343
#define __attribute__(A)
Definition: synctex.c:338
#define dest
static UHashtable * cache
static luaL_Reg func[]
Definition: except.c:32
#define size_t
Definition: glob.c:257
static int format
Definition: pbmclean.c:15
pixman_image_t * pixman_image_create_bits(pixman_format_code_t format, int width, int height, uint32_t *bits, int rowstride_bytes)
#define CONTAINER_OF(type, member, data)
#define PIXMAN_EXPORT
void pixman_composite_glyphs(pixman_op_t op, pixman_image_t *src, pixman_image_t *dest, pixman_format_code_t mask_format, int32_t src_x, int32_t src_y, int32_t mask_x, int32_t mask_y, int32_t dest_x, int32_t dest_y, int32_t width, int32_t height, pixman_glyph_cache_t *cache, int n_glyphs, const pixman_glyph_t *glyphs)
Definition: pixman-glyph.c:640
pixman_format_code_t pixman_glyph_get_mask_format(pixman_glyph_cache_t *cache, int n_glyphs, const pixman_glyph_t *glyphs)
Definition: pixman-glyph.c:355
const void * pixman_glyph_cache_lookup(pixman_glyph_cache_t *cache, void *font_key, void *glyph_key)
Definition: pixman-glyph.c:244
const void * pixman_glyph_cache_insert(pixman_glyph_cache_t *cache, void *font_key, void *glyph_key, int origin_x, int origin_y, pixman_image_t *image)
Definition: pixman-glyph.c:252
void pixman_glyph_cache_thaw(pixman_glyph_cache_t *cache)
Definition: pixman-glyph.c:220
static void clear_table(pixman_glyph_cache_t *cache)
Definition: pixman-glyph.c:167
pixman_glyph_cache_t * pixman_glyph_cache_create(void)
Definition: pixman-glyph.c:186
static void insert_glyph(pixman_glyph_cache_t *cache, glyph_t *glyph)
Definition: pixman-glyph.c:117
struct glyph_metrics_t glyph_metrics_t
Definition: pixman-glyph.c:34
static void add_glyphs(pixman_glyph_cache_t *cache, pixman_image_t *dest, int off_x, int off_y, int n_glyphs, const pixman_glyph_t *glyphs)
Definition: pixman-glyph.c:502
#define HASH_MASK
Definition: pixman-glyph.c:44
void pixman_glyph_get_extents(pixman_glyph_cache_t *cache, int n_glyphs, pixman_glyph_t *glyphs, pixman_box32_t *extents)
Definition: pixman-glyph.c:320
void pixman_composite_glyphs_no_mask(pixman_op_t op, pixman_image_t *src, pixman_image_t *dest, int32_t src_x, int32_t src_y, int32_t dest_x, int32_t dest_y, pixman_glyph_cache_t *cache, int n_glyphs, const pixman_glyph_t *glyphs)
Definition: pixman-glyph.c:398
void pixman_glyph_cache_destroy(pixman_glyph_cache_t *cache)
Definition: pixman-glyph.c:204
static glyph_t * lookup_glyph(pixman_glyph_cache_t *cache, void *font_key, void *glyph_key)
Definition: pixman-glyph.c:95
void pixman_glyph_cache_freeze(pixman_glyph_cache_t *cache)
Definition: pixman-glyph.c:214
#define N_GLYPHS_HIGH_WATER
Definition: pixman-glyph.c:41
#define TOMBSTONE
Definition: pixman-glyph.c:37
void pixman_glyph_cache_remove(pixman_glyph_cache_t *cache, void *font_key, void *glyph_key)
Definition: pixman-glyph.c:305
#define HASH_SIZE
Definition: pixman-glyph.c:43
static void free_glyph(glyph_t *glyph)
Definition: pixman-glyph.c:66
static pixman_bool_t box32_intersect(pixman_box32_t *dest, const pixman_box32_t *box1, const pixman_box32_t *box2)
Definition: pixman-glyph.c:382
static void remove_glyph(pixman_glyph_cache_t *cache, glyph_t *glyph)
Definition: pixman-glyph.c:141
#define N_GLYPHS_LOW_WATER
Definition: pixman-glyph.c:42
static unsigned int hash(const void *font_key, const void *glyph_key)
Definition: pixman-glyph.c:74
void pixman_image_set_component_alpha(pixman_image_t *image, pixman_bool_t component_alpha)
Definition: pixman-image.c:854
void _pixman_image_validate(pixman_image_t *image)
Definition: pixman-image.c:547
pixman_bool_t pixman_image_unref(pixman_image_t *image)
Definition: pixman-image.c:209
void _pixman_implementation_lookup_composite(pixman_implementation_t *toplevel, pixman_op_t op, pixman_format_code_t src_format, uint32_t src_flags, pixman_format_code_t mask_format, uint32_t mask_flags, pixman_format_code_t dest_format, uint32_t dest_flags, pixman_implementation_t **out_imp, pixman_composite_func_t *out_func)
#define FAST_PATH_SAMPLES_COVER_CLIP_NEAREST
#define return_if_fail(expr)
@ BITS
pixman_bool_t _pixman_compute_composite_region32(pixman_region32_t *region, pixman_image_t *src_image, pixman_image_t *mask_image, pixman_image_t *dest_image, int32_t src_x, int32_t src_y, int32_t mask_x, int32_t mask_y, int32_t dest_x, int32_t dest_y, int32_t width, int32_t height)
Definition: pixman.c:228
void(* pixman_composite_func_t)(pixman_implementation_t *imp, pixman_composite_info_t *info)
static void pixman_list_unlink(pixman_link_t *link)
#define return_val_if_fail(expr, retval)
static pixman_implementation_t * get_implementation(void)
#define PIXMAN_solid
static void pixman_list_prepend(pixman_list_t *list, pixman_link_t *link)
#define PIXMAN_null
#define FAST_PATH_IS_OPAQUE
static void pixman_list_init(pixman_list_t *list)
static void pixman_list_move_to_front(pixman_list_t *list, pixman_link_t *link)
pixman_image_t * pixman_image_create_solid_fill(const pixman_color_t *color)
void pixman_image_composite32(pixman_op_t op, pixman_image_t *src, pixman_image_t *mask, pixman_image_t *dest, int32_t src_x, int32_t src_y, int32_t mask_x, int32_t mask_y, int32_t dest_x, int32_t dest_y, int32_t width, int32_t height)
Definition: pixman.c:563
pixman_box32_t * pixman_region32_rectangles(pixman_region32_t *region, int *n_rects)
#define PIXMAN_FORMAT_A(f)
Definition: pixman.h:840
void pixman_region32_init(pixman_region32_t *region)
#define PIXMAN_FORMAT_TYPE(f)
Definition: pixman.h:839
#define PIXMAN_TYPE_A
Definition: pixman.h:852
int pixman_bool_t
Definition: pixman.h:113
pixman_op_t
Definition: pixman.h:389
@ PIXMAN_OP_SRC
Definition: pixman.h:391
@ PIXMAN_OP_ADD
Definition: pixman.h:402
void pixman_region32_fini(pixman_region32_t *region)
pixman_format_code_t
Definition: pixman.h:871
@ PIXMAN_a8r8g8b8
Definition: pixman.h:878
@ PIXMAN_a1
Definition: pixman.h:938
#define PIXMAN_FORMAT_RGB(f)
Definition: pixman.h:844
int g
Definition: ppmqvga.c:68
bstring c int memset(void *s, int c, int length)
#define x1
#define y1
#define y2
#define x2
#define mask(n)
Definition: lbitlib.c:93
pixman_link_t mru_link
Definition: pixman-glyph.c:53
int origin_y
Definition: pixman-glyph.c:51
pixman_image_t * image
Definition: pixman-glyph.c:52
void * glyph_key
Definition: pixman-glyph.c:49
void * font_key
Definition: pixman-glyph.c:48
int origin_x
Definition: pixman-glyph.c:50
Definition: pbmfont.h:4
int width
Definition: pbmfont.h:5
int height
Definition: pbmfont.h:5
uint32_t flags
pixman_format_code_t extended_format_code
Definition: sd.h:76
Definition: sh.h:1226
int32_t x1
Definition: pixman.h:632
int32_t y2
Definition: pixman.h:632
int32_t x2
Definition: pixman.h:632
int32_t y1
Definition: pixman.h:632
pixman_list_t mru
Definition: pixman-glyph.c:61
glyph_t * glyphs[(2 *(16384))]
Definition: pixman-glyph.c:62
Definition: regions.h:31
pointer region
Definition: t1imager.h:37
#define key
Definition: tex2xindy.c:753
op
Definition: tex4ht.c:3129
TT_Glyph glyph
Definition: ttf2pfb.c:162
image_common_t common