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 File Reference
#include "pixman-private.h"
#include <stdlib.h>
Include dependency graph for pixman-glyph.c:

Go to the source code of this file.

Classes

struct  glyph_t
 
struct  pixman_glyph_cache_t
 

Macros

#define TOMBSTONE   ((glyph_t *)0x1)
 
#define N_GLYPHS_HIGH_WATER   (16384)
 
#define N_GLYPHS_LOW_WATER   (8192)
 
#define HASH_SIZE   (2 * N_GLYPHS_HIGH_WATER)
 
#define HASH_MASK   (HASH_SIZE - 1)
 

Typedefs

typedef struct glyph_metrics_t glyph_metrics_t
 
typedef struct glyph_t glyph_t
 

Functions

static void free_glyph (glyph_t *glyph)
 
static unsigned int hash (const void *font_key, const void *glyph_key)
 
static glyph_tlookup_glyph (pixman_glyph_cache_t *cache, void *font_key, void *glyph_key)
 
static void insert_glyph (pixman_glyph_cache_t *cache, glyph_t *glyph)
 
static void remove_glyph (pixman_glyph_cache_t *cache, glyph_t *glyph)
 
static void clear_table (pixman_glyph_cache_t *cache)
 
pixman_glyph_cache_tpixman_glyph_cache_create (void)
 
void pixman_glyph_cache_destroy (pixman_glyph_cache_t *cache)
 
void pixman_glyph_cache_freeze (pixman_glyph_cache_t *cache)
 
void pixman_glyph_cache_thaw (pixman_glyph_cache_t *cache)
 
const voidpixman_glyph_cache_lookup (pixman_glyph_cache_t *cache, void *font_key, void *glyph_key)
 
const voidpixman_glyph_cache_insert (pixman_glyph_cache_t *cache, void *font_key, void *glyph_key, int origin_x, int origin_y, pixman_image_t *image)
 
void pixman_glyph_cache_remove (pixman_glyph_cache_t *cache, void *font_key, void *glyph_key)
 
void pixman_glyph_get_extents (pixman_glyph_cache_t *cache, int n_glyphs, pixman_glyph_t *glyphs, pixman_box32_t *extents)
 
pixman_format_code_t pixman_glyph_get_mask_format (pixman_glyph_cache_t *cache, int n_glyphs, const pixman_glyph_t *glyphs)
 
static pixman_bool_t box32_intersect (pixman_box32_t *dest, const pixman_box32_t *box1, const pixman_box32_t *box2)
 
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)
 
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)
 
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)
 

Macro Definition Documentation

◆ HASH_MASK

#define HASH_MASK   (HASH_SIZE - 1)

Definition at line 44 of file pixman-glyph.c.

◆ HASH_SIZE

#define HASH_SIZE   (2 * N_GLYPHS_HIGH_WATER)

Definition at line 43 of file pixman-glyph.c.

◆ N_GLYPHS_HIGH_WATER

#define N_GLYPHS_HIGH_WATER   (16384)

Definition at line 41 of file pixman-glyph.c.

◆ N_GLYPHS_LOW_WATER

#define N_GLYPHS_LOW_WATER   (8192)

Definition at line 42 of file pixman-glyph.c.

◆ TOMBSTONE

#define TOMBSTONE   ((glyph_t *)0x1)

Definition at line 37 of file pixman-glyph.c.

Typedef Documentation

◆ glyph_metrics_t

Definition at line 1 of file pixman-glyph.c.

◆ glyph_t

typedef struct glyph_t glyph_t

Definition at line 1 of file pixman-glyph.c.

Function Documentation

◆ add_glyphs()

◆ box32_intersect()

static pixman_bool_t box32_intersect ( pixman_box32_t dest,
const pixman_box32_t box1,
const pixman_box32_t box2 
)
static

◆ clear_table()

static void clear_table ( pixman_glyph_cache_t cache)
static

Definition at line 167 of file pixman-glyph.c.

References cache, free_glyph(), HASH_SIZE, i, NULL, and TOMBSTONE.

Referenced by pixman_glyph_cache_destroy(), and pixman_glyph_cache_thaw().

◆ free_glyph()

static void free_glyph ( glyph_t glyph)
static

◆ hash()

static unsigned int hash ( const void font_key,
const void glyph_key 
)
static

Definition at line 74 of file pixman-glyph.c.

References font_key, key, and size_t.

Referenced by insert_glyph(), lookup_glyph(), and remove_glyph().

◆ insert_glyph()

static void insert_glyph ( pixman_glyph_cache_t cache,
glyph_t glyph 
)
static

Definition at line 117 of file pixman-glyph.c.

References cache, glyph, hash(), HASH_MASK, idx, loc, and TOMBSTONE.

Referenced by pixman_glyph_cache_insert().

◆ lookup_glyph()

static glyph_t* lookup_glyph ( pixman_glyph_cache_t cache,
void font_key,
void glyph_key 
)
static

Definition at line 95 of file pixman-glyph.c.

References cache, font_key, g, hash(), HASH_MASK, idx, NULL, and TOMBSTONE.

Referenced by pixman_glyph_cache_lookup(), and pixman_glyph_cache_remove().

◆ pixman_composite_glyphs()

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 
)

◆ pixman_composite_glyphs_no_mask()

◆ pixman_glyph_cache_create()

pixman_glyph_cache_t* pixman_glyph_cache_create ( void  )

Definition at line 186 of file pixman-glyph.c.

References cache, malloc, memset(), NULL, pixman_list_init(), and sizeof().

◆ pixman_glyph_cache_destroy()

void pixman_glyph_cache_destroy ( pixman_glyph_cache_t cache)

Definition at line 204 of file pixman-glyph.c.

References cache, clear_table(), free, and return_if_fail.

◆ pixman_glyph_cache_freeze()

void pixman_glyph_cache_freeze ( pixman_glyph_cache_t cache)

Definition at line 214 of file pixman-glyph.c.

References cache.

◆ pixman_glyph_cache_insert()

◆ pixman_glyph_cache_lookup()

const void* pixman_glyph_cache_lookup ( pixman_glyph_cache_t cache,
void font_key,
void glyph_key 
)

Definition at line 244 of file pixman-glyph.c.

References cache, font_key, and lookup_glyph().

◆ pixman_glyph_cache_remove()

void pixman_glyph_cache_remove ( pixman_glyph_cache_t cache,
void font_key,
void glyph_key 
)

Definition at line 305 of file pixman-glyph.c.

References cache, font_key, free_glyph(), glyph, lookup_glyph(), and remove_glyph().

◆ pixman_glyph_cache_thaw()

void pixman_glyph_cache_thaw ( pixman_glyph_cache_t cache)

◆ pixman_glyph_get_extents()

void pixman_glyph_get_extents ( pixman_glyph_cache_t cache,
int  n_glyphs,
pixman_glyph_t glyphs,
pixman_box32_t extents 
)

Definition at line 320 of file pixman-glyph.c.

References glyphs(), glyph::height, i, INT32_MAX, INT32_MIN, glyph::width, x1, x2, y1, and y2.

◆ pixman_glyph_get_mask_format()

pixman_format_code_t pixman_glyph_get_mask_format ( pixman_glyph_cache_t cache,
int  n_glyphs,
const pixman_glyph_t glyphs 
)

◆ remove_glyph()

static void remove_glyph ( pixman_glyph_cache_t cache,
glyph_t glyph 
)
static

Definition at line 141 of file pixman-glyph.c.

References cache, hash(), HASH_MASK, idx, NULL, and TOMBSTONE.

Referenced by pixman_glyph_cache_remove(), and pixman_glyph_cache_thaw().