_cairo_array_init:
   59|    868|{
   60|    868|    array->size = 0;
   61|    868|    array->num_elements = 0;
   62|    868|    array->element_size = element_size;
   63|       |    array->elements = NULL;
   64|    868|}
_cairo_array_fini:
   76|    726|{
   77|    726|    free (array->elements);
   78|    726|}
_cairo_array_grow_by:
   90|  1.96M|{
   91|  1.96M|    char *new_elements;
   92|  1.96M|    unsigned int old_size = array->size;
   93|  1.96M|    unsigned int required_size = array->num_elements + additional;
   94|  1.96M|    unsigned int new_size;
   95|       |
   96|       |    /* check for integer overflow */
   97|  1.96M|    if (required_size > INT_MAX || required_size < array->num_elements)
  ------------------
  |  Branch (97:9): [True: 0, False: 1.96M]
  |  Branch (97:36): [True: 0, False: 1.96M]
  ------------------
   98|      0|	return _cairo_error (CAIRO_STATUS_NO_MEMORY);
   99|       |
  100|  1.96M|    if (CAIRO_INJECT_FAULT ())
  ------------------
  |  |   47|  1.96M|#define CAIRO_INJECT_FAULT() 0
  |  |  ------------------
  |  |  |  Branch (47:30): [Folded, False: 1.96M]
  |  |  ------------------
  ------------------
  101|      0|	return _cairo_error (CAIRO_STATUS_NO_MEMORY);
  102|       |
  103|  1.96M|    if (required_size <= old_size)
  ------------------
  |  Branch (103:9): [True: 1.96M, False: 1.62k]
  ------------------
  104|  1.96M|	return CAIRO_STATUS_SUCCESS;
  105|       |
  106|  1.62k|    if (old_size == 0)
  ------------------
  |  Branch (106:9): [True: 439, False: 1.19k]
  ------------------
  107|    439|	new_size = 1;
  108|  1.19k|    else
  109|  1.19k|	new_size = old_size * 2;
  110|       |
  111|  3.11k|    while (new_size < required_size)
  ------------------
  |  Branch (111:12): [True: 1.49k, False: 1.62k]
  ------------------
  112|  1.49k|	new_size = new_size * 2;
  113|       |
  114|  1.62k|    array->size = new_size;
  115|  1.62k|    new_elements = _cairo_realloc_ab (array->elements,
  116|  1.62k|			              array->size, array->element_size);
  117|       |
  118|  1.62k|    if (unlikely (new_elements == NULL)) {
  ------------------
  |  |  145|  1.62k|#define unlikely(expr) (__builtin_expect (!!(expr), 0))
  |  |  ------------------
  |  |  |  Branch (145:24): [True: 0, False: 1.62k]
  |  |  ------------------
  ------------------
  119|      0|	array->size = old_size;
  120|      0|	return _cairo_error (CAIRO_STATUS_NO_MEMORY);
  121|      0|    }
  122|       |
  123|  1.62k|    array->elements = new_elements;
  124|       |
  125|  1.62k|    return CAIRO_STATUS_SUCCESS;
  126|  1.62k|}
_cairo_array_index:
  168|    213|{
  169|       |    /* We allow an index of 0 for the no-elements case.
  170|       |     * This makes for cleaner calling code which will often look like:
  171|       |     *
  172|       |     *    elements = _cairo_array_index (array, 0);
  173|       |     *	  for (i=0; i < num_elements; i++) {
  174|       |     *        ... use elements[i] here ...
  175|       |     *    }
  176|       |     *
  177|       |     * which in the num_elements==0 case gets the NULL pointer here,
  178|       |     * but never dereferences it.
  179|       |     */
  180|    213|    if (index == 0 && array->num_elements == 0)
  ------------------
  |  Branch (180:9): [True: 213, False: 0]
  |  Branch (180:23): [True: 71, False: 142]
  ------------------
  181|     71|	return NULL;
  182|       |
  183|    213|    assert (index < array->num_elements);
  ------------------
  |  Branch (183:5): [True: 0, False: 142]
  |  Branch (183:5): [True: 142, False: 0]
  ------------------
  184|       |
  185|    142|    return array->elements + (size_t)index * array->element_size;
  186|    142|}
_cairo_array_append:
  266|     71|{
  267|     71|    return _cairo_array_append_multiple (array, element, 1);
  268|     71|}
_cairo_array_append_multiple:
  286|  1.96M|{
  287|  1.96M|    cairo_status_t status;
  288|  1.96M|    void *dest;
  289|       |
  290|  1.96M|    status = _cairo_array_allocate (array, num_elements, &dest);
  291|  1.96M|    if (unlikely (status))
  ------------------
  |  |  145|  1.96M|#define unlikely(expr) (__builtin_expect (!!(expr), 0))
  |  |  ------------------
  |  |  |  Branch (145:24): [True: 0, False: 1.96M]
  |  |  ------------------
  ------------------
  292|      0|	return status;
  293|       |
  294|  1.96M|    memcpy (dest, elements, (size_t)num_elements * array->element_size);
  295|       |
  296|  1.96M|    return CAIRO_STATUS_SUCCESS;
  297|  1.96M|}
_cairo_array_allocate:
  316|  1.96M|{
  317|  1.96M|    cairo_status_t status;
  318|       |
  319|  1.96M|    status = _cairo_array_grow_by (array, num_elements);
  320|  1.96M|    if (unlikely (status))
  ------------------
  |  |  145|  1.96M|#define unlikely(expr) (__builtin_expect (!!(expr), 0))
  |  |  ------------------
  |  |  |  Branch (145:24): [True: 0, False: 1.96M]
  |  |  ------------------
  ------------------
  321|      0|	return status;
  322|       |
  323|  1.96M|    assert (array->num_elements + num_elements <= array->size);
  ------------------
  |  Branch (323:5): [True: 0, False: 1.96M]
  |  Branch (323:5): [True: 1.96M, False: 0]
  ------------------
  324|       |
  325|  1.96M|    *elements = array->elements + (size_t)array->num_elements * array->element_size;
  326|       |
  327|  1.96M|    array->num_elements += num_elements;
  328|       |
  329|  1.96M|    return CAIRO_STATUS_SUCCESS;
  330|  1.96M|}
_cairo_array_num_elements:
  342|     71|{
  343|     71|    return array->num_elements;
  344|     71|}
_cairo_user_data_array_init:
  372|    497|{
  373|    497|    _cairo_array_init (array, sizeof (cairo_user_data_slot_t));
  374|    497|}
_cairo_user_data_array_fini:
  385|    355|{
  386|    355|    unsigned int num_slots;
  387|       |
  388|    355|    num_slots = array->num_elements;
  389|    355|    if (num_slots) {
  ------------------
  |  Branch (389:9): [True: 71, False: 284]
  ------------------
  390|     71|	cairo_user_data_slot_t *slots;
  391|       |
  392|     71|	slots = _cairo_array_index (array, 0);
  393|    142|	while (num_slots--) {
  ------------------
  |  Branch (393:9): [True: 71, False: 71]
  ------------------
  394|     71|	    cairo_user_data_slot_t *s = &slots[num_slots];
  395|     71|	    if (s->user_data != NULL && s->destroy != NULL)
  ------------------
  |  Branch (395:10): [True: 71, False: 0]
  |  Branch (395:34): [True: 71, False: 0]
  ------------------
  396|     71|		s->destroy (s->user_data);
  397|     71|	}
  398|     71|    }
  399|       |
  400|    355|    _cairo_array_fini (array);
  401|    355|}
_cairo_user_data_array_set_data:
  457|     71|{
  458|     71|    cairo_status_t status;
  459|     71|    unsigned int i, num_slots;
  460|     71|    cairo_user_data_slot_t *slots, *slot, new_slot;
  461|       |
  462|     71|    if (user_data) {
  ------------------
  |  Branch (462:9): [True: 71, False: 0]
  ------------------
  463|     71|	new_slot.key = key;
  464|     71|	new_slot.user_data = user_data;
  465|     71|	new_slot.destroy = destroy;
  466|     71|    } else {
  467|      0|	new_slot.key = NULL;
  468|      0|	new_slot.user_data = NULL;
  469|      0|	new_slot.destroy = NULL;
  470|      0|    }
  471|       |
  472|     71|    slot = NULL;
  473|     71|    num_slots = array->num_elements;
  474|     71|    slots = _cairo_array_index (array, 0);
  475|     71|    for (i = 0; i < num_slots; i++) {
  ------------------
  |  Branch (475:17): [True: 0, False: 71]
  ------------------
  476|      0|	if (slots[i].key == key) {
  ------------------
  |  Branch (476:6): [True: 0, False: 0]
  ------------------
  477|      0|	    slot = &slots[i];
  478|      0|	    if (slot->destroy && slot->user_data)
  ------------------
  |  Branch (478:10): [True: 0, False: 0]
  |  Branch (478:27): [True: 0, False: 0]
  ------------------
  479|      0|		slot->destroy (slot->user_data);
  480|      0|	    break;
  481|      0|	}
  482|      0|	if (user_data && slots[i].user_data == NULL) {
  ------------------
  |  Branch (482:6): [True: 0, False: 0]
  |  Branch (482:19): [True: 0, False: 0]
  ------------------
  483|      0|	    slot = &slots[i];	/* Have to keep searching for an exact match */
  484|      0|	}
  485|      0|    }
  486|       |
  487|     71|    if (slot) {
  ------------------
  |  Branch (487:9): [True: 0, False: 71]
  ------------------
  488|      0|	*slot = new_slot;
  489|      0|	return CAIRO_STATUS_SUCCESS;
  490|      0|    }
  491|       |
  492|     71|    if (user_data == NULL)
  ------------------
  |  Branch (492:9): [True: 0, False: 71]
  ------------------
  493|      0|	return CAIRO_STATUS_SUCCESS;
  494|       |
  495|     71|    status = _cairo_array_append (array, &new_slot);
  496|     71|    if (unlikely (status))
  ------------------
  |  |  145|     71|#define unlikely(expr) (__builtin_expect (!!(expr), 0))
  |  |  ------------------
  |  |  |  Branch (145:24): [True: 0, False: 71]
  |  |  ------------------
  ------------------
  497|      0|	return status;
  498|       |
  499|     71|    return CAIRO_STATUS_SUCCESS;
  500|     71|}

cairo-pattern.c:_cairo_atomic_int_get:
   61|    497|{
   62|       |    return atomic_load_explicit (x, memory_order_seq_cst);
   63|    497|}
cairo-surface.c:_cairo_atomic_int_cmpxchg_impl:
   92|    142|{
   93|    142|    int expected = oldv;
   94|       |    return atomic_compare_exchange_strong_explicit (x, &expected, newv, memory_order_seq_cst, memory_order_seq_cst);
   95|    142|}
cairo-surface.c:_cairo_atomic_int_get:
   61|  1.06k|{
   62|       |    return atomic_load_explicit (x, memory_order_seq_cst);
   63|  1.06k|}
cairo.c:_cairo_atomic_int_get:
   61|    142|{
   62|       |    return atomic_load_explicit (x, memory_order_seq_cst);
   63|    142|}
cairo.c:_cairo_atomic_int_cmpxchg_impl:
   92|     71|{
   93|     71|    int expected = oldv;
   94|       |    return atomic_compare_exchange_strong_explicit (x, &expected, newv, memory_order_seq_cst, memory_order_seq_cst);
   95|     71|}
cairo-clip.c:_cairo_atomic_int_get_relaxed:
   67|    142|{
   68|       |    return atomic_load_explicit (x, memory_order_relaxed);
   69|    142|}
cairo-clip.c:_cairo_atomic_ptr_cmpxchg_impl:
  115|    142|{
  116|    142|    void *expected = oldv;
  117|       |    return atomic_compare_exchange_strong_explicit (x, &expected, newv, memory_order_seq_cst, memory_order_seq_cst);
  118|    142|}
cairo-clip.c:_cairo_atomic_int_set_relaxed:
   73|    141|{
   74|       |    atomic_store_explicit (x, val, memory_order_relaxed);
   75|    141|}
cairo-clip.c:_cairo_atomic_ptr_get:
   79|     71|{
   80|       |    return atomic_load_explicit (x, memory_order_seq_cst);
   81|     71|}
cairo-default-context.c:_cairo_atomic_int_get_relaxed:
   67|    142|{
   68|       |    return atomic_load_explicit (x, memory_order_relaxed);
   69|    142|}
cairo-default-context.c:_cairo_atomic_ptr_get:
   79|     71|{
   80|       |    return atomic_load_explicit (x, memory_order_seq_cst);
   81|     71|}
cairo-default-context.c:_cairo_atomic_ptr_cmpxchg_impl:
  115|    142|{
  116|    142|    void *expected = oldv;
  117|       |    return atomic_compare_exchange_strong_explicit (x, &expected, newv, memory_order_seq_cst, memory_order_seq_cst);
  118|    142|}
cairo-default-context.c:_cairo_atomic_int_set_relaxed:
   73|    141|{
   74|       |    atomic_store_explicit (x, val, memory_order_relaxed);
   75|    141|}
cairo-freed-pool.c:_cairo_atomic_ptr_get:
   79|     32|{
   80|       |    return atomic_load_explicit (x, memory_order_seq_cst);
   81|     32|}
cairo-freed-pool.c:_cairo_atomic_ptr_cmpxchg_impl:
  115|     32|{
  116|     32|    void *expected = oldv;
  117|       |    return atomic_compare_exchange_strong_explicit (x, &expected, newv, memory_order_seq_cst, memory_order_seq_cst);
  118|     32|}
cairo-freed-pool.c:_cairo_atomic_int_set_relaxed:
   73|      2|{
   74|       |    atomic_store_explicit (x, val, memory_order_relaxed);
   75|      2|}
cairo-image-compositor.c:_cairo_atomic_init_once_enter:
  541|     72|{
  542|     72|    if (likely(_cairo_atomic_int_get(once) == CAIRO_ATOMIC_ONCE_INITIALIZED))
  ------------------
  |  |  144|     72|#define likely(expr) (__builtin_expect (!!(expr), 1))
  |  |  ------------------
  |  |  |  Branch (144:22): [True: 70, False: 2]
  |  |  ------------------
  ------------------
  543|     70|	return 0;
  544|       |
  545|      2|    if (_cairo_atomic_int_cmpxchg(once,
  ------------------
  |  |   98|      2|  _cairo_atomic_int_cmpxchg_impl(x, oldv, newv)
  |  |  ------------------
  |  |  |  Branch (98:3): [True: 2, False: 0]
  |  |  ------------------
  ------------------
  546|      2|				  CAIRO_ATOMIC_ONCE_UNINITIALIZED,
  547|      2|				  CAIRO_ATOMIC_ONCE_INITIALIZING))
  548|      2|	return 1;
  549|       |
  550|      0|    while (_cairo_atomic_int_get(once) != CAIRO_ATOMIC_ONCE_INITIALIZED) {}
  ------------------
  |  |  536|      0|#define CAIRO_ATOMIC_ONCE_INITIALIZED   (2)
  ------------------
  |  Branch (550:12): [True: 0, False: 0]
  ------------------
  551|      0|    return 0;
  552|      2|}
cairo-image-compositor.c:_cairo_atomic_int_get:
   61|     72|{
   62|       |    return atomic_load_explicit (x, memory_order_seq_cst);
   63|     72|}
cairo-image-compositor.c:_cairo_atomic_int_cmpxchg_impl:
   92|      4|{
   93|      4|    int expected = oldv;
   94|       |    return atomic_compare_exchange_strong_explicit (x, &expected, newv, memory_order_seq_cst, memory_order_seq_cst);
   95|      4|}
cairo-image-compositor.c:_cairo_atomic_init_once_leave:
  556|      2|{
  557|      2|    if (unlikely(!_cairo_atomic_int_cmpxchg(once,
  ------------------
  |  |  145|      2|#define unlikely(expr) (__builtin_expect (!!(expr), 0))
  |  |  ------------------
  |  |  |  Branch (145:24): [True: 0, False: 2]
  |  |  ------------------
  ------------------
  558|      2|					    CAIRO_ATOMIC_ONCE_INITIALIZING,
  559|      2|					    CAIRO_ATOMIC_ONCE_INITIALIZED)))
  560|       |	assert (0 && "incorrect use of _cairo_atomic_init_once API (once != CAIRO_ATOMIC_ONCE_INITIALIZING)");
  ------------------
  |  Branch (560:2): [Folded, False: 0]
  |  Branch (560:2): [True: 0, False: 0]
  |  Branch (560:2): [Folded, False: 0]
  |  Branch (560:2): [True: 0, False: 0]
  ------------------
  561|      2|}

cairo-clip-boxes.c:_cairo_box_from_rectangle_int:
   63|    142|{
   64|    142|    box->p1.x = _cairo_fixed_from_int (rect->x);
   65|    142|    box->p1.y = _cairo_fixed_from_int (rect->y);
   66|    142|    box->p2.x = _cairo_fixed_from_int (rect->x + rect->width);
   67|    142|    box->p2.y = _cairo_fixed_from_int (rect->y + rect->height);
   68|    142|}
cairo-clip-boxes.c:_cairo_box_is_pixel_aligned:
  112|     71|{
  113|       |#if CAIRO_FIXED_FRAC_BITS <= 8 && 0
  114|       |    return ((cairo_fixed_unsigned_t)(box->p1.x & CAIRO_FIXED_FRAC_MASK) << 24 |
  115|       |	    (box->p1.y & CAIRO_FIXED_FRAC_MASK) << 16 |
  116|       |	    (box->p2.x & CAIRO_FIXED_FRAC_MASK) << 8 |
  117|       |	    (box->p2.y & CAIRO_FIXED_FRAC_MASK) << 0) == 0;
  118|       |#else /* GCC on i7 prefers this variant (bizarrely according to the profiler) */
  119|     71|    cairo_fixed_t f;
  120|       |
  121|     71|    f = 0;
  122|     71|    f |= box->p1.x & CAIRO_FIXED_FRAC_MASK;
  ------------------
  |  |   63|     71|#define CAIRO_FIXED_FRAC_MASK  ((cairo_fixed_t)(((cairo_fixed_unsigned_t)(-1)) >> (CAIRO_FIXED_BITS - CAIRO_FIXED_FRAC_BITS)))
  |  |  ------------------
  |  |  |  |   56|     71|#define CAIRO_FIXED_BITS	32
  |  |  ------------------
  |  |               #define CAIRO_FIXED_FRAC_MASK  ((cairo_fixed_t)(((cairo_fixed_unsigned_t)(-1)) >> (CAIRO_FIXED_BITS - CAIRO_FIXED_FRAC_BITS)))
  |  |  ------------------
  |  |  |  |   62|     71|#define CAIRO_FIXED_FRAC_BITS	8
  |  |  ------------------
  ------------------
  123|     71|    f |= box->p1.y & CAIRO_FIXED_FRAC_MASK;
  ------------------
  |  |   63|     71|#define CAIRO_FIXED_FRAC_MASK  ((cairo_fixed_t)(((cairo_fixed_unsigned_t)(-1)) >> (CAIRO_FIXED_BITS - CAIRO_FIXED_FRAC_BITS)))
  |  |  ------------------
  |  |  |  |   56|     71|#define CAIRO_FIXED_BITS	32
  |  |  ------------------
  |  |               #define CAIRO_FIXED_FRAC_MASK  ((cairo_fixed_t)(((cairo_fixed_unsigned_t)(-1)) >> (CAIRO_FIXED_BITS - CAIRO_FIXED_FRAC_BITS)))
  |  |  ------------------
  |  |  |  |   62|     71|#define CAIRO_FIXED_FRAC_BITS	8
  |  |  ------------------
  ------------------
  124|     71|    f |= box->p2.x & CAIRO_FIXED_FRAC_MASK;
  ------------------
  |  |   63|     71|#define CAIRO_FIXED_FRAC_MASK  ((cairo_fixed_t)(((cairo_fixed_unsigned_t)(-1)) >> (CAIRO_FIXED_BITS - CAIRO_FIXED_FRAC_BITS)))
  |  |  ------------------
  |  |  |  |   56|     71|#define CAIRO_FIXED_BITS	32
  |  |  ------------------
  |  |               #define CAIRO_FIXED_FRAC_MASK  ((cairo_fixed_t)(((cairo_fixed_unsigned_t)(-1)) >> (CAIRO_FIXED_BITS - CAIRO_FIXED_FRAC_BITS)))
  |  |  ------------------
  |  |  |  |   62|     71|#define CAIRO_FIXED_FRAC_BITS	8
  |  |  ------------------
  ------------------
  125|     71|    f |= box->p2.y & CAIRO_FIXED_FRAC_MASK;
  ------------------
  |  |   63|     71|#define CAIRO_FIXED_FRAC_MASK  ((cairo_fixed_t)(((cairo_fixed_unsigned_t)(-1)) >> (CAIRO_FIXED_BITS - CAIRO_FIXED_FRAC_BITS)))
  |  |  ------------------
  |  |  |  |   56|     71|#define CAIRO_FIXED_BITS	32
  |  |  ------------------
  |  |               #define CAIRO_FIXED_FRAC_MASK  ((cairo_fixed_t)(((cairo_fixed_unsigned_t)(-1)) >> (CAIRO_FIXED_BITS - CAIRO_FIXED_FRAC_BITS)))
  |  |  ------------------
  |  |  |  |   62|     71|#define CAIRO_FIXED_FRAC_BITS	8
  |  |  ------------------
  ------------------
  126|       |
  127|     71|    return f == 0;
  128|     71|#endif
  129|     71|}

_cairo_boxes_init_for_array:
   79|     71|{
   80|     71|    int n;
   81|       |
   82|     71|    boxes->status = CAIRO_STATUS_SUCCESS;
   83|     71|    boxes->num_limits = 0;
   84|     71|    boxes->num_boxes = num_boxes;
   85|       |
   86|     71|    boxes->tail = &boxes->chunks;
   87|     71|    boxes->chunks.next = NULL;
   88|     71|    boxes->chunks.base = array;
   89|     71|    boxes->chunks.size = num_boxes;
   90|     71|    boxes->chunks.count = num_boxes;
   91|       |
   92|    142|    for (n = 0; n < num_boxes; n++) {
  ------------------
  |  Branch (92:17): [True: 71, False: 71]
  ------------------
   93|     71|	if (! _cairo_fixed_is_integer (array[n].p1.x) ||
  ------------------
  |  Branch (93:6): [True: 0, False: 71]
  ------------------
   94|     71|	    ! _cairo_fixed_is_integer (array[n].p1.y) ||
  ------------------
  |  Branch (94:6): [True: 0, False: 71]
  ------------------
   95|     71|	    ! _cairo_fixed_is_integer (array[n].p2.x) ||
  ------------------
  |  Branch (95:6): [True: 0, False: 71]
  ------------------
   96|     71|	    ! _cairo_fixed_is_integer (array[n].p2.y))
  ------------------
  |  Branch (96:6): [True: 0, False: 71]
  ------------------
   97|      0|	{
   98|      0|	    break;
   99|      0|	}
  100|     71|    }
  101|       |
  102|     71|    boxes->is_pixel_aligned = n == num_boxes;
  103|     71|}
_cairo_boxes_extents:
  290|     71|{
  291|     71|    const struct _cairo_boxes_chunk *chunk;
  292|     71|    cairo_box_t b;
  293|     71|    int i;
  294|       |
  295|     71|    if (boxes->num_boxes == 0) {
  ------------------
  |  Branch (295:9): [True: 0, False: 71]
  ------------------
  296|      0|	box->p1.x = box->p1.y = box->p2.x = box->p2.y = 0;
  297|      0|	return;
  298|      0|    }
  299|       |
  300|     71|    b = boxes->chunks.base[0];
  301|    142|    for (chunk = &boxes->chunks; chunk != NULL; chunk = chunk->next) {
  ------------------
  |  Branch (301:34): [True: 71, False: 71]
  ------------------
  302|    142|	for (i = 0; i < chunk->count; i++) {
  ------------------
  |  Branch (302:14): [True: 71, False: 71]
  ------------------
  303|     71|	    if (chunk->base[i].p1.x < b.p1.x)
  ------------------
  |  Branch (303:10): [True: 0, False: 71]
  ------------------
  304|      0|		b.p1.x = chunk->base[i].p1.x;
  305|       |
  306|     71|	    if (chunk->base[i].p1.y < b.p1.y)
  ------------------
  |  Branch (306:10): [True: 0, False: 71]
  ------------------
  307|      0|		b.p1.y = chunk->base[i].p1.y;
  308|       |
  309|     71|	    if (chunk->base[i].p2.x > b.p2.x)
  ------------------
  |  Branch (309:10): [True: 0, False: 71]
  ------------------
  310|      0|		b.p2.x = chunk->base[i].p2.x;
  311|       |
  312|     71|	    if (chunk->base[i].p2.y > b.p2.y)
  ------------------
  |  Branch (312:10): [True: 0, False: 71]
  ------------------
  313|      0|		b.p2.y = chunk->base[i].p2.y;
  314|     71|	}
  315|     71|    }
  316|     71|    *box = b;
  317|     71|}

_cairo_clip_contains_rectangle:
  106|     71|{
  107|     71|    cairo_box_t box;
  108|       |
  109|     71|    _cairo_box_from_rectangle_int (&box, rect);
  110|     71|    return _cairo_clip_contains_rectangle_box (clip, rect, &box);
  111|     71|}
_cairo_clip_intersect_rectangle:
  352|     71|{
  353|     71|    cairo_box_t box;
  354|       |
  355|     71|    if (_cairo_clip_is_all_clipped (clip))
  ------------------
  |  Branch (355:9): [True: 0, False: 71]
  ------------------
  356|      0|	return clip;
  357|       |
  358|     71|    if (r->width == 0 || r->height == 0)
  ------------------
  |  Branch (358:9): [True: 0, False: 71]
  |  Branch (358:26): [True: 0, False: 71]
  ------------------
  359|      0|	return _cairo_clip_set_all_clipped (clip);
  360|       |
  361|     71|    _cairo_box_from_rectangle_int (&box, r);
  362|       |
  363|     71|    return _cairo_clip_intersect_rectangle_box (clip, r, &box);
  364|     71|}
_cairo_clip_reduce_to_rectangle:
  558|     71|{
  559|     71|    cairo_clip_t *copy;
  560|       |
  561|     71|    if (_cairo_clip_is_all_clipped (clip))
  ------------------
  |  Branch (561:9): [True: 0, False: 71]
  ------------------
  562|      0|	return (cairo_clip_t *) clip;
  563|       |
  564|     71|    if (_cairo_clip_contains_rectangle (clip, r))
  ------------------
  |  Branch (564:9): [True: 71, False: 0]
  ------------------
  565|     71|	return _cairo_clip_intersect_rectangle (NULL, r);
  566|       |
  567|      0|    copy = _cairo_clip_copy_intersect_rectangle (clip, r);
  568|      0|    if (_cairo_clip_is_all_clipped (copy))
  ------------------
  |  Branch (568:9): [True: 0, False: 0]
  ------------------
  569|      0|	return copy;
  570|       |
  571|      0|    return _cairo_clip_reduce_to_boxes (copy);
  572|      0|}
_cairo_clip_reduce_for_composite:
  577|     71|{
  578|     71|    const cairo_rectangle_int_t *r;
  579|       |
  580|     71|    r = extents->is_bounded ? &extents->bounded : &extents->unbounded;
  ------------------
  |  Branch (580:9): [True: 71, False: 0]
  ------------------
  581|     71|    return _cairo_clip_reduce_to_rectangle (clip, r);
  582|     71|}
cairo-clip-boxes.c:_cairo_clip_contains_rectangle_box:
   59|     71|{
   60|     71|    int i;
   61|       |
   62|       |    /* clip == NULL means no clip, so the clip contains everything */
   63|     71|    if (clip == NULL)
  ------------------
  |  Branch (63:9): [True: 71, False: 0]
  ------------------
   64|     71|	return TRUE;
  ------------------
  |  |  106|     71|#define TRUE 1
  ------------------
   65|       |
   66|      0|    if (_cairo_clip_is_all_clipped (clip))
  ------------------
  |  Branch (66:9): [True: 0, False: 0]
  ------------------
   67|      0|	return FALSE;
  ------------------
  |  |  102|      0|#define FALSE 0
  ------------------
   68|       |
   69|       |    /* If we have a non-trivial path, just say no */
   70|      0|    if (clip->path)
  ------------------
  |  Branch (70:9): [True: 0, False: 0]
  ------------------
   71|      0|	return FALSE;
  ------------------
  |  |  102|      0|#define FALSE 0
  ------------------
   72|       |
   73|      0|    if (! _cairo_rectangle_contains_rectangle (&clip->extents, rect))
  ------------------
  |  Branch (73:9): [True: 0, False: 0]
  ------------------
   74|      0|	return FALSE;
  ------------------
  |  |  102|      0|#define FALSE 0
  ------------------
   75|       |
   76|      0|    if (clip->num_boxes == 0)
  ------------------
  |  Branch (76:9): [True: 0, False: 0]
  ------------------
   77|      0|	return TRUE;
  ------------------
  |  |  106|      0|#define TRUE 1
  ------------------
   78|       |
   79|       |    /* Check for a clip-box that wholly contains the rectangle */
   80|      0|    for (i = 0; i < clip->num_boxes; i++) {
  ------------------
  |  Branch (80:17): [True: 0, False: 0]
  ------------------
   81|      0|	if (box->p1.x >= clip->boxes[i].p1.x &&
  ------------------
  |  Branch (81:6): [True: 0, False: 0]
  ------------------
   82|      0|	    box->p1.y >= clip->boxes[i].p1.y &&
  ------------------
  |  Branch (82:6): [True: 0, False: 0]
  ------------------
   83|      0|	    box->p2.x <= clip->boxes[i].p2.x &&
  ------------------
  |  Branch (83:6): [True: 0, False: 0]
  ------------------
   84|      0|	    box->p2.y <= clip->boxes[i].p2.y)
  ------------------
  |  Branch (84:6): [True: 0, False: 0]
  ------------------
   85|      0|	{
   86|      0|	    return TRUE;
  ------------------
  |  |  106|      0|#define TRUE 1
  ------------------
   87|      0|	}
   88|      0|    }
   89|       |
   90|      0|    return FALSE;
  ------------------
  |  |  102|      0|#define FALSE 0
  ------------------
   91|      0|}
cairo-clip-boxes.c:_cairo_clip_intersect_rectangle_box:
  140|     71|{
  141|     71|    cairo_box_t extents_box;
  142|     71|    cairo_bool_t changed = FALSE;
  ------------------
  |  |  102|     71|#define FALSE 0
  ------------------
  143|     71|    int i, j;
  144|       |
  145|     71|    if (clip == NULL) {
  ------------------
  |  Branch (145:9): [True: 71, False: 0]
  ------------------
  146|     71|	clip = _cairo_clip_create ();
  147|     71|	if (clip == NULL)
  ------------------
  |  Branch (147:6): [True: 0, False: 71]
  ------------------
  148|      0|	    return _cairo_clip_set_all_clipped (clip);
  149|     71|    }
  150|       |
  151|     71|    if (clip->num_boxes == 0) {
  ------------------
  |  Branch (151:9): [True: 71, False: 0]
  ------------------
  152|     71|	clip->boxes = &clip->embedded_box;
  153|     71|	clip->boxes[0] = *box;
  154|     71|	clip->num_boxes = 1;
  155|     71|	if (clip->path == NULL) {
  ------------------
  |  Branch (155:6): [True: 71, False: 0]
  ------------------
  156|     71|	    clip->extents = *r;
  157|     71|	} else {
  158|      0|	    if (! _cairo_rectangle_intersect (&clip->extents, r))
  ------------------
  |  Branch (158:10): [True: 0, False: 0]
  ------------------
  159|      0|		return _cairo_clip_set_all_clipped (clip);
  160|      0|	}
  161|     71|	if (clip->path == NULL)
  ------------------
  |  Branch (161:6): [True: 71, False: 0]
  ------------------
  162|     71|	    clip->is_region = _cairo_box_is_pixel_aligned (box);
  163|     71|	return clip;
  164|     71|    }
  165|       |
  166|       |    /* Does the new box wholly subsume the clip? Perform a cheap check
  167|       |     * for the common condition of a single clip rectangle.
  168|       |     */
  169|      0|    if (clip->num_boxes == 1 &&
  ------------------
  |  Branch (169:9): [True: 0, False: 0]
  ------------------
  170|      0|	clip->boxes[0].p1.x >= box->p1.x &&
  ------------------
  |  Branch (170:2): [True: 0, False: 0]
  ------------------
  171|      0|	clip->boxes[0].p1.y >= box->p1.y &&
  ------------------
  |  Branch (171:2): [True: 0, False: 0]
  ------------------
  172|      0|	clip->boxes[0].p2.x <= box->p2.x &&
  ------------------
  |  Branch (172:2): [True: 0, False: 0]
  ------------------
  173|      0|	clip->boxes[0].p2.y <= box->p2.y)
  ------------------
  |  Branch (173:2): [True: 0, False: 0]
  ------------------
  174|      0|    {
  175|      0|	return clip;
  176|      0|    }
  177|       |
  178|      0|    for (i = j = 0; i < clip->num_boxes; i++) {
  ------------------
  |  Branch (178:21): [True: 0, False: 0]
  ------------------
  179|      0|	cairo_box_t *b = &clip->boxes[j];
  180|       |
  181|      0|	if (j != i)
  ------------------
  |  Branch (181:6): [True: 0, False: 0]
  ------------------
  182|      0|	    *b = clip->boxes[i];
  183|       |
  184|      0|	if (box->p1.x > b->p1.x)
  ------------------
  |  Branch (184:6): [True: 0, False: 0]
  ------------------
  185|      0|	    b->p1.x = box->p1.x, changed = TRUE;
  ------------------
  |  |  106|      0|#define TRUE 1
  ------------------
  186|      0|	if (box->p2.x < b->p2.x)
  ------------------
  |  Branch (186:6): [True: 0, False: 0]
  ------------------
  187|      0|	    b->p2.x = box->p2.x, changed = TRUE;
  ------------------
  |  |  106|      0|#define TRUE 1
  ------------------
  188|       |
  189|      0|	if (box->p1.y > b->p1.y)
  ------------------
  |  Branch (189:6): [True: 0, False: 0]
  ------------------
  190|      0|	    b->p1.y = box->p1.y, changed = TRUE;
  ------------------
  |  |  106|      0|#define TRUE 1
  ------------------
  191|      0|	if (box->p2.y < b->p2.y)
  ------------------
  |  Branch (191:6): [True: 0, False: 0]
  ------------------
  192|      0|	    b->p2.y = box->p2.y, changed = TRUE;
  ------------------
  |  |  106|      0|#define TRUE 1
  ------------------
  193|       |
  194|      0|	j += b->p2.x > b->p1.x && b->p2.y > b->p1.y;
  ------------------
  |  Branch (194:7): [True: 0, False: 0]
  |  Branch (194:28): [True: 0, False: 0]
  ------------------
  195|      0|    }
  196|      0|    clip->num_boxes = j;
  197|       |
  198|      0|    if (clip->num_boxes == 0)
  ------------------
  |  Branch (198:9): [True: 0, False: 0]
  ------------------
  199|      0|	return _cairo_clip_set_all_clipped (clip);
  200|       |
  201|      0|    if (! changed)
  ------------------
  |  Branch (201:9): [True: 0, False: 0]
  ------------------
  202|      0|	return clip;
  203|       |
  204|      0|    extents_box = clip->boxes[0];
  205|      0|    for (i = 1; i < clip->num_boxes; i++) {
  ------------------
  |  Branch (205:17): [True: 0, False: 0]
  ------------------
  206|      0|	    if (clip->boxes[i].p1.x < extents_box.p1.x)
  ------------------
  |  Branch (206:10): [True: 0, False: 0]
  ------------------
  207|      0|		extents_box.p1.x = clip->boxes[i].p1.x;
  208|       |
  209|      0|	    if (clip->boxes[i].p1.y < extents_box.p1.y)
  ------------------
  |  Branch (209:10): [True: 0, False: 0]
  ------------------
  210|      0|		extents_box.p1.y = clip->boxes[i].p1.y;
  211|       |
  212|      0|	    if (clip->boxes[i].p2.x > extents_box.p2.x)
  ------------------
  |  Branch (212:10): [True: 0, False: 0]
  ------------------
  213|      0|		extents_box.p2.x = clip->boxes[i].p2.x;
  214|       |
  215|      0|	    if (clip->boxes[i].p2.y > extents_box.p2.y)
  ------------------
  |  Branch (215:10): [True: 0, False: 0]
  ------------------
  216|      0|		extents_box.p2.y = clip->boxes[i].p2.y;
  217|      0|    }
  218|       |
  219|      0|    if (clip->path == NULL) {
  ------------------
  |  Branch (219:9): [True: 0, False: 0]
  ------------------
  220|      0|	_cairo_box_round_to_rectangle (&extents_box, &clip->extents);
  221|      0|    } else {
  222|      0|	cairo_rectangle_int_t extents_rect;
  223|       |
  224|      0|	_cairo_box_round_to_rectangle (&extents_box, &extents_rect);
  225|      0|	if (! _cairo_rectangle_intersect (&clip->extents, &extents_rect))
  ------------------
  |  Branch (225:6): [True: 0, False: 0]
  ------------------
  226|      0|	    return _cairo_clip_set_all_clipped (clip);
  227|      0|    }
  228|       |
  229|      0|    if (clip->region) {
  ------------------
  |  Branch (229:9): [True: 0, False: 0]
  ------------------
  230|      0|	cairo_region_destroy (clip->region);
  231|      0|	clip->region = NULL;
  232|      0|    }
  233|       |
  234|      0|    clip->is_region = FALSE;
  ------------------
  |  |  102|      0|#define FALSE 0
  ------------------
  235|      0|    return clip;
  236|      0|}

cairo-surface.c:_cairo_clip_is_all_clipped:
   43|     71|{
   44|     71|    return clip == &__cairo_clip_all;
   45|     71|}
cairo-clip-boxes.c:_cairo_clip_is_all_clipped:
   43|    142|{
   44|    142|    return clip == &__cairo_clip_all;
   45|    142|}
cairo-clip.c:_cairo_clip_is_all_clipped:
   43|    142|{
   44|    142|    return clip == &__cairo_clip_all;
   45|    142|}
cairo-composite-rectangles.c:_cairo_clip_is_all_clipped:
   43|    142|{
   44|    142|    return clip == &__cairo_clip_all;
   45|    142|}
cairo-gstate.c:_cairo_clip_is_all_clipped:
   43|     71|{
   44|     71|    return clip == &__cairo_clip_all;
   45|     71|}
cairo-spans-compositor.c:_cairo_clip_steal_boxes:
   70|     71|{
   71|     71|    cairo_box_t *array = clip->boxes;
   72|       |
   73|     71|    if (array == &clip->embedded_box) {
  ------------------
  |  Branch (73:9): [True: 71, False: 0]
  ------------------
   74|     71|	assert (clip->num_boxes == 1);
  ------------------
  |  Branch (74:2): [True: 0, False: 71]
  |  Branch (74:2): [True: 71, False: 0]
  ------------------
   75|     71|	boxes->boxes_embedded[0] = clip->embedded_box;
   76|     71|	array = &boxes->boxes_embedded[0];
   77|     71|    }
   78|     71|    _cairo_boxes_init_for_array (boxes, array, clip->num_boxes);
   79|       |    clip->boxes = NULL;
   80|     71|    clip->num_boxes = 0;
   81|     71|}
cairo-spans-compositor.c:_cairo_clip_unsteal_boxes:
   85|     71|{
   86|     71|    if (boxes->chunks.base == &boxes->boxes_embedded[0]) {
  ------------------
  |  Branch (86:9): [True: 71, False: 0]
  ------------------
   87|     71|	assert(boxes->num_boxes == 1);
  ------------------
  |  Branch (87:2): [True: 0, False: 71]
  |  Branch (87:2): [True: 71, False: 0]
  ------------------
   88|     71|	clip->embedded_box = *boxes->chunks.base;
   89|     71|	clip->boxes = &clip->embedded_box;
   90|     71|    } else {
   91|      0|	clip->boxes = boxes->chunks.base;
   92|      0|    }
   93|     71|    clip->num_boxes = boxes->num_boxes;
   94|     71|}

_cairo_clip_create:
  106|     71|{
  107|     71|    cairo_clip_t *clip;
  108|       |
  109|     71|    clip = _freed_pool_get (&clip_pool);
  110|     71|    if (unlikely (clip == NULL)) {
  ------------------
  |  |  145|     71|#define unlikely(expr) (__builtin_expect (!!(expr), 0))
  |  |  ------------------
  |  |  |  Branch (145:24): [True: 1, False: 70]
  |  |  ------------------
  ------------------
  111|      1|	clip = _cairo_calloc (sizeof (cairo_clip_t));
  ------------------
  |  |   79|      1|    ((size) != 0 ? calloc(1,size) : NULL)
  |  |  ------------------
  |  |  |  Branch (79:6): [True: 1, Folded]
  |  |  ------------------
  ------------------
  112|      1|	if (unlikely (clip == NULL))
  ------------------
  |  |  145|      1|#define unlikely(expr) (__builtin_expect (!!(expr), 0))
  |  |  ------------------
  |  |  |  Branch (145:24): [True: 0, False: 1]
  |  |  ------------------
  ------------------
  113|      0|	    return NULL;
  114|      1|    }
  115|       |
  116|     71|    clip->extents = _cairo_unbounded_rectangle;
  117|       |
  118|     71|    clip->path = NULL;
  119|     71|    clip->boxes = NULL;
  120|     71|    clip->num_boxes = 0;
  121|     71|    clip->region = NULL;
  122|     71|    clip->is_region = FALSE;
  ------------------
  |  |  102|     71|#define FALSE 0
  ------------------
  123|       |
  124|     71|    return clip;
  125|     71|}
_cairo_clip_destroy:
  129|    142|{
  130|    142|    if (clip == NULL || _cairo_clip_is_all_clipped (clip))
  ------------------
  |  Branch (130:9): [True: 71, False: 71]
  |  Branch (130:25): [True: 0, False: 71]
  ------------------
  131|     71|	return;
  132|       |
  133|     71|    if (clip->path != NULL)
  ------------------
  |  Branch (133:9): [True: 0, False: 71]
  ------------------
  134|      0|	_cairo_clip_path_destroy (clip->path);
  135|       |
  136|     71|    if (clip->boxes != &clip->embedded_box)
  ------------------
  |  Branch (136:9): [True: 0, False: 71]
  ------------------
  137|      0|	free (clip->boxes);
  138|     71|    cairo_region_destroy (clip->region);
  139|       |
  140|     71|    _freed_pool_put (&clip_pool, clip);
  141|     71|}
_cairo_clip_get_extents:
  689|     71|{
  690|     71|    if (clip == NULL)
  ------------------
  |  Branch (690:9): [True: 0, False: 71]
  ------------------
  691|      0|	return &_cairo_unbounded_rectangle;
  692|       |
  693|     71|    if (_cairo_clip_is_all_clipped (clip))
  ------------------
  |  Branch (693:9): [True: 0, False: 71]
  ------------------
  694|      0|	return &_cairo_empty_rectangle;
  695|       |
  696|     71|    return &clip->extents;
  697|     71|}

_cairo_composite_rectangles_fini:
   46|     71|{
   47|       |    /* If adding further free() code here, make sure those fields are inited by
   48|       |     * _cairo_composite_rectangles_init IN ALL CASES
   49|       |     */
   50|     71|    _cairo_clip_destroy (extents->clip);
   51|       |    extents->clip = NULL;
   52|     71|}
_cairo_composite_rectangles_init_for_paint:
  127|     71|{
  128|     71|    if (! _cairo_composite_rectangles_init (extents,
  ------------------
  |  Branch (128:9): [True: 0, False: 71]
  ------------------
  129|     71|					    surface, op, source, clip))
  130|      0|    {
  131|      0|	goto NOTHING_TO_DO;
  132|      0|    }
  133|       |
  134|     71|    extents->mask = extents->destination;
  135|       |
  136|     71|    extents->clip = _cairo_clip_reduce_for_composite (clip, extents);
  137|     71|    if (_cairo_clip_is_all_clipped (extents->clip))
  ------------------
  |  Branch (137:9): [True: 0, False: 71]
  ------------------
  138|      0|	goto NOTHING_TO_DO;
  139|       |
  140|     71|    if (! _cairo_rectangle_intersect (&extents->unbounded,
  ------------------
  |  Branch (140:9): [True: 0, False: 71]
  ------------------
  141|     71|				      _cairo_clip_get_extents (extents->clip)))
  142|      0|	goto NOTHING_TO_DO;
  143|       |
  144|     71|    if (extents->source_pattern.base.type != CAIRO_PATTERN_TYPE_SOLID)
  ------------------
  |  Branch (144:9): [True: 71, False: 0]
  ------------------
  145|     71|	_cairo_pattern_sampled_area (&extents->source_pattern.base,
  146|     71|				     &extents->bounded,
  147|     71|				     &extents->source_sample_area);
  148|       |
  149|     71|    return CAIRO_INT_STATUS_SUCCESS;
  150|      0|NOTHING_TO_DO:
  151|      0|    _cairo_composite_rectangles_fini(extents);
  152|      0|    return CAIRO_INT_STATUS_NOTHING_TO_DO;
  153|     71|}
_cairo_composite_rectangles_intersect_mask_extents:
  268|     71|{
  269|     71|    cairo_rectangle_int_t mask;
  270|     71|    cairo_clip_t *clip;
  271|       |
  272|     71|    _cairo_box_round_to_rectangle (box, &mask);
  273|     71|    if (mask.x == extents->mask.x &&
  ------------------
  |  Branch (273:9): [True: 71, False: 0]
  ------------------
  274|     71|	mask.y == extents->mask.y &&
  ------------------
  |  Branch (274:2): [True: 71, False: 0]
  ------------------
  275|     71|	mask.width  == extents->mask.width &&
  ------------------
  |  Branch (275:2): [True: 71, False: 0]
  ------------------
  276|     71|	mask.height == extents->mask.height)
  ------------------
  |  Branch (276:2): [True: 71, False: 0]
  ------------------
  277|     71|    {
  278|     71|	return CAIRO_INT_STATUS_SUCCESS;
  279|     71|    }
  280|       |
  281|      0|    _cairo_rectangle_intersect (&extents->mask, &mask);
  282|       |
  283|      0|    mask = extents->bounded;
  284|      0|    if (! _cairo_rectangle_intersect (&extents->bounded, &extents->mask) &&
  ------------------
  |  Branch (284:9): [True: 0, False: 0]
  ------------------
  285|      0|	extents->is_bounded & CAIRO_OPERATOR_BOUND_BY_MASK)
  ------------------
  |  Branch (285:2): [True: 0, False: 0]
  ------------------
  286|      0|	return CAIRO_INT_STATUS_NOTHING_TO_DO;
  287|       |
  288|      0|    if (mask.width  == extents->bounded.width &&
  ------------------
  |  Branch (288:9): [True: 0, False: 0]
  ------------------
  289|      0|	mask.height == extents->bounded.height)
  ------------------
  |  Branch (289:2): [True: 0, False: 0]
  ------------------
  290|      0|	return CAIRO_INT_STATUS_SUCCESS;
  291|       |
  292|      0|    if (extents->is_bounded == (CAIRO_OPERATOR_BOUND_BY_MASK | CAIRO_OPERATOR_BOUND_BY_SOURCE)) {
  ------------------
  |  Branch (292:9): [True: 0, False: 0]
  ------------------
  293|      0|	extents->unbounded = extents->bounded;
  294|      0|    } else if (extents->is_bounded & CAIRO_OPERATOR_BOUND_BY_MASK) {
  ------------------
  |  Branch (294:16): [True: 0, False: 0]
  ------------------
  295|      0|	if (!_cairo_rectangle_intersect (&extents->unbounded, &extents->mask))
  ------------------
  |  Branch (295:6): [True: 0, False: 0]
  ------------------
  296|      0|	    return CAIRO_INT_STATUS_NOTHING_TO_DO;
  297|      0|    }
  298|       |
  299|      0|    clip = extents->clip;
  300|      0|    extents->clip = _cairo_clip_reduce_for_composite (clip, extents);
  301|      0|    if (clip != extents->clip)
  ------------------
  |  Branch (301:9): [True: 0, False: 0]
  ------------------
  302|      0|	_cairo_clip_destroy (clip);
  303|       |
  304|      0|    if (_cairo_clip_is_all_clipped (extents->clip))
  ------------------
  |  Branch (304:9): [True: 0, False: 0]
  ------------------
  305|      0|	return CAIRO_INT_STATUS_NOTHING_TO_DO;
  306|       |
  307|      0|    if (! _cairo_rectangle_intersect (&extents->unbounded,
  ------------------
  |  Branch (307:9): [True: 0, False: 0]
  ------------------
  308|      0|				      _cairo_clip_get_extents (extents->clip)))
  309|      0|	return CAIRO_INT_STATUS_NOTHING_TO_DO;
  310|       |
  311|      0|    if (extents->source_pattern.base.type != CAIRO_PATTERN_TYPE_SOLID)
  ------------------
  |  Branch (311:9): [True: 0, False: 0]
  ------------------
  312|      0|	_cairo_pattern_sampled_area (&extents->source_pattern.base,
  313|      0|				     &extents->bounded,
  314|      0|				     &extents->source_sample_area);
  315|      0|    if (extents->mask_pattern.base.type != CAIRO_PATTERN_TYPE_SOLID) {
  ------------------
  |  Branch (315:9): [True: 0, False: 0]
  ------------------
  316|      0|	_cairo_pattern_sampled_area (&extents->mask_pattern.base,
  317|      0|				     &extents->bounded,
  318|      0|				     &extents->mask_sample_area);
  319|      0|	if (extents->mask_sample_area.width == 0 ||
  ------------------
  |  Branch (319:6): [True: 0, False: 0]
  ------------------
  320|      0|	    extents->mask_sample_area.height == 0)
  ------------------
  |  Branch (320:6): [True: 0, False: 0]
  ------------------
  321|      0|	    return CAIRO_INT_STATUS_NOTHING_TO_DO;
  322|      0|    }
  323|       |
  324|      0|    return CAIRO_INT_STATUS_SUCCESS;
  325|      0|}
cairo-composite-rectangles.c:_cairo_composite_rectangles_init:
   82|     71|{
   83|       |    /* Always set the clip so that a _cairo_composite_rectangles_init can ALWAYS be
   84|       |     * balanced by a _cairo_composite_rectangles_fini */
   85|     71|    extents->clip = NULL;
   86|       |
   87|     71|    if (_cairo_clip_is_all_clipped (clip))
  ------------------
  |  Branch (87:9): [True: 0, False: 71]
  ------------------
   88|      0|	return FALSE;
  ------------------
  |  |  102|      0|#define FALSE 0
  ------------------
   89|     71|    extents->surface = surface;
   90|     71|    extents->op = op;
   91|       |
   92|     71|    _cairo_surface_get_extents (surface, &extents->destination);
   93|       |
   94|     71|    extents->unbounded = extents->destination;
   95|     71|    if (clip && ! _cairo_rectangle_intersect (&extents->unbounded,
  ------------------
  |  Branch (95:9): [True: 0, False: 71]
  |  Branch (95:17): [True: 0, False: 0]
  ------------------
   96|      0|					      _cairo_clip_get_extents (clip)))
   97|      0|	return FALSE;
  ------------------
  |  |  102|      0|#define FALSE 0
  ------------------
   98|       |
   99|     71|    extents->bounded = extents->unbounded;
  100|     71|    extents->is_bounded = _cairo_operator_bounded_by_either (op);
  101|       |
  102|     71|    extents->original_source_pattern = source;
  103|     71|    _cairo_composite_reduce_pattern (source, &extents->source_pattern);
  104|       |
  105|     71|    _cairo_pattern_get_extents (&extents->source_pattern.base,
  106|     71|				&extents->source,
  107|     71|				surface->is_vector);
  108|     71|    if (extents->is_bounded & CAIRO_OPERATOR_BOUND_BY_SOURCE) {
  ------------------
  |  Branch (108:9): [True: 71, False: 0]
  ------------------
  109|     71|	if (! _cairo_rectangle_intersect (&extents->bounded, &extents->source))
  ------------------
  |  Branch (109:6): [True: 0, False: 71]
  ------------------
  110|      0|	    return FALSE;
  ------------------
  |  |  102|      0|#define FALSE 0
  ------------------
  111|     71|    }
  112|       |
  113|     71|    extents->original_mask_pattern = NULL;
  114|     71|    extents->mask_pattern.base.type = CAIRO_PATTERN_TYPE_SOLID;
  115|     71|    extents->mask_pattern.solid.color.alpha = 1.; /* XXX full initialisation? */
  116|     71|    extents->mask_pattern.solid.color.alpha_short = 0xffff;
  117|       |
  118|     71|    return TRUE;
  ------------------
  |  |  106|     71|#define TRUE 1
  ------------------
  119|     71|}
cairo-composite-rectangles.c:_cairo_composite_reduce_pattern:
   57|     71|{
   58|     71|    int tx, ty;
   59|       |
   60|     71|    _cairo_pattern_init_static_copy (&dst->base, src);
   61|     71|    if (dst->base.type == CAIRO_PATTERN_TYPE_SOLID)
  ------------------
  |  Branch (61:9): [True: 0, False: 71]
  ------------------
   62|      0|	return;
   63|       |
   64|     71|    dst->base.filter = _cairo_pattern_analyze_filter (&dst->base);
   65|       |
   66|     71|    tx = ty = 0;
   67|     71|    if (_cairo_matrix_is_pixman_translation (&dst->base.matrix,
  ------------------
  |  Branch (67:9): [True: 71, False: 0]
  ------------------
   68|     71|					     dst->base.filter,
   69|     71|					     &tx, &ty))
   70|     71|    {
   71|     71|	dst->base.matrix.x0 = tx;
   72|     71|	dst->base.matrix.y0 = ty;
   73|     71|    }
   74|     71|}

_cairo_compositor_paint:
   50|     71|{
   51|     71|    cairo_composite_rectangles_t extents;
   52|     71|    cairo_int_status_t status;
   53|       |
   54|     71|    TRACE ((stderr, "%s\n", __FUNCTION__));
   55|     71|    status = _cairo_composite_rectangles_init_for_paint (&extents, surface,
   56|     71|							 op, source,
   57|     71|							 clip);
   58|     71|    if (unlikely (status))
  ------------------
  |  |  145|     71|#define unlikely(expr) (__builtin_expect (!!(expr), 0))
  |  |  ------------------
  |  |  |  Branch (145:24): [True: 0, False: 71]
  |  |  ------------------
  ------------------
   59|      0|	return status;
   60|       |
   61|     71|    do {
   62|     71|	while (compositor->paint == NULL)
  ------------------
  |  Branch (62:9): [True: 0, False: 71]
  ------------------
   63|      0|	    compositor = compositor->delegate;
   64|       |
   65|     71|	status = compositor->paint (compositor, &extents);
   66|       |
   67|     71|	compositor = compositor->delegate;
   68|     71|    } while (status == CAIRO_INT_STATUS_UNSUPPORTED);
  ------------------
  |  Branch (68:14): [True: 0, False: 71]
  ------------------
   69|       |
   70|     71|    if (status == CAIRO_INT_STATUS_SUCCESS && surface->damage) {
  ------------------
  |  Branch (70:9): [True: 0, False: 71]
  |  Branch (70:47): [True: 0, False: 0]
  ------------------
   71|      0|	TRACE ((stderr, "%s: applying damage (%d,%d)x(%d, %d)\n",
   72|      0|		__FUNCTION__,
   73|      0|		extents.unbounded.x, extents.unbounded.y,
   74|      0|		extents.unbounded.width, extents.unbounded.height));
   75|      0|	surface->damage = _cairo_damage_add_rectangle (surface->damage,
   76|      0|						       &extents.unbounded);
   77|      0|    }
   78|       |
   79|     71|    _cairo_composite_rectangles_fini (&extents);
   80|       |
   81|     71|    return status;
   82|     71|}

_cairo_default_context_fini:
   69|     71|{
   70|     71|    while (cr->gstate != &cr->gstate_tail[0]) {
  ------------------
  |  Branch (70:12): [True: 0, False: 71]
  ------------------
   71|      0|	if (_cairo_gstate_restore (&cr->gstate, &cr->gstate_freelist))
  ------------------
  |  Branch (71:6): [True: 0, False: 0]
  ------------------
   72|      0|	    break;
   73|      0|    }
   74|       |
   75|     71|    _cairo_gstate_fini (cr->gstate);
   76|     71|    cr->gstate_freelist = cr->gstate_freelist->next; /* skip over tail[1] */
   77|     71|    while (cr->gstate_freelist != NULL) {
  ------------------
  |  Branch (77:12): [True: 0, False: 71]
  ------------------
   78|      0|	cairo_gstate_t *gstate = cr->gstate_freelist;
   79|      0|	cr->gstate_freelist = gstate->next;
   80|      0|	free (gstate);
   81|      0|    }
   82|       |
   83|     71|    _cairo_path_fixed_fini (cr->path);
   84|       |
   85|     71|    _cairo_fini (&cr->base);
   86|     71|}
_cairo_default_context_init:
 1497|     71|{
 1498|     71|    _cairo_init (&cr->base, &_cairo_default_context_backend);
 1499|     71|    _cairo_path_fixed_init (cr->path);
 1500|       |
 1501|     71|    cr->gstate = &cr->gstate_tail[0];
 1502|     71|    cr->gstate_freelist = &cr->gstate_tail[1];
 1503|     71|    cr->gstate_tail[1].next = NULL;
 1504|       |
 1505|     71|    return _cairo_gstate_init (cr->gstate, target);
 1506|     71|}
_cairo_default_context_create:
 1510|     71|{
 1511|     71|    cairo_default_context_t *cr;
 1512|     71|    cairo_status_t status;
 1513|       |
 1514|     71|    cr = _freed_pool_get (&context_pool);
 1515|     71|    if (unlikely (cr == NULL)) {
  ------------------
  |  |  145|     71|#define unlikely(expr) (__builtin_expect (!!(expr), 0))
  |  |  ------------------
  |  |  |  Branch (145:24): [True: 1, False: 70]
  |  |  ------------------
  ------------------
 1516|      1|	cr = _cairo_calloc (sizeof (cairo_default_context_t));
  ------------------
  |  |   79|      1|    ((size) != 0 ? calloc(1,size) : NULL)
  |  |  ------------------
  |  |  |  Branch (79:6): [True: 1, Folded]
  |  |  ------------------
  ------------------
 1517|      1|	if (unlikely (cr == NULL))
  ------------------
  |  |  145|      1|#define unlikely(expr) (__builtin_expect (!!(expr), 0))
  |  |  ------------------
  |  |  |  Branch (145:24): [True: 0, False: 1]
  |  |  ------------------
  ------------------
 1518|      0|	    return _cairo_create_in_error (_cairo_error (CAIRO_STATUS_NO_MEMORY));
 1519|      1|    }
 1520|       |
 1521|     71|    status = _cairo_default_context_init (cr, target);
 1522|     71|    if (unlikely (status)) {
  ------------------
  |  |  145|     71|#define unlikely(expr) (__builtin_expect (!!(expr), 0))
  |  |  ------------------
  |  |  |  Branch (145:24): [True: 0, False: 71]
  |  |  ------------------
  ------------------
 1523|      0|	_freed_pool_put (&context_pool, cr);
 1524|      0|	return _cairo_create_in_error (status);
 1525|      0|    }
 1526|       |
 1527|     71|    return &cr->base;
 1528|     71|}
cairo-default-context.c:_cairo_default_context_destroy:
   90|     71|{
   91|     71|    cairo_default_context_t *cr = abstract_cr;
   92|       |
   93|     71|    _cairo_default_context_fini (cr);
   94|       |
   95|       |    /* mark the context as invalid to protect against misuse */
   96|     71|    cr->base.status = CAIRO_STATUS_NULL_POINTER;
   97|     71|    _freed_pool_put (&context_pool, cr);
   98|     71|}
cairo-default-context.c:_cairo_default_context_set_source:
  261|     71|{
  262|     71|    cairo_default_context_t *cr = abstract_cr;
  263|       |
  264|     71|    return _cairo_gstate_set_source (cr->gstate, source);
  265|     71|}
cairo-default-context.c:_cairo_default_context_paint:
  985|     71|{
  986|     71|    cairo_default_context_t *cr = abstract_cr;
  987|       |
  988|     71|    return _cairo_gstate_paint (cr->gstate);
  989|     71|}

cairo_device_reference:
  208|     71|{
  209|     71|    if (device == NULL ||
  ------------------
  |  Branch (209:9): [True: 71, False: 0]
  ------------------
  210|      0|	CAIRO_REFERENCE_COUNT_IS_INVALID (&device->ref_count))
  ------------------
  |  |   58|      0|#define CAIRO_REFERENCE_COUNT_IS_INVALID(RC) (CAIRO_REFERENCE_COUNT_GET_VALUE (RC) == CAIRO_REFERENCE_COUNT_INVALID_VALUE)
  |  |  ------------------
  |  |  |  |   53|      0|#define CAIRO_REFERENCE_COUNT_GET_VALUE(RC) _cairo_atomic_int_get (&(RC)->ref_count)
  |  |  ------------------
  |  |               #define CAIRO_REFERENCE_COUNT_IS_INVALID(RC) (CAIRO_REFERENCE_COUNT_GET_VALUE (RC) == CAIRO_REFERENCE_COUNT_INVALID_VALUE)
  |  |  ------------------
  |  |  |  |   55|      0|#define CAIRO_REFERENCE_COUNT_INVALID_VALUE ((int) -1)
  |  |  ------------------
  |  |  |  Branch (58:46): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  211|     71|    {
  212|     71|	return device;
  213|     71|    }
  214|       |
  215|     71|    assert (CAIRO_REFERENCE_COUNT_HAS_REFERENCE (&device->ref_count));
  ------------------
  |  Branch (215:5): [True: 0, False: 0]
  |  Branch (215:5): [True: 0, False: 0]
  ------------------
  216|      0|    _cairo_reference_count_inc (&device->ref_count);
  ------------------
  |  |   47|      0|#define _cairo_reference_count_inc(RC) _cairo_atomic_int_inc (&(RC)->ref_count)
  |  |  ------------------
  |  |  |  |   83|      0|# define _cairo_atomic_int_inc(x) ((void) atomic_fetch_add_explicit(x, 1, memory_order_seq_cst))
  |  |  ------------------
  ------------------
  217|       |
  218|      0|    return device;
  219|      0|}

_cairo_error:
   66|    584|{
   67|    584|    CAIRO_ENSURE_UNIQUE;
  ------------------
  |  |  183|    584|#define CAIRO_ENSURE_UNIQUE    do { } while (0)
  |  |  ------------------
  |  |  |  Branch (183:46): [Folded, False: 584]
  |  |  ------------------
  ------------------
   68|    584|    assert (_cairo_status_is_error (status));
  ------------------
  |  Branch (68:5): [True: 0, False: 584]
  |  Branch (68:5): [True: 0, False: 0]
  |  Branch (68:5): [True: 584, False: 0]
  |  Branch (68:5): [True: 584, False: 0]
  ------------------
   69|       |
   70|    584|    return status;
   71|    584|}

cairo-rectangle.c:_cairo_fixed_integer_floor:
  229|    142|{
  230|    142|    if (f >= 0)
  ------------------
  |  Branch (230:9): [True: 142, False: 0]
  ------------------
  231|    142|        return f >> CAIRO_FIXED_FRAC_BITS;
  ------------------
  |  |   62|    142|#define CAIRO_FIXED_FRAC_BITS	8
  ------------------
  232|      0|    else
  233|      0|        return -((-f - 1) >> CAIRO_FIXED_FRAC_BITS) - 1;
  ------------------
  |  |   62|      0|#define CAIRO_FIXED_FRAC_BITS	8
  ------------------
  234|    142|}
cairo-rectangle.c:_cairo_fixed_integer_ceil:
  238|    142|{
  239|    142|    if (f > 0)
  ------------------
  |  Branch (239:9): [True: 142, False: 0]
  ------------------
  240|    142|	return ((f - 1)>>CAIRO_FIXED_FRAC_BITS) + 1;
  ------------------
  |  |   62|    142|#define CAIRO_FIXED_FRAC_BITS	8
  ------------------
  241|      0|    else
  242|      0|	return - ((cairo_fixed_t)(-(cairo_fixed_unsigned_t)f) >> CAIRO_FIXED_FRAC_BITS);
  ------------------
  |  |   62|      0|#define CAIRO_FIXED_FRAC_BITS	8
  ------------------
  243|    142|}
cairo-boxes.c:_cairo_fixed_is_integer:
  175|    284|{
  176|    284|    return (f & CAIRO_FIXED_FRAC_MASK) == 0;
  ------------------
  |  |   63|    284|#define CAIRO_FIXED_FRAC_MASK  ((cairo_fixed_t)(((cairo_fixed_unsigned_t)(-1)) >> (CAIRO_FIXED_BITS - CAIRO_FIXED_FRAC_BITS)))
  |  |  ------------------
  |  |  |  |   56|    284|#define CAIRO_FIXED_BITS	32
  |  |  ------------------
  |  |               #define CAIRO_FIXED_FRAC_MASK  ((cairo_fixed_t)(((cairo_fixed_unsigned_t)(-1)) >> (CAIRO_FIXED_BITS - CAIRO_FIXED_FRAC_BITS)))
  |  |  ------------------
  |  |  |  |   62|    284|#define CAIRO_FIXED_FRAC_BITS	8
  |  |  ------------------
  ------------------
  177|    284|}
cairo-clip-boxes.c:_cairo_fixed_from_int:
   68|    568|{
   69|    568|    return (cairo_fixed_unsigned_t)i << CAIRO_FIXED_FRAC_BITS;
  ------------------
  |  |   62|    568|#define CAIRO_FIXED_FRAC_BITS	8
  ------------------
   70|    568|}
cairo-matrix.c:_cairo_fixed_from_double:
  117|    142|{
  118|    142|    union {
  119|    142|        double d;
  120|    142|        int32_t i[2];
  121|    142|    } u;
  122|       |
  123|    142|    u.d = d + CAIRO_MAGIC_NUMBER_FIXED;
  ------------------
  |  |  112|    142|#define CAIRO_MAGIC_NUMBER_FIXED ((1LL << (52 - CAIRO_FIXED_FRAC_BITS)) * 1.5)
  |  |  ------------------
  |  |  |  |   62|    142|#define CAIRO_FIXED_FRAC_BITS	8
  |  |  ------------------
  ------------------
  124|       |#ifdef FLOAT_WORDS_BIGENDIAN
  125|       |    return u.i[1];
  126|       |#else
  127|    142|    return u.i[0];
  128|    142|#endif
  129|    142|}
cairo-matrix.c:_cairo_fixed_is_integer:
  175|    142|{
  176|    142|    return (f & CAIRO_FIXED_FRAC_MASK) == 0;
  ------------------
  |  |   63|    142|#define CAIRO_FIXED_FRAC_MASK  ((cairo_fixed_t)(((cairo_fixed_unsigned_t)(-1)) >> (CAIRO_FIXED_BITS - CAIRO_FIXED_FRAC_BITS)))
  |  |  ------------------
  |  |  |  |   56|    142|#define CAIRO_FIXED_BITS	32
  |  |  ------------------
  |  |               #define CAIRO_FIXED_FRAC_MASK  ((cairo_fixed_t)(((cairo_fixed_unsigned_t)(-1)) >> (CAIRO_FIXED_BITS - CAIRO_FIXED_FRAC_BITS)))
  |  |  ------------------
  |  |  |  |   62|    142|#define CAIRO_FIXED_FRAC_BITS	8
  |  |  ------------------
  ------------------
  177|    142|}
cairo-matrix.c:_cairo_fixed_to_double:
  169|    284|{
  170|    284|    return ((double) f) / CAIRO_FIXED_ONE_DOUBLE;
  ------------------
  |  |   53|    284|#define CAIRO_FIXED_ONE_DOUBLE ((double)(1 << CAIRO_FIXED_FRAC_BITS))
  |  |  ------------------
  |  |  |  |   62|    284|#define CAIRO_FIXED_FRAC_BITS	8
  |  |  ------------------
  ------------------
  171|    284|}

cairo_font_face_destroy:
  171|     71|{
  172|     71|    if (font_face == NULL ||
  ------------------
  |  Branch (172:9): [True: 71, False: 0]
  ------------------
  173|      0|	CAIRO_REFERENCE_COUNT_IS_INVALID (&font_face->ref_count))
  ------------------
  |  |   58|      0|#define CAIRO_REFERENCE_COUNT_IS_INVALID(RC) (CAIRO_REFERENCE_COUNT_GET_VALUE (RC) == CAIRO_REFERENCE_COUNT_INVALID_VALUE)
  |  |  ------------------
  |  |  |  |   53|      0|#define CAIRO_REFERENCE_COUNT_GET_VALUE(RC) _cairo_atomic_int_get (&(RC)->ref_count)
  |  |  ------------------
  |  |               #define CAIRO_REFERENCE_COUNT_IS_INVALID(RC) (CAIRO_REFERENCE_COUNT_GET_VALUE (RC) == CAIRO_REFERENCE_COUNT_INVALID_VALUE)
  |  |  ------------------
  |  |  |  |   55|      0|#define CAIRO_REFERENCE_COUNT_INVALID_VALUE ((int) -1)
  |  |  ------------------
  |  |  |  Branch (58:46): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  174|     71|	return;
  175|       |
  176|     71|    assert (CAIRO_REFERENCE_COUNT_HAS_REFERENCE (&font_face->ref_count));
  ------------------
  |  Branch (176:5): [True: 0, False: 0]
  |  Branch (176:5): [True: 0, False: 0]
  ------------------
  177|       |
  178|       |    /* We allow resurrection to deal with some memory management for the
  179|       |     * FreeType backend where cairo_ft_font_face_t and cairo_ft_unscaled_font_t
  180|       |     * need to effectively mutually reference each other
  181|       |     */
  182|      0|    if (__put (&font_face->ref_count))
  ------------------
  |  Branch (182:9): [True: 0, False: 0]
  ------------------
  183|      0|	return;
  184|       |
  185|      0|    if (! font_face->backend->destroy (font_face))
  ------------------
  |  Branch (185:9): [True: 0, False: 0]
  ------------------
  186|      0|	return;
  187|       |
  188|      0|    _cairo_user_data_array_fini (&font_face->user_data);
  189|       |
  190|      0|    free (font_face);
  191|      0|}

_cairo_font_options_init_default:
   73|     71|{
   74|     71|    options->antialias = CAIRO_ANTIALIAS_DEFAULT;
   75|     71|    options->subpixel_order = CAIRO_SUBPIXEL_ORDER_DEFAULT;
   76|     71|    options->lcd_filter = CAIRO_LCD_FILTER_DEFAULT;
   77|     71|    options->hint_style = CAIRO_HINT_STYLE_DEFAULT;
   78|     71|    options->hint_metrics = CAIRO_HINT_METRICS_DEFAULT;
   79|     71|    options->round_glyph_positions = CAIRO_ROUND_GLYPH_POS_DEFAULT;
   80|     71|    options->variations = NULL;
   81|     71|    options->color_mode = CAIRO_COLOR_MODE_DEFAULT;
   82|     71|    options->palette_index = CAIRO_COLOR_PALETTE_DEFAULT;
  ------------------
  |  | 1517|     71|#define CAIRO_COLOR_PALETTE_DEFAULT 0
  ------------------
   83|       |    options->custom_palette = NULL;
   84|     71|    options->custom_palette_size = 0;
   85|     71|}
_cairo_font_options_fini:
  209|     71|{
  210|     71|    free (options->variations);
  211|     71|    free (options->custom_palette);
  212|     71|}

cairo-clip.c:_freed_pool_put:
  103|     71|{
  104|     71|    int i;
  105|       |
  106|     71|    i = _cairo_atomic_int_get_relaxed (&pool->top);
  107|     71|    if (likely (i < ARRAY_LENGTH (pool->pool) &&
  ------------------
  |  |  144|    142|#define likely(expr) (__builtin_expect (!!(expr), 1))
  |  |  ------------------
  |  |  |  Branch (144:22): [True: 71, False: 0]
  |  |  |  Branch (144:44): [True: 71, False: 0]
  |  |  |  Branch (144:44): [True: 71, False: 0]
  |  |  ------------------
  ------------------
  108|     71|		_atomic_store (&pool->pool[i], ptr)))
  109|     71|    {
  110|     71|	_cairo_atomic_int_set_relaxed (&pool->top, i + 1);
  111|     71|	return;
  112|     71|    }
  113|       |
  114|       |    /* either full or contended */
  115|      0|    _freed_pool_put_search (pool, ptr);
  116|      0|}
cairo-clip.c:_atomic_store:
   71|     71|{
   72|     71|    return _cairo_atomic_ptr_cmpxchg (slot, NULL, ptr);
  ------------------
  |  |  121|     71|  _cairo_atomic_ptr_cmpxchg_impl(x, oldv, newv)
  ------------------
   73|     71|}
cairo-clip.c:_freed_pool_get:
   80|     71|{
   81|     71|    void *ptr;
   82|     71|    int i;
   83|       |
   84|     71|    i = _cairo_atomic_int_get_relaxed (&pool->top) - 1;
   85|     71|    if (i < 0)
  ------------------
  |  Branch (85:9): [True: 1, False: 70]
  ------------------
   86|      1|	i = 0;
   87|       |
   88|     71|    ptr = _atomic_fetch (&pool->pool[i]);
   89|     71|    if (likely (ptr != NULL)) {
  ------------------
  |  |  144|     71|#define likely(expr) (__builtin_expect (!!(expr), 1))
  |  |  ------------------
  |  |  |  Branch (144:22): [True: 70, False: 1]
  |  |  ------------------
  ------------------
   90|     70|	_cairo_atomic_int_set_relaxed (&pool->top, i);
   91|     70|	return ptr;
   92|     70|    }
   93|       |
   94|       |    /* either empty or contended */
   95|      1|    return _freed_pool_get_search (pool);
   96|     71|}
cairo-clip.c:_atomic_fetch:
   59|     71|{
   60|     71|    void *ptr;
   61|       |
   62|     71|    do {
   63|     71|        ptr = _cairo_atomic_ptr_get (slot);
   64|     71|    } while (! _cairo_atomic_ptr_cmpxchg (slot, ptr, NULL));
  ------------------
  |  |  121|     71|  _cairo_atomic_ptr_cmpxchg_impl(x, oldv, newv)
  ------------------
  |  Branch (64:14): [True: 0, False: 71]
  ------------------
   65|       |
   66|     71|    return ptr;
   67|     71|}
cairo-default-context.c:_freed_pool_get:
   80|     71|{
   81|     71|    void *ptr;
   82|     71|    int i;
   83|       |
   84|     71|    i = _cairo_atomic_int_get_relaxed (&pool->top) - 1;
   85|     71|    if (i < 0)
  ------------------
  |  Branch (85:9): [True: 1, False: 70]
  ------------------
   86|      1|	i = 0;
   87|       |
   88|     71|    ptr = _atomic_fetch (&pool->pool[i]);
   89|     71|    if (likely (ptr != NULL)) {
  ------------------
  |  |  144|     71|#define likely(expr) (__builtin_expect (!!(expr), 1))
  |  |  ------------------
  |  |  |  Branch (144:22): [True: 70, False: 1]
  |  |  ------------------
  ------------------
   90|     70|	_cairo_atomic_int_set_relaxed (&pool->top, i);
   91|     70|	return ptr;
   92|     70|    }
   93|       |
   94|       |    /* either empty or contended */
   95|      1|    return _freed_pool_get_search (pool);
   96|     71|}
cairo-default-context.c:_atomic_fetch:
   59|     71|{
   60|     71|    void *ptr;
   61|       |
   62|     71|    do {
   63|     71|        ptr = _cairo_atomic_ptr_get (slot);
   64|     71|    } while (! _cairo_atomic_ptr_cmpxchg (slot, ptr, NULL));
  ------------------
  |  |  121|     71|  _cairo_atomic_ptr_cmpxchg_impl(x, oldv, newv)
  ------------------
  |  Branch (64:14): [True: 0, False: 71]
  ------------------
   65|       |
   66|     71|    return ptr;
   67|     71|}
cairo-default-context.c:_freed_pool_put:
  103|     71|{
  104|     71|    int i;
  105|       |
  106|     71|    i = _cairo_atomic_int_get_relaxed (&pool->top);
  107|     71|    if (likely (i < ARRAY_LENGTH (pool->pool) &&
  ------------------
  |  |  144|    142|#define likely(expr) (__builtin_expect (!!(expr), 1))
  |  |  ------------------
  |  |  |  Branch (144:22): [True: 71, False: 0]
  |  |  |  Branch (144:44): [True: 71, False: 0]
  |  |  |  Branch (144:44): [True: 71, False: 0]
  |  |  ------------------
  ------------------
  108|     71|		_atomic_store (&pool->pool[i], ptr)))
  109|     71|    {
  110|     71|	_cairo_atomic_int_set_relaxed (&pool->top, i + 1);
  111|     71|	return;
  112|     71|    }
  113|       |
  114|       |    /* either full or contended */
  115|      0|    _freed_pool_put_search (pool, ptr);
  116|      0|}
cairo-default-context.c:_atomic_store:
   71|     71|{
   72|     71|    return _cairo_atomic_ptr_cmpxchg (slot, NULL, ptr);
  ------------------
  |  |  121|     71|  _cairo_atomic_ptr_cmpxchg_impl(x, oldv, newv)
  ------------------
   73|     71|}
cairo-freed-pool.c:_atomic_fetch:
   59|     32|{
   60|     32|    void *ptr;
   61|       |
   62|     32|    do {
   63|     32|        ptr = _cairo_atomic_ptr_get (slot);
   64|     32|    } while (! _cairo_atomic_ptr_cmpxchg (slot, ptr, NULL));
  ------------------
  |  |  121|     32|  _cairo_atomic_ptr_cmpxchg_impl(x, oldv, newv)
  ------------------
  |  Branch (64:14): [True: 0, False: 32]
  ------------------
   65|       |
   66|     32|    return ptr;
   67|     32|}

_freed_pool_get_search:
   46|      2|{
   47|      2|    void *ptr;
   48|      2|    int i;
   49|       |
   50|     34|    for (i = ARRAY_LENGTH (pool->pool); i--;) {
  ------------------
  |  |  122|      2|#define ARRAY_LENGTH(__array) ((int) (sizeof (__array) / sizeof (__array[0])))
  ------------------
  |  Branch (50:41): [True: 32, False: 2]
  ------------------
   51|     32|	ptr = _atomic_fetch (&pool->pool[i]);
   52|     32|	if (ptr != NULL) {
  ------------------
  |  Branch (52:6): [True: 0, False: 32]
  ------------------
   53|      0|	    _cairo_atomic_int_set_relaxed (&pool->top, i);
   54|      0|	    return ptr;
   55|      0|	}
   56|     32|    }
   57|       |
   58|       |    /* empty */
   59|      2|    _cairo_atomic_int_set_relaxed (&pool->top, 0);
   60|       |    return NULL;
   61|      2|}

_cairo_gstate_init:
   87|     71|{
   88|     71|    VG (VALGRIND_MAKE_MEM_UNDEFINED (gstate, sizeof (cairo_gstate_t)));
   89|       |
   90|     71|    gstate->next = NULL;
   91|       |
   92|     71|    gstate->op = CAIRO_GSTATE_OPERATOR_DEFAULT;
  ------------------
  |  |  722|     71|#define CAIRO_GSTATE_OPERATOR_DEFAULT	CAIRO_OPERATOR_OVER
  ------------------
   93|     71|    gstate->opacity = 1.;
   94|       |
   95|     71|    gstate->tolerance = CAIRO_GSTATE_TOLERANCE_DEFAULT;
  ------------------
  |  |  723|     71|#define CAIRO_GSTATE_TOLERANCE_DEFAULT	0.1
  ------------------
   96|     71|    gstate->antialias = CAIRO_ANTIALIAS_DEFAULT;
   97|       |
   98|     71|    _cairo_stroke_style_init (&gstate->stroke_style);
   99|       |
  100|     71|    gstate->fill_rule = CAIRO_GSTATE_FILL_RULE_DEFAULT;
  ------------------
  |  |  724|     71|#define CAIRO_GSTATE_FILL_RULE_DEFAULT	CAIRO_FILL_RULE_WINDING
  ------------------
  101|       |
  102|     71|    gstate->font_face = NULL;
  103|     71|    gstate->scaled_font = NULL;
  104|     71|    gstate->previous_scaled_font = NULL;
  105|       |
  106|     71|    cairo_matrix_init_scale (&gstate->font_matrix,
  107|     71|			     CAIRO_GSTATE_DEFAULT_FONT_SIZE,
  ------------------
  |  |  729|     71|#define CAIRO_GSTATE_DEFAULT_FONT_SIZE  10.0
  ------------------
  108|     71|			     CAIRO_GSTATE_DEFAULT_FONT_SIZE);
  ------------------
  |  |  729|     71|#define CAIRO_GSTATE_DEFAULT_FONT_SIZE  10.0
  ------------------
  109|       |
  110|     71|    _cairo_font_options_init_default (&gstate->font_options);
  111|       |
  112|     71|    gstate->clip = NULL;
  113|       |
  114|     71|    gstate->target = cairo_surface_reference (target);
  115|     71|    gstate->parent_target = NULL;
  116|     71|    gstate->original_target = cairo_surface_reference (target);
  117|       |
  118|     71|    gstate->device_transform_observer.callback = _cairo_gstate_update_device_transform;
  119|     71|    cairo_list_add (&gstate->device_transform_observer.link,
  120|     71|		    &gstate->target->device_transform_observers);
  121|       |
  122|     71|    gstate->is_identity = _cairo_matrix_is_identity (&gstate->target->device_transform);
  123|     71|    cairo_matrix_init_identity (&gstate->ctm);
  124|     71|    gstate->ctm_inverse = gstate->ctm;
  125|     71|    gstate->source_ctm_inverse = gstate->ctm;
  126|       |
  127|     71|    gstate->source = (cairo_pattern_t *) &_cairo_pattern_black.base;
  128|       |
  129|       |    /* Now that the gstate is fully initialized and ready for the eventual
  130|       |     * _cairo_gstate_fini(), we can check for errors (and not worry about
  131|       |     * the resource deallocation). */
  132|     71|    return target->status;
  133|     71|}
_cairo_gstate_fini:
  195|     71|{
  196|     71|    _cairo_stroke_style_fini (&gstate->stroke_style);
  197|     71|    _cairo_font_options_fini (&gstate->font_options);
  198|       |
  199|     71|    cairo_font_face_destroy (gstate->font_face);
  200|     71|    gstate->font_face = NULL;
  201|       |
  202|     71|    cairo_scaled_font_destroy (gstate->previous_scaled_font);
  203|     71|    gstate->previous_scaled_font = NULL;
  204|       |
  205|     71|    cairo_scaled_font_destroy (gstate->scaled_font);
  206|     71|    gstate->scaled_font = NULL;
  207|       |
  208|     71|    _cairo_clip_destroy (gstate->clip);
  209|       |
  210|     71|    cairo_list_del (&gstate->device_transform_observer.link);
  211|       |
  212|     71|    cairo_surface_destroy (gstate->target);
  213|     71|    gstate->target = NULL;
  214|       |
  215|     71|    cairo_surface_destroy (gstate->parent_target);
  216|     71|    gstate->parent_target = NULL;
  217|       |
  218|     71|    cairo_surface_destroy (gstate->original_target);
  219|     71|    gstate->original_target = NULL;
  220|       |
  221|     71|    cairo_pattern_destroy (gstate->source);
  222|     71|    gstate->source = NULL;
  223|       |
  224|     71|    VG (VALGRIND_MAKE_MEM_UNDEFINED (gstate, sizeof (cairo_gstate_t)));
  225|     71|}
_cairo_gstate_set_source:
  393|     71|{
  394|     71|    if (source->status)
  ------------------
  |  Branch (394:9): [True: 0, False: 71]
  ------------------
  395|      0|	return source->status;
  396|       |
  397|     71|    source = cairo_pattern_reference (source);
  398|     71|    cairo_pattern_destroy (gstate->source);
  399|     71|    gstate->source = source;
  400|     71|    gstate->source_ctm_inverse = gstate->ctm_inverse;
  401|       |
  402|     71|    return CAIRO_STATUS_SUCCESS;
  403|     71|}
_cairo_gstate_paint:
 1078|     71|{
 1079|     71|    cairo_pattern_union_t source_pattern;
 1080|     71|    const cairo_pattern_t *pattern;
 1081|     71|    cairo_status_t status;
 1082|     71|    cairo_operator_t op;
 1083|       |
 1084|     71|    status = _cairo_gstate_get_pattern_status (gstate->source);
 1085|     71|    if (unlikely (status))
  ------------------
  |  |  145|     71|#define unlikely(expr) (__builtin_expect (!!(expr), 0))
  |  |  ------------------
  |  |  |  Branch (145:24): [True: 0, False: 71]
  |  |  ------------------
  ------------------
 1086|      0|	return status;
 1087|       |
 1088|     71|    if (gstate->op == CAIRO_OPERATOR_DEST)
  ------------------
  |  Branch (1088:9): [True: 0, False: 71]
  ------------------
 1089|      0|	return CAIRO_STATUS_SUCCESS;
 1090|       |
 1091|     71|    if (_cairo_clip_is_all_clipped (gstate->clip))
  ------------------
  |  Branch (1091:9): [True: 0, False: 71]
  ------------------
 1092|      0|	return CAIRO_STATUS_SUCCESS;
 1093|       |
 1094|     71|    op = _reduce_op (gstate);
 1095|     71|    if (op == CAIRO_OPERATOR_CLEAR) {
  ------------------
  |  Branch (1095:9): [True: 0, False: 71]
  ------------------
 1096|      0|	pattern = &_cairo_pattern_clear.base;
 1097|     71|    } else {
 1098|     71|	_cairo_gstate_copy_transformed_source (gstate, &source_pattern.base);
 1099|     71|	pattern = &source_pattern.base;
 1100|     71|    }
 1101|       |
 1102|     71|    return _cairo_surface_paint (gstate->target,
 1103|     71|				 op, pattern,
 1104|     71|				 gstate->clip);
 1105|     71|}
cairo-gstate.c:_cairo_gstate_get_pattern_status:
 1064|     71|{
 1065|     71|    if (unlikely (pattern->type == CAIRO_PATTERN_TYPE_MESH &&
  ------------------
  |  |  145|     71|#define unlikely(expr) (__builtin_expect (!!(expr), 0))
  |  |  ------------------
  |  |  |  Branch (145:24): [True: 0, False: 71]
  |  |  |  Branch (145:46): [True: 0, False: 71]
  |  |  |  Branch (145:46): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1066|     71|		  ((const cairo_mesh_pattern_t *) pattern)->current_patch))
 1067|      0|    {
 1068|       |	/* If current patch != NULL, the pattern is under construction
 1069|       |	 * and cannot be used as a source */
 1070|      0|	return CAIRO_STATUS_INVALID_MESH_CONSTRUCTION;
 1071|      0|    }
 1072|       |
 1073|     71|    return pattern->status;
 1074|     71|}
cairo-gstate.c:_reduce_op:
 1025|     71|{
 1026|     71|    cairo_operator_t op;
 1027|     71|    const cairo_pattern_t *pattern;
 1028|       |
 1029|     71|    op = gstate->op;
 1030|     71|    if (op != CAIRO_OPERATOR_SOURCE)
  ------------------
  |  Branch (1030:9): [True: 71, False: 0]
  ------------------
 1031|     71|	return op;
 1032|       |
 1033|      0|    pattern = gstate->source;
 1034|      0|    if (pattern->type == CAIRO_PATTERN_TYPE_SOLID) {
  ------------------
  |  Branch (1034:9): [True: 0, False: 0]
  ------------------
 1035|      0|	const cairo_solid_pattern_t *solid = (cairo_solid_pattern_t *) pattern;
 1036|      0|	if (solid->color.alpha_short <= 0x00ff) {
  ------------------
  |  Branch (1036:6): [True: 0, False: 0]
  ------------------
 1037|      0|	    op = CAIRO_OPERATOR_CLEAR;
 1038|      0|	} else if ((gstate->target->content & CAIRO_CONTENT_ALPHA) == 0) {
  ------------------
  |  Branch (1038:13): [True: 0, False: 0]
  ------------------
 1039|      0|	    if ((solid->color.red_short |
  ------------------
  |  Branch (1039:10): [True: 0, False: 0]
  ------------------
 1040|      0|		 solid->color.green_short |
 1041|      0|		 solid->color.blue_short) <= 0x00ff)
 1042|      0|	    {
 1043|      0|		op = CAIRO_OPERATOR_CLEAR;
 1044|      0|	    }
 1045|      0|	}
 1046|      0|    } else if (pattern->type == CAIRO_PATTERN_TYPE_SURFACE) {
  ------------------
  |  Branch (1046:16): [True: 0, False: 0]
  ------------------
 1047|      0|	const cairo_surface_pattern_t *surface = (cairo_surface_pattern_t *) pattern;
 1048|      0|	if (surface->surface->is_clear &&
  ------------------
  |  Branch (1048:6): [True: 0, False: 0]
  ------------------
 1049|      0|	    surface->surface->content & CAIRO_CONTENT_ALPHA)
  ------------------
  |  Branch (1049:6): [True: 0, False: 0]
  ------------------
 1050|      0|	{
 1051|      0|	    op = CAIRO_OPERATOR_CLEAR;
 1052|      0|	}
 1053|      0|    } else {
 1054|      0|	const cairo_gradient_pattern_t *gradient = (cairo_gradient_pattern_t *) pattern;
 1055|      0|	if (gradient->n_stops == 0)
  ------------------
  |  Branch (1055:6): [True: 0, False: 0]
  ------------------
 1056|      0|	    op = CAIRO_OPERATOR_CLEAR;
 1057|      0|    }
 1058|       |
 1059|      0|    return op;
 1060|     71|}
cairo-gstate.c:_cairo_gstate_copy_transformed_source:
 1007|     71|{
 1008|     71|    _cairo_gstate_copy_transformed_pattern (gstate, pattern,
 1009|     71|					    gstate->source,
 1010|     71|					    &gstate->source_ctm_inverse);
 1011|     71|}
cairo-gstate.c:_cairo_gstate_copy_transformed_pattern:
  967|     71|{
  968|       |    /*
  969|       |     * What calculations below do can be described in pseudo-code (so using nonexistent fields) as (using column vectors):
  970|       |     * pattern->matrix = surface->device_transform *
  971|       |     * 			 pattern->matrix *
  972|       |     * 			 ctm_inverse *
  973|       |     * 			 gstate->target->device_transform_inverse
  974|       |     *
  975|       |     * The inverse of which is:
  976|       |     * pattern->matrix_inverse = gstate->target->device_transform *
  977|       |     * 				 ctm *
  978|       |     * 				 pattern->matrix_inverse *
  979|       |     * 				 surface->device_transform_inverse
  980|       |     */
  981|       |
  982|     71|    _cairo_gstate_copy_pattern (pattern, original);
  983|       |
  984|     71|    if (original->type == CAIRO_PATTERN_TYPE_SURFACE) {
  ------------------
  |  Branch (984:9): [True: 0, False: 71]
  ------------------
  985|      0|	cairo_surface_pattern_t *surface_pattern;
  986|      0|	cairo_surface_t *surface;
  987|       |
  988|      0|        surface_pattern = (cairo_surface_pattern_t *) original;
  989|      0|        surface = surface_pattern->surface;
  990|       |
  991|      0|	if (_cairo_surface_has_device_transform (surface))
  ------------------
  |  Branch (991:6): [True: 0, False: 0]
  ------------------
  992|      0|	    _cairo_pattern_pretransform (pattern, &surface->device_transform);
  993|      0|    }
  994|       |
  995|     71|    if (! _cairo_matrix_is_identity (ctm_inverse))
  ------------------
  |  Branch (995:9): [True: 0, False: 71]
  ------------------
  996|      0|	_cairo_pattern_transform (pattern, ctm_inverse);
  997|       |
  998|     71|    if (_cairo_surface_has_device_transform (gstate->target)) {
  ------------------
  |  Branch (998:9): [True: 0, False: 71]
  ------------------
  999|      0|        _cairo_pattern_transform (pattern,
 1000|      0|                                  &gstate->target->device_transform_inverse);
 1001|      0|    }
 1002|     71|}
cairo-gstate.c:_cairo_gstate_copy_pattern:
  933|     71|{
  934|       |    /* First check if the we can replace the original with a much simpler
  935|       |     * pattern. For example, gradients that are uniform or just have a single
  936|       |     * stop can sometimes be replaced with a solid.
  937|       |     */
  938|       |
  939|     71|    if (_cairo_pattern_is_clear (original)) {
  ------------------
  |  Branch (939:9): [True: 0, False: 71]
  ------------------
  940|      0|        _cairo_pattern_init_solid ((cairo_solid_pattern_t *) pattern,
  941|      0|				   CAIRO_COLOR_TRANSPARENT);
  ------------------
  |  |  799|      0|#define CAIRO_COLOR_TRANSPARENT _cairo_stock_color (CAIRO_STOCK_TRANSPARENT)
  ------------------
  942|      0|	return;
  943|      0|    }
  944|       |
  945|     71|    if (original->type == CAIRO_PATTERN_TYPE_LINEAR ||
  ------------------
  |  Branch (945:9): [True: 0, False: 71]
  ------------------
  946|     71|	original->type == CAIRO_PATTERN_TYPE_RADIAL)
  ------------------
  |  Branch (946:2): [True: 0, False: 71]
  ------------------
  947|      0|    {
  948|      0|        cairo_color_t color;
  949|      0|	if (_cairo_gradient_pattern_is_solid ((cairo_gradient_pattern_t *) original,
  ------------------
  |  Branch (949:6): [True: 0, False: 0]
  ------------------
  950|      0|					      NULL,
  951|      0|					      &color))
  952|      0|	{
  953|      0|	    _cairo_pattern_init_solid ((cairo_solid_pattern_t *) pattern,
  954|      0|				       &color);
  955|      0|	    return;
  956|      0|	}
  957|      0|    }
  958|       |
  959|     71|    _cairo_pattern_init_static_copy (pattern, original);
  960|     71|}

_cairo_hash_table_create:
  164|      1|{
  165|      1|    cairo_hash_table_t *hash_table;
  166|       |
  167|      1|    hash_table = _cairo_calloc (sizeof (cairo_hash_table_t));
  ------------------
  |  |   79|      1|    ((size) != 0 ? calloc(1,size) : NULL)
  |  |  ------------------
  |  |  |  Branch (79:6): [True: 1, Folded]
  |  |  ------------------
  ------------------
  168|      1|    if (unlikely (hash_table == NULL)) {
  ------------------
  |  |  145|      1|#define unlikely(expr) (__builtin_expect (!!(expr), 0))
  |  |  ------------------
  |  |  |  Branch (145:24): [True: 0, False: 1]
  |  |  ------------------
  ------------------
  169|      0|	_cairo_error_throw (CAIRO_STATUS_NO_MEMORY);
  ------------------
  |  |  126|      0|#define _cairo_error_throw(status) do { \
  |  |  127|      0|    cairo_status_t status__ = _cairo_error (status); \
  |  |  128|      0|    (void) status__; \
  |  |  129|      0|} while (0)
  |  |  ------------------
  |  |  |  Branch (129:10): [Folded, False: 0]
  |  |  ------------------
  ------------------
  170|      0|	return NULL;
  171|      0|    }
  172|       |
  173|      1|    if (keys_equal == NULL)
  ------------------
  |  Branch (173:9): [True: 0, False: 1]
  ------------------
  174|      0|	hash_table->keys_equal = _cairo_hash_table_uid_keys_equal;
  175|      1|    else
  176|      1|	hash_table->keys_equal = keys_equal;
  177|       |
  178|      1|    memset (&hash_table->cache, 0, sizeof (hash_table->cache));
  179|      1|    hash_table->table_size = &hash_table_sizes[0];
  180|       |
  181|      1|    hash_table->entries = _cairo_calloc_ab (*hash_table->table_size,
  182|      1|				  sizeof (cairo_hash_entry_t *));
  183|      1|    if (unlikely (hash_table->entries == NULL)) {
  ------------------
  |  |  145|      1|#define unlikely(expr) (__builtin_expect (!!(expr), 0))
  |  |  ------------------
  |  |  |  Branch (145:24): [True: 0, False: 1]
  |  |  ------------------
  ------------------
  184|      0|	_cairo_error_throw (CAIRO_STATUS_NO_MEMORY);
  ------------------
  |  |  126|      0|#define _cairo_error_throw(status) do { \
  |  |  127|      0|    cairo_status_t status__ = _cairo_error (status); \
  |  |  128|      0|    (void) status__; \
  |  |  129|      0|} while (0)
  |  |  ------------------
  |  |  |  Branch (129:10): [Folded, False: 0]
  |  |  ------------------
  ------------------
  185|      0|	free (hash_table);
  186|      0|	return NULL;
  187|      0|    }
  188|       |
  189|      1|    hash_table->live_entries = 0;
  190|      1|    hash_table->free_entries = *hash_table->table_size;
  191|      1|    hash_table->iterating = 0;
  192|       |
  193|      1|    return hash_table;
  194|      1|}
_cairo_hash_table_lookup:
  340|     71|{
  341|     71|    cairo_hash_entry_t *entry;
  342|     71|    unsigned long table_size, i, idx, step;
  343|     71|    uintptr_t hash = key->hash;
  344|       |
  345|     71|    entry = hash_table->cache[hash & 31];
  346|     71|    if (entry && entry->hash == hash && hash_table->keys_equal (key, entry))
  ------------------
  |  Branch (346:9): [True: 70, False: 1]
  |  Branch (346:18): [True: 70, False: 0]
  |  Branch (346:41): [True: 70, False: 0]
  ------------------
  347|     70|	return entry;
  348|       |
  349|      1|    table_size = *hash_table->table_size;
  350|      1|    idx = hash % table_size;
  351|       |
  352|      1|    entry = hash_table->entries[idx];
  353|      1|    if (ENTRY_IS_LIVE (entry)) {
  ------------------
  |  |   60|      1|#define ENTRY_IS_LIVE(entry) ((entry) >  DEAD_ENTRY)
  |  |  ------------------
  |  |  |  |   56|      1|#define DEAD_ENTRY ((cairo_hash_entry_t *) 0x1)
  |  |  ------------------
  |  |  |  Branch (60:30): [True: 0, False: 1]
  |  |  ------------------
  ------------------
  354|      0|	if (entry->hash == hash && hash_table->keys_equal (key, entry))
  ------------------
  |  Branch (354:6): [True: 0, False: 0]
  |  Branch (354:29): [True: 0, False: 0]
  ------------------
  355|      0|		goto insert_cache;
  356|      1|    } else if (ENTRY_IS_FREE (entry))
  ------------------
  |  |   58|      1|#define ENTRY_IS_FREE(entry) ((entry) == NULL)
  |  |  ------------------
  |  |  |  Branch (58:30): [True: 1, False: 0]
  |  |  ------------------
  ------------------
  357|      1|	return NULL;
  358|       |
  359|      0|    i = 1;
  360|      0|    step = 1 + hash % (table_size - 2);
  361|      0|    do {
  362|      0|	idx += step;
  363|      0|	if (idx >= table_size)
  ------------------
  |  Branch (363:6): [True: 0, False: 0]
  ------------------
  364|      0|	    idx -= table_size;
  365|       |
  366|      0|	entry = hash_table->entries[idx];
  367|      0|	if (ENTRY_IS_LIVE (entry)) {
  ------------------
  |  |   60|      0|#define ENTRY_IS_LIVE(entry) ((entry) >  DEAD_ENTRY)
  |  |  ------------------
  |  |  |  |   56|      0|#define DEAD_ENTRY ((cairo_hash_entry_t *) 0x1)
  |  |  ------------------
  |  |  |  Branch (60:30): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  368|      0|	    if (entry->hash == hash && hash_table->keys_equal (key, entry))
  ------------------
  |  Branch (368:10): [True: 0, False: 0]
  |  Branch (368:33): [True: 0, False: 0]
  ------------------
  369|      0|		    goto insert_cache;
  370|      0|	} else if (ENTRY_IS_FREE (entry))
  ------------------
  |  |   58|      0|#define ENTRY_IS_FREE(entry) ((entry) == NULL)
  |  |  ------------------
  |  |  |  Branch (58:30): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  371|      0|	    return NULL;
  372|      0|    } while (++i < table_size);
  ------------------
  |  Branch (372:14): [True: 0, False: 0]
  ------------------
  373|       |
  374|      0|    ASSERT_NOT_REACHED;
  ------------------
  |  |  140|      0|#define ASSERT_NOT_REACHED		\
  |  |  141|      0|do {					\
  |  |  142|      0|    assert (!"reached");		\
  |  |  143|      0|} while (0)
  |  |  ------------------
  |  |  |  Branch (143:10): [Folded, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (374:5): [Folded, False: 0]
  |  Branch (374:5): [Folded, False: 0]
  ------------------
  375|      0|    return NULL;
  376|       |
  377|      0|insert_cache:
  378|      0|    hash_table->cache[hash & 31] = entry;
  379|      0|    return entry;
  380|      0|}
_cairo_hash_table_insert:
  457|      1|{
  458|      1|    cairo_hash_entry_t **entry;
  459|      1|    cairo_status_t status;
  460|       |
  461|       |    /* Insert is illegal while an iterator is running. */
  462|      1|    assert (hash_table->iterating == 0);
  ------------------
  |  Branch (462:5): [True: 0, False: 1]
  |  Branch (462:5): [True: 1, False: 0]
  ------------------
  463|       |
  464|      1|    status = _cairo_hash_table_manage (hash_table);
  465|      1|    if (unlikely (status))
  ------------------
  |  |  145|      1|#define unlikely(expr) (__builtin_expect (!!(expr), 0))
  |  |  ------------------
  |  |  |  Branch (145:24): [True: 0, False: 1]
  |  |  ------------------
  ------------------
  466|      0|	return status;
  467|       |
  468|      1|    entry = _cairo_hash_table_lookup_unique_key (hash_table, key_and_value);
  469|       |
  470|      1|    if (ENTRY_IS_FREE (*entry))
  ------------------
  |  |   58|      1|#define ENTRY_IS_FREE(entry) ((entry) == NULL)
  |  |  ------------------
  |  |  |  Branch (58:30): [True: 1, False: 0]
  |  |  ------------------
  ------------------
  471|      1|	hash_table->free_entries--;
  472|       |
  473|      1|    *entry = key_and_value;
  474|      1|    hash_table->cache[key_and_value->hash & 31] = key_and_value;
  475|      1|    hash_table->live_entries++;
  476|       |
  477|      1|    return CAIRO_STATUS_SUCCESS;
  478|      1|}
cairo-hash.c:_cairo_hash_table_manage:
  269|      1|{
  270|      1|    cairo_hash_table_t tmp;
  271|      1|    unsigned long new_size, i;
  272|       |
  273|       |    /* Keep between 12.5% and 50% entries in the hash table alive and
  274|       |     * at least 25% free. */
  275|      1|    unsigned long live_high = *hash_table->table_size >> 1;
  276|      1|    unsigned long live_low = live_high >> 2;
  277|      1|    unsigned long free_low = live_high >> 1;
  278|       |
  279|      1|    tmp = *hash_table;
  280|       |
  281|      1|    if (hash_table->live_entries > live_high)
  ------------------
  |  Branch (281:9): [True: 0, False: 1]
  ------------------
  282|      0|    {
  283|      0|	tmp.table_size = hash_table->table_size + 1;
  284|       |	/* This code is being abused if we can't make a table big enough. */
  285|      0|	assert (tmp.table_size - hash_table_sizes <
  ------------------
  |  Branch (285:2): [True: 0, False: 0]
  |  Branch (285:2): [True: 0, False: 0]
  ------------------
  286|      0|		ARRAY_LENGTH (hash_table_sizes));
  287|      0|    }
  288|      1|    else if (hash_table->live_entries < live_low)
  ------------------
  |  Branch (288:14): [True: 1, False: 0]
  ------------------
  289|      1|    {
  290|       |	/* Can't shrink if we're at the smallest size */
  291|      1|	if (hash_table->table_size == &hash_table_sizes[0])
  ------------------
  |  Branch (291:6): [True: 1, False: 0]
  ------------------
  292|      1|	    tmp.table_size = hash_table->table_size;
  293|      0|	else
  294|      0|	    tmp.table_size = hash_table->table_size - 1;
  295|      1|    }
  296|       |
  297|      1|    if (tmp.table_size == hash_table->table_size &&
  ------------------
  |  Branch (297:9): [True: 1, False: 0]
  ------------------
  298|      1|	hash_table->free_entries > free_low)
  ------------------
  |  Branch (298:2): [True: 1, False: 0]
  ------------------
  299|      1|    {
  300|       |	/* The number of live entries is within the desired bounds
  301|       |	 * (we're not going to resize the table) and we have enough
  302|       |	 * free entries. Do nothing. */
  303|      1|	return CAIRO_STATUS_SUCCESS;
  304|      1|    }
  305|       |
  306|      0|    new_size = *tmp.table_size;
  307|      0|    tmp.entries = _cairo_calloc_ab (new_size, sizeof (cairo_hash_entry_t*));
  308|      0|    if (unlikely (tmp.entries == NULL))
  ------------------
  |  |  145|      0|#define unlikely(expr) (__builtin_expect (!!(expr), 0))
  |  |  ------------------
  |  |  |  Branch (145:24): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  309|      0|	return _cairo_error (CAIRO_STATUS_NO_MEMORY);
  310|       |
  311|      0|    for (i = 0; i < *hash_table->table_size; ++i) {
  ------------------
  |  Branch (311:17): [True: 0, False: 0]
  ------------------
  312|      0|	if (ENTRY_IS_LIVE (hash_table->entries[i])) {
  ------------------
  |  |   60|      0|#define ENTRY_IS_LIVE(entry) ((entry) >  DEAD_ENTRY)
  |  |  ------------------
  |  |  |  |   56|      0|#define DEAD_ENTRY ((cairo_hash_entry_t *) 0x1)
  |  |  ------------------
  |  |  |  Branch (60:30): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  313|      0|	    *_cairo_hash_table_lookup_unique_key (&tmp, hash_table->entries[i])
  314|      0|		= hash_table->entries[i];
  315|      0|	}
  316|      0|    }
  317|       |
  318|      0|    free (hash_table->entries);
  319|      0|    hash_table->entries = tmp.entries;
  320|      0|    hash_table->table_size = tmp.table_size;
  321|      0|    hash_table->free_entries = new_size - hash_table->live_entries;
  322|       |
  323|      0|    return CAIRO_STATUS_SUCCESS;
  324|      0|}
cairo-hash.c:_cairo_hash_table_lookup_unique_key:
  228|      1|{
  229|      1|    unsigned long table_size, i, idx, step;
  230|      1|    cairo_hash_entry_t **entry;
  231|       |
  232|      1|    table_size = *hash_table->table_size;
  233|      1|    idx = key->hash % table_size;
  234|       |
  235|      1|    entry = &hash_table->entries[idx];
  236|      1|    if (! ENTRY_IS_LIVE (*entry))
  ------------------
  |  |   60|      1|#define ENTRY_IS_LIVE(entry) ((entry) >  DEAD_ENTRY)
  |  |  ------------------
  |  |  |  |   56|      1|#define DEAD_ENTRY ((cairo_hash_entry_t *) 0x1)
  |  |  ------------------
  ------------------
  |  Branch (236:9): [True: 1, False: 0]
  ------------------
  237|      1|	return entry;
  238|       |
  239|      0|    i = 1;
  240|      0|    step = 1 + key->hash % (table_size - 2);
  241|      0|    do {
  242|      0|	idx += step;
  243|      0|	if (idx >= table_size)
  ------------------
  |  Branch (243:6): [True: 0, False: 0]
  ------------------
  244|      0|	    idx -= table_size;
  245|       |
  246|      0|	entry = &hash_table->entries[idx];
  247|      0|	if (! ENTRY_IS_LIVE (*entry))
  ------------------
  |  |   60|      0|#define ENTRY_IS_LIVE(entry) ((entry) >  DEAD_ENTRY)
  |  |  ------------------
  |  |  |  |   56|      0|#define DEAD_ENTRY ((cairo_hash_entry_t *) 0x1)
  |  |  ------------------
  ------------------
  |  Branch (247:6): [True: 0, False: 0]
  ------------------
  248|      0|	    return entry;
  249|      0|    } while (++i < table_size);
  ------------------
  |  Branch (249:14): [True: 0, False: 0]
  ------------------
  250|       |
  251|      0|    ASSERT_NOT_REACHED;
  ------------------
  |  |  140|      0|#define ASSERT_NOT_REACHED		\
  |  |  141|      0|do {					\
  |  |  142|      0|    assert (!"reached");		\
  |  |  143|      0|} while (0)
  |  |  ------------------
  |  |  |  Branch (143:10): [Folded, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (251:5): [Folded, False: 0]
  |  Branch (251:5): [Folded, False: 0]
  ------------------
  252|      0|    return NULL;
  253|      0|}

_cairo_image_traps_compositor_get:
 1275|      1|{
 1276|      1|    static cairo_atomic_once_t once = CAIRO_ATOMIC_ONCE_INIT;
  ------------------
  |  |  537|      1|#define CAIRO_ATOMIC_ONCE_INIT          CAIRO_ATOMIC_ONCE_UNINITIALIZED
  |  |  ------------------
  |  |  |  |  534|      1|#define CAIRO_ATOMIC_ONCE_UNINITIALIZED (0)
  |  |  ------------------
  ------------------
 1277|      1|    static cairo_traps_compositor_t compositor;
 1278|       |
 1279|      1|    if (_cairo_atomic_init_once_enter(&once)) {
  ------------------
  |  Branch (1279:9): [True: 1, False: 0]
  ------------------
 1280|      1|	_cairo_traps_compositor_init(&compositor,
 1281|      1|				     &__cairo_no_compositor);
 1282|      1|	compositor.acquire = acquire;
 1283|      1|	compositor.release = release;
 1284|      1|	compositor.set_clip_region = set_clip_region;
 1285|      1|	compositor.pattern_to_surface = _cairo_image_source_create_for_pattern;
 1286|      1|	compositor.draw_image_boxes = draw_image_boxes;
 1287|       |	//compositor.copy_boxes = copy_boxes;
 1288|      1|	compositor.fill_boxes = fill_boxes;
 1289|      1|	compositor.check_composite = check_composite;
 1290|      1|	compositor.composite = composite;
 1291|      1|	compositor.lerp = lerp;
 1292|       |	//compositor.check_composite_boxes = check_composite_boxes;
 1293|      1|	compositor.composite_boxes = composite_boxes;
 1294|       |	//compositor.check_composite_traps = check_composite_traps;
 1295|      1|	compositor.composite_traps = composite_traps;
 1296|       |	//compositor.check_composite_tristrip = check_composite_traps;
 1297|      1|	compositor.composite_tristrip = composite_tristrip;
 1298|      1|	compositor.check_composite_glyphs = check_composite_glyphs;
 1299|      1|	compositor.composite_glyphs = composite_glyphs;
 1300|       |
 1301|      1|	_cairo_atomic_init_once_leave(&once);
 1302|      1|    }
 1303|       |
 1304|      1|    return &compositor.base;
 1305|      1|}
_cairo_image_spans_compositor_get:
 3144|     71|{
 3145|     71|    static cairo_atomic_once_t once = CAIRO_ATOMIC_ONCE_INIT;
  ------------------
  |  |  537|     71|#define CAIRO_ATOMIC_ONCE_INIT          CAIRO_ATOMIC_ONCE_UNINITIALIZED
  |  |  ------------------
  |  |  |  |  534|     71|#define CAIRO_ATOMIC_ONCE_UNINITIALIZED (0)
  |  |  ------------------
  ------------------
 3146|     71|    static cairo_spans_compositor_t spans;
 3147|     71|    static cairo_compositor_t shape;
 3148|       |
 3149|     71|    if (_cairo_atomic_init_once_enter(&once)) {
  ------------------
  |  Branch (3149:9): [True: 1, False: 70]
  ------------------
 3150|      1|	_cairo_shape_mask_compositor_init (&shape,
 3151|      1|					   _cairo_image_traps_compositor_get());
 3152|      1|	shape.glyphs = NULL;
 3153|       |
 3154|      1|	_cairo_spans_compositor_init (&spans, &shape);
 3155|       |
 3156|      1|	spans.flags = 0;
 3157|       |#if PIXMAN_HAS_OP_LERP
 3158|       |	spans.flags |= CAIRO_SPANS_COMPOSITOR_HAS_LERP;
 3159|       |#endif
 3160|       |
 3161|       |	//spans.acquire = acquire;
 3162|       |	//spans.release = release;
 3163|      1|	spans.fill_boxes = fill_boxes;
 3164|      1|	spans.draw_image_boxes = draw_image_boxes;
 3165|       |	//spans.copy_boxes = copy_boxes;
 3166|      1|	spans.pattern_to_surface = _cairo_image_source_create_for_pattern;
 3167|       |	//spans.check_composite_boxes = check_composite_boxes;
 3168|      1|	spans.composite_boxes = composite_boxes;
 3169|       |	//spans.check_span_renderer = check_span_renderer;
 3170|      1|	spans.renderer_init = span_renderer_init;
 3171|      1|	spans.renderer_fini = span_renderer_fini;
 3172|       |
 3173|      1|	_cairo_atomic_init_once_leave(&once);
 3174|      1|    }
 3175|       |
 3176|     71|    return &spans.base;
 3177|     71|}

_pixman_image_for_pattern:
 1567|     71|{
 1568|     71|    *tx = *ty = 0;
 1569|       |
 1570|     71|    TRACE ((stderr, "%s\n", __FUNCTION__));
 1571|       |
 1572|     71|    if (pattern == NULL)
  ------------------
  |  Branch (1572:9): [True: 0, False: 71]
  ------------------
 1573|      0|	return _pixman_white_image ();
 1574|       |
 1575|     71|    switch (pattern->type) {
 1576|      0|    default:
  ------------------
  |  Branch (1576:5): [True: 0, False: 71]
  ------------------
 1577|      0|	ASSERT_NOT_REACHED;
  ------------------
  |  |  140|      0|#define ASSERT_NOT_REACHED		\
  |  |  141|      0|do {					\
  |  |  142|      0|    assert (!"reached");		\
  |  |  143|      0|} while (0)
  |  |  ------------------
  |  |  |  Branch (143:10): [Folded, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (1577:2): [Folded, False: 0]
  |  Branch (1577:2): [Folded, False: 0]
  ------------------
 1578|      0|    case CAIRO_PATTERN_TYPE_SOLID:
  ------------------
  |  Branch (1578:5): [True: 0, False: 71]
  ------------------
 1579|      0|	return _pixman_image_for_color (&((const cairo_solid_pattern_t *) pattern)->color);
 1580|       |
 1581|      0|    case CAIRO_PATTERN_TYPE_RADIAL:
  ------------------
  |  Branch (1581:5): [True: 0, False: 71]
  ------------------
 1582|      0|    case CAIRO_PATTERN_TYPE_LINEAR:
  ------------------
  |  Branch (1582:5): [True: 0, False: 71]
  ------------------
 1583|      0|	return _pixman_image_for_gradient ((const cairo_gradient_pattern_t *) pattern,
 1584|      0|					   extents, tx, ty);
 1585|       |
 1586|      0|    case CAIRO_PATTERN_TYPE_MESH:
  ------------------
  |  Branch (1586:5): [True: 0, False: 71]
  ------------------
 1587|      0|	return _pixman_image_for_mesh ((const cairo_mesh_pattern_t *) pattern,
 1588|      0|					   extents, tx, ty);
 1589|       |
 1590|      0|    case CAIRO_PATTERN_TYPE_SURFACE:
  ------------------
  |  Branch (1590:5): [True: 0, False: 71]
  ------------------
 1591|      0|	return _pixman_image_for_surface (dst,
 1592|      0|					  (const cairo_surface_pattern_t *) pattern,
 1593|      0|					  is_mask, extents, sample,
 1594|      0|					  tx, ty);
 1595|       |
 1596|     71|    case CAIRO_PATTERN_TYPE_RASTER_SOURCE:
  ------------------
  |  Branch (1596:5): [True: 71, False: 0]
  ------------------
 1597|     71|	return _pixman_image_for_raster (dst,
 1598|     71|					 (const cairo_raster_source_pattern_t *) pattern,
 1599|     71|					 is_mask, extents, sample,
 1600|     71|					 tx, ty);
 1601|     71|    }
 1602|     71|}
_cairo_image_source_create_for_pattern:
 1626|     71|{
 1627|     71|    cairo_image_source_t *source;
 1628|       |
 1629|     71|    TRACE ((stderr, "%s\n", __FUNCTION__));
 1630|       |
 1631|     71|    source = _cairo_calloc (sizeof (cairo_image_source_t));
  ------------------
  |  |   79|     71|    ((size) != 0 ? calloc(1,size) : NULL)
  |  |  ------------------
  |  |  |  Branch (79:6): [True: 71, Folded]
  |  |  ------------------
  ------------------
 1632|     71|    if (unlikely (source == NULL))
  ------------------
  |  |  145|     71|#define unlikely(expr) (__builtin_expect (!!(expr), 0))
  |  |  ------------------
  |  |  |  Branch (145:24): [True: 0, False: 71]
  |  |  ------------------
  ------------------
 1633|      0|	return _cairo_surface_create_in_error (_cairo_error (CAIRO_STATUS_NO_MEMORY));
 1634|       |
 1635|     71|    source->pixman_image =
 1636|     71|	_pixman_image_for_pattern ((cairo_image_surface_t *)dst,
 1637|     71|				   pattern, is_mask,
 1638|     71|				   extents, sample,
 1639|     71|				   src_x, src_y);
 1640|     71|    if (unlikely (source->pixman_image == NULL)) {
  ------------------
  |  |  145|     71|#define unlikely(expr) (__builtin_expect (!!(expr), 0))
  |  |  ------------------
  |  |  |  Branch (145:24): [True: 71, False: 0]
  |  |  ------------------
  ------------------
 1641|     71|	free (source);
 1642|     71|	return _cairo_surface_create_in_error (CAIRO_STATUS_NO_MEMORY);
 1643|     71|    }
 1644|       |
 1645|      0|    _cairo_surface_init (&source->base,
 1646|      0|			 &_cairo_image_source_backend,
 1647|      0|			 NULL, /* device */
 1648|      0|			 CAIRO_CONTENT_COLOR_ALPHA,
 1649|      0|			 FALSE); /* is_vector */
  ------------------
  |  |  102|      0|#define FALSE 0
  ------------------
 1650|       |
 1651|      0|    source->is_opaque_solid =
 1652|      0|	pattern == NULL || _cairo_pattern_is_opaque_solid (pattern);
  ------------------
  |  Branch (1652:2): [True: 0, False: 0]
  |  Branch (1652:21): [True: 0, False: 0]
  ------------------
 1653|       |
 1654|      0|    return &source->base;
 1655|     71|}
cairo-image-source.c:_pixman_image_for_raster:
 1498|     71|{
 1499|     71|    pixman_image_t *pixman_image;
 1500|     71|    struct raster_source_cleanup *cleanup;
 1501|     71|    cairo_image_surface_t *image;
 1502|     71|    void *extra;
 1503|     71|    cairo_status_t status;
 1504|     71|    cairo_surface_t *surface;
 1505|       |
 1506|     71|    TRACE ((stderr, "%s\n", __FUNCTION__));
 1507|       |
 1508|     71|    *ix = *iy = 0;
 1509|       |
 1510|     71|    surface = _cairo_raster_source_pattern_acquire (&pattern->base,
 1511|     71|						    &dst->base, NULL);
 1512|     71|    if (unlikely (surface == NULL || surface->status))
  ------------------
  |  |  145|    142|#define unlikely(expr) (__builtin_expect (!!(expr), 0))
  |  |  ------------------
  |  |  |  Branch (145:24): [True: 71, False: 0]
  |  |  |  Branch (145:46): [True: 0, False: 71]
  |  |  |  Branch (145:46): [True: 71, False: 0]
  |  |  ------------------
  ------------------
 1513|     71|	return NULL;
 1514|       |
 1515|      0|    status = _cairo_surface_acquire_source_image (surface, &image, &extra);
 1516|      0|    if (unlikely (status)) {
  ------------------
  |  |  145|      0|#define unlikely(expr) (__builtin_expect (!!(expr), 0))
  |  |  ------------------
  |  |  |  Branch (145:24): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1517|      0|	_cairo_raster_source_pattern_release (&pattern->base, surface);
 1518|      0|	return NULL;
 1519|      0|    }
 1520|       |
 1521|      0|    assert (image->width == pattern->extents.width);
  ------------------
  |  Branch (1521:5): [True: 0, False: 0]
  |  Branch (1521:5): [True: 0, False: 0]
  ------------------
 1522|      0|    assert (image->height == pattern->extents.height);
  ------------------
  |  Branch (1522:5): [True: 0, False: 0]
  |  Branch (1522:5): [True: 0, False: 0]
  ------------------
 1523|       |
 1524|      0|    pixman_image = pixman_image_create_bits (image->pixman_format,
 1525|      0|					     image->width,
 1526|      0|					     image->height,
 1527|      0|					     (uint32_t *) image->data,
 1528|      0|					     image->stride);
 1529|      0|    if (unlikely (pixman_image == NULL)) {
  ------------------
  |  |  145|      0|#define unlikely(expr) (__builtin_expect (!!(expr), 0))
  |  |  ------------------
  |  |  |  Branch (145:24): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1530|      0|	_cairo_surface_release_source_image (surface, image, extra);
 1531|      0|	_cairo_raster_source_pattern_release (&pattern->base, surface);
 1532|      0|	return NULL;
 1533|      0|    }
 1534|       |
 1535|      0|    cleanup = _cairo_calloc (sizeof (*cleanup));
  ------------------
  |  |   79|      0|    ((size) != 0 ? calloc(1,size) : NULL)
  |  |  ------------------
  |  |  |  Branch (79:6): [True: 0, Folded]
  |  |  ------------------
  ------------------
 1536|      0|    if (unlikely (cleanup == NULL)) {
  ------------------
  |  |  145|      0|#define unlikely(expr) (__builtin_expect (!!(expr), 0))
  |  |  ------------------
  |  |  |  Branch (145:24): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1537|      0|	pixman_image_unref (pixman_image);
 1538|      0|	_cairo_surface_release_source_image (surface, image, extra);
 1539|      0|	_cairo_raster_source_pattern_release (&pattern->base, surface);
 1540|      0|	return NULL;
 1541|      0|    }
 1542|       |
 1543|      0|    cleanup->pattern = &pattern->base;
 1544|      0|    cleanup->surface = surface;
 1545|      0|    cleanup->image = image;
 1546|      0|    cleanup->image_extra = extra;
 1547|      0|    pixman_image_set_destroy_function (pixman_image,
 1548|      0|				       _raster_source_cleanup, cleanup);
 1549|       |
 1550|      0|    if (! _pixman_image_set_properties (pixman_image,
  ------------------
  |  Branch (1550:9): [True: 0, False: 0]
  ------------------
 1551|      0|					&pattern->base, extents,
 1552|      0|					ix, iy)) {
 1553|      0|	pixman_image_unref (pixman_image);
 1554|      0|	pixman_image= NULL;
 1555|      0|    }
 1556|       |
 1557|      0|    return pixman_image;
 1558|      0|}

cairo-image-surface.c:_cairo_surface_is_image:
   75|    142|{
   76|       |    /* _cairo_surface_nil sets a NULL backend so be safe */
   77|    142|    return surface->backend && surface->backend->type == CAIRO_SURFACE_TYPE_IMAGE;
  ------------------
  |  Branch (77:12): [True: 142, False: 0]
  |  Branch (77:32): [True: 142, False: 0]
  ------------------
   78|    142|}

_cairo_format_from_pixman_format:
   94|     71|{
   95|     71|    switch (pixman_format) {
   96|     14|    case PIXMAN_rgba_float:
  ------------------
  |  Branch (96:5): [True: 14, False: 57]
  ------------------
   97|     14|	return CAIRO_FORMAT_RGBA128F;
   98|     15|    case PIXMAN_rgb_float:
  ------------------
  |  Branch (98:5): [True: 15, False: 56]
  ------------------
   99|     15|	return CAIRO_FORMAT_RGB96F;
  100|     10|    case PIXMAN_a8r8g8b8:
  ------------------
  |  Branch (100:5): [True: 10, False: 61]
  ------------------
  101|     10|	return CAIRO_FORMAT_ARGB32;
  102|      0|    case PIXMAN_x2r10g10b10:
  ------------------
  |  Branch (102:5): [True: 0, False: 71]
  ------------------
  103|      0|	return CAIRO_FORMAT_RGB30;
  104|     32|    case PIXMAN_x8r8g8b8:
  ------------------
  |  Branch (104:5): [True: 32, False: 39]
  ------------------
  105|     32|	return CAIRO_FORMAT_RGB24;
  106|      0|    case PIXMAN_a8:
  ------------------
  |  Branch (106:5): [True: 0, False: 71]
  ------------------
  107|      0|	return CAIRO_FORMAT_A8;
  108|      0|    case PIXMAN_a1:
  ------------------
  |  Branch (108:5): [True: 0, False: 71]
  ------------------
  109|      0|	return CAIRO_FORMAT_A1;
  110|      0|    case PIXMAN_r5g6b5:
  ------------------
  |  Branch (110:5): [True: 0, False: 71]
  ------------------
  111|      0|	return CAIRO_FORMAT_RGB16_565;
  112|      0|    case PIXMAN_r8g8b8a8: case PIXMAN_r8g8b8x8:
  ------------------
  |  Branch (112:5): [True: 0, False: 71]
  |  Branch (112:27): [True: 0, False: 71]
  ------------------
  113|      0|    case PIXMAN_a8r8g8b8_sRGB:
  ------------------
  |  Branch (113:5): [True: 0, False: 71]
  ------------------
  114|      0|#if HAS_PIXMAN_r8g8b8_sRGB
  115|      0|    case PIXMAN_r8g8b8_sRGB:
  ------------------
  |  Branch (115:5): [True: 0, False: 71]
  ------------------
  116|      0|#endif
  117|      0|    case PIXMAN_a8b8g8r8: case PIXMAN_x8b8g8r8: case PIXMAN_r8g8b8:
  ------------------
  |  Branch (117:5): [True: 0, False: 71]
  |  Branch (117:27): [True: 0, False: 71]
  |  Branch (117:49): [True: 0, False: 71]
  ------------------
  118|      0|    case PIXMAN_b8g8r8:   case PIXMAN_b5g6r5:
  ------------------
  |  Branch (118:5): [True: 0, False: 71]
  |  Branch (118:27): [True: 0, False: 71]
  ------------------
  119|      0|    case PIXMAN_a1r5g5b5: case PIXMAN_x1r5g5b5: case PIXMAN_a1b5g5r5:
  ------------------
  |  Branch (119:5): [True: 0, False: 71]
  |  Branch (119:27): [True: 0, False: 71]
  |  Branch (119:49): [True: 0, False: 71]
  ------------------
  120|      0|    case PIXMAN_x1b5g5r5: case PIXMAN_a4r4g4b4: case PIXMAN_x4r4g4b4:
  ------------------
  |  Branch (120:5): [True: 0, False: 71]
  |  Branch (120:27): [True: 0, False: 71]
  |  Branch (120:49): [True: 0, False: 71]
  ------------------
  121|      0|    case PIXMAN_a4b4g4r4: case PIXMAN_x4b4g4r4: case PIXMAN_r3g3b2:
  ------------------
  |  Branch (121:5): [True: 0, False: 71]
  |  Branch (121:27): [True: 0, False: 71]
  |  Branch (121:49): [True: 0, False: 71]
  ------------------
  122|      0|    case PIXMAN_b2g3r3:   case PIXMAN_a2r2g2b2: case PIXMAN_a2b2g2r2:
  ------------------
  |  Branch (122:5): [True: 0, False: 71]
  |  Branch (122:27): [True: 0, False: 71]
  |  Branch (122:49): [True: 0, False: 71]
  ------------------
  123|      0|    case PIXMAN_c8:       case PIXMAN_g8:       case PIXMAN_x4a4:
  ------------------
  |  Branch (123:5): [True: 0, False: 71]
  |  Branch (123:27): [True: 0, False: 71]
  |  Branch (123:49): [True: 0, False: 71]
  ------------------
  124|      0|    case PIXMAN_a4:       case PIXMAN_r1g2b1:   case PIXMAN_b1g2r1:
  ------------------
  |  Branch (124:5): [True: 0, False: 71]
  |  Branch (124:27): [True: 0, False: 71]
  |  Branch (124:49): [True: 0, False: 71]
  ------------------
  125|      0|    case PIXMAN_a1r1g1b1: case PIXMAN_a1b1g1r1: case PIXMAN_c4:
  ------------------
  |  Branch (125:5): [True: 0, False: 71]
  |  Branch (125:27): [True: 0, False: 71]
  |  Branch (125:49): [True: 0, False: 71]
  ------------------
  126|      0|    case PIXMAN_g4:       case PIXMAN_g1:
  ------------------
  |  Branch (126:5): [True: 0, False: 71]
  |  Branch (126:27): [True: 0, False: 71]
  ------------------
  127|      0|    case PIXMAN_yuy2:     case PIXMAN_yv12:
  ------------------
  |  Branch (127:5): [True: 0, False: 71]
  |  Branch (127:27): [True: 0, False: 71]
  ------------------
  128|      0|    case PIXMAN_b8g8r8x8:
  ------------------
  |  Branch (128:5): [True: 0, False: 71]
  ------------------
  129|      0|    case PIXMAN_b8g8r8a8:
  ------------------
  |  Branch (129:5): [True: 0, False: 71]
  ------------------
  130|      0|    case PIXMAN_a2b10g10r10:
  ------------------
  |  Branch (130:5): [True: 0, False: 71]
  ------------------
  131|      0|    case PIXMAN_x2b10g10r10:
  ------------------
  |  Branch (131:5): [True: 0, False: 71]
  ------------------
  132|      0|    case PIXMAN_a2r10g10b10:
  ------------------
  |  Branch (132:5): [True: 0, False: 71]
  ------------------
  133|      0|    case PIXMAN_x14r6g6b6:
  ------------------
  |  Branch (133:5): [True: 0, False: 71]
  ------------------
  134|      0|    default:
  ------------------
  |  Branch (134:5): [True: 0, False: 71]
  ------------------
  135|      0|	return CAIRO_FORMAT_INVALID;
  136|     71|    }
  137|       |
  138|      0|    return CAIRO_FORMAT_INVALID;
  139|     71|}
_cairo_content_from_pixman_format:
  143|     71|{
  144|     71|    cairo_content_t content;
  145|       |
  146|     71|    content = 0;
  147|     71|    if (PIXMAN_FORMAT_RGB (pixman_format))
  ------------------
  |  |  850|     71|#define PIXMAN_FORMAT_RGB(f)	(((f)      ) & 0xfff)
  |  |  ------------------
  |  |  |  Branch (850:30): [True: 71, False: 0]
  |  |  ------------------
  ------------------
  148|     71|	content |= CAIRO_CONTENT_COLOR;
  149|     71|    if (PIXMAN_FORMAT_A (pixman_format))
  ------------------
  |  |  846|     71|#define PIXMAN_FORMAT_A(f)	PIXMAN_FORMAT_RESHIFT(f, 12, 4)
  |  |  ------------------
  |  |  |  |  841|     71|	(((val >> (ofs)) & ((1 << (num)) - 1)) << ((val >> 22) & 3))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (841:2): [True: 24, False: 47]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  150|     24|	content |= CAIRO_CONTENT_ALPHA;
  151|       |
  152|     71|    return content;
  153|     71|}
_cairo_image_surface_init:
  159|     71|{
  160|     71|    surface->parent = NULL;
  161|     71|    surface->pixman_image = pixman_image;
  162|       |
  163|     71|    surface->pixman_format = pixman_format;
  164|     71|    surface->format = _cairo_format_from_pixman_format (pixman_format);
  165|     71|    surface->data = (uint8_t *) pixman_image_get_data (pixman_image);
  166|     71|    surface->owns_data = FALSE;
  ------------------
  |  |  102|     71|#define FALSE 0
  ------------------
  167|     71|    surface->transparency = CAIRO_IMAGE_UNKNOWN;
  168|     71|    surface->color = CAIRO_IMAGE_UNKNOWN_COLOR;
  169|       |
  170|     71|    surface->width = pixman_image_get_width (pixman_image);
  171|     71|    surface->height = pixman_image_get_height (pixman_image);
  172|     71|    surface->stride = pixman_image_get_stride (pixman_image);
  173|     71|    surface->depth = pixman_image_get_depth (pixman_image);
  174|       |
  175|     71|    surface->base.is_clear = surface->width == 0 || surface->height == 0;
  ------------------
  |  Branch (175:30): [True: 0, False: 71]
  |  Branch (175:53): [True: 0, False: 71]
  ------------------
  176|       |
  177|     71|    surface->compositor = _cairo_image_spans_compositor_get ();
  178|     71|}
_cairo_image_surface_create_for_pixman_image:
  183|     71|{
  184|     71|    cairo_image_surface_t *surface;
  185|       |
  186|     71|    surface = _cairo_calloc (sizeof (cairo_image_surface_t));
  ------------------
  |  |   79|     71|    ((size) != 0 ? calloc(1,size) : NULL)
  |  |  ------------------
  |  |  |  Branch (79:6): [True: 71, Folded]
  |  |  ------------------
  ------------------
  187|     71|    if (unlikely (surface == NULL))
  ------------------
  |  |  145|     71|#define unlikely(expr) (__builtin_expect (!!(expr), 0))
  |  |  ------------------
  |  |  |  Branch (145:24): [True: 0, False: 71]
  |  |  ------------------
  ------------------
  188|      0|	return _cairo_surface_create_in_error (_cairo_error (CAIRO_STATUS_NO_MEMORY));
  189|       |
  190|     71|    _cairo_surface_init (&surface->base,
  191|     71|			 &_cairo_image_surface_backend,
  192|     71|			 NULL, /* device */
  193|     71|			 _cairo_content_from_pixman_format (pixman_format),
  194|     71|			 FALSE); /* is_vector */
  ------------------
  |  |  102|     71|#define FALSE 0
  ------------------
  195|       |
  196|     71|    _cairo_image_surface_init (surface, pixman_image, pixman_format);
  197|       |
  198|     71|    return &surface->base;
  199|     71|}
_cairo_format_to_pixman_format_code:
  326|     71|{
  327|     71|    pixman_format_code_t ret;
  328|     71|    switch (format) {
  329|      0|    case CAIRO_FORMAT_A1:
  ------------------
  |  Branch (329:5): [True: 0, False: 71]
  ------------------
  330|      0|	ret = PIXMAN_a1;
  331|      0|	break;
  332|      0|    case CAIRO_FORMAT_A8:
  ------------------
  |  Branch (332:5): [True: 0, False: 71]
  ------------------
  333|      0|	ret = PIXMAN_a8;
  334|      0|	break;
  335|     32|    case CAIRO_FORMAT_RGB24:
  ------------------
  |  Branch (335:5): [True: 32, False: 39]
  ------------------
  336|     32|	ret = PIXMAN_x8r8g8b8;
  337|     32|	break;
  338|      0|    case CAIRO_FORMAT_RGB30:
  ------------------
  |  Branch (338:5): [True: 0, False: 71]
  ------------------
  339|      0|	ret = PIXMAN_x2r10g10b10;
  340|      0|	break;
  341|      0|    case CAIRO_FORMAT_RGB16_565:
  ------------------
  |  Branch (341:5): [True: 0, False: 71]
  ------------------
  342|      0|	ret = PIXMAN_r5g6b5;
  343|      0|	break;
  344|     15|    case CAIRO_FORMAT_RGB96F:
  ------------------
  |  Branch (344:5): [True: 15, False: 56]
  ------------------
  345|     15|	ret = PIXMAN_rgb_float;
  346|     15|	break;
  347|     14|    case CAIRO_FORMAT_RGBA128F:
  ------------------
  |  Branch (347:5): [True: 14, False: 57]
  ------------------
  348|     14|	ret = PIXMAN_rgba_float;
  349|     14|	break;
  350|     10|    case CAIRO_FORMAT_ARGB32:
  ------------------
  |  Branch (350:5): [True: 10, False: 61]
  ------------------
  351|     10|    case CAIRO_FORMAT_INVALID:
  ------------------
  |  Branch (351:5): [True: 0, False: 71]
  ------------------
  352|     10|    default:
  ------------------
  |  Branch (352:5): [True: 0, False: 71]
  ------------------
  353|     10|	ret = PIXMAN_a8r8g8b8;
  354|     10|	break;
  355|     71|    }
  356|     71|    return ret;
  357|     71|}
_cairo_image_surface_create_with_pixman_format:
  365|     71|{
  366|     71|    cairo_surface_t *surface;
  367|     71|    pixman_image_t *pixman_image;
  368|       |
  369|     71|    if (! _cairo_image_surface_is_size_valid (width, height))
  ------------------
  |  Branch (369:9): [True: 0, False: 71]
  ------------------
  370|      0|    {
  371|      0|	return _cairo_surface_create_in_error (_cairo_error (CAIRO_STATUS_INVALID_SIZE));
  372|      0|    }
  373|       |
  374|     71|    pixman_image = pixman_image_create_bits (pixman_format, width, height,
  375|     71|					     (uint32_t *) data, stride);
  376|       |
  377|     71|    if (unlikely (pixman_image == NULL))
  ------------------
  |  |  145|     71|#define unlikely(expr) (__builtin_expect (!!(expr), 0))
  |  |  ------------------
  |  |  |  Branch (145:24): [True: 0, False: 71]
  |  |  ------------------
  ------------------
  378|      0|	return _cairo_surface_create_in_error (_cairo_error (CAIRO_STATUS_NO_MEMORY));
  379|       |
  380|     71|    surface = _cairo_image_surface_create_for_pixman_image (pixman_image,
  381|     71|							    pixman_format);
  382|     71|    if (unlikely (surface->status)) {
  ------------------
  |  |  145|     71|#define unlikely(expr) (__builtin_expect (!!(expr), 0))
  |  |  ------------------
  |  |  |  Branch (145:24): [True: 0, False: 71]
  |  |  ------------------
  ------------------
  383|      0|	pixman_image_unref (pixman_image);
  384|      0|	return surface;
  385|      0|    }
  386|       |
  387|       |    /* we can not make any assumptions about the initial state of user data */
  388|     71|    surface->is_clear = data == NULL;
  389|     71|    return surface;
  390|     71|}
cairo_format_stride_for_width:
  469|    241|{
  470|    241|    int bpp;
  471|       |
  472|    241|    if (! CAIRO_FORMAT_VALID (format)) {
  ------------------
  |  | 1556|    241|#define CAIRO_FORMAT_VALID(format) ((format) >= CAIRO_FORMAT_ARGB32 &&		\
  |  |  ------------------
  |  |  |  Branch (1556:37): [True: 241, False: 0]
  |  |  ------------------
  |  | 1557|    241|                                    (format) <= CAIRO_FORMAT_RGBA128F)
  |  |  ------------------
  |  |  |  Branch (1557:37): [True: 241, False: 0]
  |  |  ------------------
  ------------------
  473|      0|	_cairo_error_throw (CAIRO_STATUS_INVALID_FORMAT);
  ------------------
  |  |  126|      0|#define _cairo_error_throw(status) do { \
  |  |  127|      0|    cairo_status_t status__ = _cairo_error (status); \
  |  |  128|      0|    (void) status__; \
  |  |  129|      0|} while (0)
  |  |  ------------------
  |  |  |  Branch (129:10): [Folded, False: 0]
  |  |  ------------------
  ------------------
  474|      0|	return -1;
  475|      0|    }
  476|       |
  477|    241|    bpp = _cairo_format_bits_per_pixel (format);
  478|    241|    if ((unsigned) (width) >= (INT32_MAX - 7) / (unsigned) (bpp))
  ------------------
  |  Branch (478:9): [True: 0, False: 241]
  ------------------
  479|      0|	return -1;
  480|       |
  481|    241|    return CAIRO_STRIDE_FOR_WIDTH_BPP (width, bpp);
  ------------------
  |  | 1562|    241|   ((((bpp)*(w)+7)/8 + CAIRO_STRIDE_ALIGNMENT-1) & -CAIRO_STRIDE_ALIGNMENT)
  |  |  ------------------
  |  |  |  | 1560|    241|#define CAIRO_STRIDE_ALIGNMENT (sizeof (uint32_t))
  |  |  ------------------
  |  |                  ((((bpp)*(w)+7)/8 + CAIRO_STRIDE_ALIGNMENT-1) & -CAIRO_STRIDE_ALIGNMENT)
  |  |  ------------------
  |  |  |  | 1560|    241|#define CAIRO_STRIDE_ALIGNMENT (sizeof (uint32_t))
  |  |  ------------------
  ------------------
  482|    241|}
cairo_image_surface_create_for_data:
  535|     73|{
  536|     73|    pixman_format_code_t pixman_format;
  537|     73|    int minstride;
  538|       |
  539|     73|    if (! CAIRO_FORMAT_VALID (format))
  ------------------
  |  | 1556|     73|#define CAIRO_FORMAT_VALID(format) ((format) >= CAIRO_FORMAT_ARGB32 &&		\
  |  |  ------------------
  |  |  |  Branch (1556:37): [True: 73, False: 0]
  |  |  ------------------
  |  | 1557|     73|                                    (format) <= CAIRO_FORMAT_RGBA128F)
  |  |  ------------------
  |  |  |  Branch (1557:37): [True: 73, False: 0]
  |  |  ------------------
  ------------------
  540|      0|	return _cairo_surface_create_in_error (_cairo_error (CAIRO_STATUS_INVALID_FORMAT));
  541|       |
  542|     73|    if ((stride & (CAIRO_STRIDE_ALIGNMENT-1)) != 0)
  ------------------
  |  | 1560|     73|#define CAIRO_STRIDE_ALIGNMENT (sizeof (uint32_t))
  ------------------
  |  Branch (542:9): [True: 0, False: 73]
  ------------------
  543|      0|	return _cairo_surface_create_in_error (_cairo_error (CAIRO_STATUS_INVALID_STRIDE));
  544|       |
  545|     73|    if (! _cairo_image_surface_is_size_valid (width, height))
  ------------------
  |  Branch (545:9): [True: 2, False: 71]
  ------------------
  546|      2|	return _cairo_surface_create_in_error (_cairo_error (CAIRO_STATUS_INVALID_SIZE));
  547|       |
  548|     71|    minstride = cairo_format_stride_for_width (format, width);
  549|     71|    if (stride < 0) {
  ------------------
  |  Branch (549:9): [True: 0, False: 71]
  ------------------
  550|      0|	if (stride > -minstride) {
  ------------------
  |  Branch (550:6): [True: 0, False: 0]
  ------------------
  551|      0|	    return _cairo_surface_create_in_error (_cairo_error (CAIRO_STATUS_INVALID_STRIDE));
  552|      0|	}
  553|     71|    } else {
  554|     71|	if (stride < minstride) {
  ------------------
  |  Branch (554:6): [True: 0, False: 71]
  ------------------
  555|      0|	    return _cairo_surface_create_in_error (_cairo_error (CAIRO_STATUS_INVALID_STRIDE));
  556|      0|	}
  557|     71|    }
  558|       |
  559|     71|    pixman_format = _cairo_format_to_pixman_format_code (format);
  560|     71|    return _cairo_image_surface_create_with_pixman_format (data,
  561|     71|							   pixman_format,
  562|     71|							   width, height,
  563|     71|							   stride);
  564|     71|}
cairo_image_surface_get_width:
  632|     71|{
  633|     71|    cairo_image_surface_t *image_surface = (cairo_image_surface_t *) surface;
  634|       |
  635|     71|    if (! _cairo_surface_is_image (surface)) {
  ------------------
  |  Branch (635:9): [True: 0, False: 71]
  ------------------
  636|      0|	_cairo_error_throw (CAIRO_STATUS_SURFACE_TYPE_MISMATCH);
  ------------------
  |  |  126|      0|#define _cairo_error_throw(status) do { \
  |  |  127|      0|    cairo_status_t status__ = _cairo_error (status); \
  |  |  128|      0|    (void) status__; \
  |  |  129|      0|} while (0)
  |  |  ------------------
  |  |  |  Branch (129:10): [Folded, False: 0]
  |  |  ------------------
  ------------------
  637|      0|	return 0;
  638|      0|    }
  639|       |
  640|     71|    return image_surface->width;
  641|     71|}
cairo_image_surface_get_height:
  655|     71|{
  656|     71|    cairo_image_surface_t *image_surface = (cairo_image_surface_t *) surface;
  657|       |
  658|     71|    if (! _cairo_surface_is_image (surface)) {
  ------------------
  |  Branch (658:9): [True: 0, False: 71]
  ------------------
  659|      0|	_cairo_error_throw (CAIRO_STATUS_SURFACE_TYPE_MISMATCH);
  ------------------
  |  |  126|      0|#define _cairo_error_throw(status) do { \
  |  |  127|      0|    cairo_status_t status__ = _cairo_error (status); \
  |  |  128|      0|    (void) status__; \
  |  |  129|      0|} while (0)
  |  |  ------------------
  |  |  |  Branch (129:10): [Folded, False: 0]
  |  |  ------------------
  ------------------
  660|      0|	return 0;
  661|      0|    }
  662|       |
  663|     71|    return image_surface->height;
  664|     71|}
_cairo_format_bits_per_pixel:
  736|    241|{
  737|    241|    switch (format) {
  738|     32|    case CAIRO_FORMAT_RGBA128F:
  ------------------
  |  Branch (738:5): [True: 32, False: 209]
  ------------------
  739|     32|	return 128;
  740|     37|    case CAIRO_FORMAT_RGB96F:
  ------------------
  |  Branch (740:5): [True: 37, False: 204]
  ------------------
  741|     37|	return 96;
  742|     68|    case CAIRO_FORMAT_ARGB32:
  ------------------
  |  Branch (742:5): [True: 68, False: 173]
  ------------------
  743|     68|    case CAIRO_FORMAT_RGB30:
  ------------------
  |  Branch (743:5): [True: 0, False: 241]
  ------------------
  744|    172|    case CAIRO_FORMAT_RGB24:
  ------------------
  |  Branch (744:5): [True: 104, False: 137]
  ------------------
  745|    172|	return 32;
  746|      0|    case CAIRO_FORMAT_RGB16_565:
  ------------------
  |  Branch (746:5): [True: 0, False: 241]
  ------------------
  747|      0|	return 16;
  748|      0|    case CAIRO_FORMAT_A8:
  ------------------
  |  Branch (748:5): [True: 0, False: 241]
  ------------------
  749|      0|	return 8;
  750|      0|    case CAIRO_FORMAT_A1:
  ------------------
  |  Branch (750:5): [True: 0, False: 241]
  ------------------
  751|      0|	return 1;
  752|      0|    case CAIRO_FORMAT_INVALID:
  ------------------
  |  Branch (752:5): [True: 0, False: 241]
  ------------------
  753|      0|    default:
  ------------------
  |  Branch (753:5): [True: 0, False: 241]
  ------------------
  754|      0|	ASSERT_NOT_REACHED;
  ------------------
  |  |  140|      0|#define ASSERT_NOT_REACHED		\
  |  |  141|      0|do {					\
  |  |  142|      0|    assert (!"reached");		\
  |  |  143|      0|} while (0)
  |  |  ------------------
  |  |  |  Branch (143:10): [Folded, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (754:2): [Folded, False: 0]
  |  Branch (754:2): [Folded, False: 0]
  ------------------
  755|      0|	return 0;
  756|    241|    }
  757|    241|}
_cairo_image_surface_finish:
  865|     71|{
  866|     71|    cairo_image_surface_t *surface = abstract_surface;
  867|       |
  868|     71|    if (surface->pixman_image) {
  ------------------
  |  Branch (868:9): [True: 71, False: 0]
  ------------------
  869|     71|	pixman_image_unref (surface->pixman_image);
  870|     71|	surface->pixman_image = NULL;
  871|     71|    }
  872|       |
  873|     71|    if (surface->owns_data) {
  ------------------
  |  Branch (873:9): [True: 71, False: 0]
  ------------------
  874|     71|	free (surface->data);
  875|     71|	surface->data = NULL;
  876|     71|    }
  877|       |
  878|     71|    if (surface->parent) {
  ------------------
  |  Branch (878:9): [True: 0, False: 71]
  ------------------
  879|      0|	cairo_surface_t *parent = surface->parent;
  880|      0|	surface->parent = NULL;
  881|      0|	cairo_surface_destroy (parent);
  882|      0|    }
  883|       |
  884|     71|    return CAIRO_STATUS_SUCCESS;
  885|     71|}
_cairo_image_surface_assume_ownership_of_data:
  889|     71|{
  890|     71|    surface->owns_data = TRUE;
  ------------------
  |  |  106|     71|#define TRUE 1
  ------------------
  891|     71|}
_cairo_image_surface_get_extents:
  930|     71|{
  931|     71|    cairo_image_surface_t *surface = abstract_surface;
  932|       |
  933|     71|    rectangle->x = 0;
  934|     71|    rectangle->y = 0;
  935|     71|    rectangle->width  = surface->width;
  936|     71|    rectangle->height = surface->height;
  937|       |
  938|     71|    return TRUE;
  ------------------
  |  |  106|     71|#define TRUE 1
  ------------------
  939|     71|}
_cairo_image_surface_paint:
  946|     71|{
  947|     71|    cairo_image_surface_t *surface = abstract_surface;
  948|     71|    pixman_dither_t pixman_dither = _cairo_dither_to_pixman_dither (source->dither);
  949|     71|    pixman_image_set_dither (surface->pixman_image, pixman_dither);
  950|       |
  951|     71|    TRACE ((stderr, "%s (surface=%d)\n",
  952|     71|	    __FUNCTION__, surface->base.unique_id));
  953|       |
  954|     71|    return _cairo_compositor_paint (surface->compositor,
  955|     71|				    &surface->base, op, source, clip);
  956|     71|}
cairo-image-surface.c:_cairo_image_surface_is_size_valid:
   87|    144|{
   88|    144|    return 0 <= width  &&  width <= MAX_IMAGE_SIZE &&
  ------------------
  |  |   62|    288|#define MAX_IMAGE_SIZE 32767
  ------------------
  |  Branch (88:12): [True: 144, False: 0]
  |  Branch (88:28): [True: 142, False: 2]
  ------------------
   89|    142|	   0 <= height && height <= MAX_IMAGE_SIZE;
  ------------------
  |  |   62|    142|#define MAX_IMAGE_SIZE 32767
  ------------------
  |  Branch (89:5): [True: 142, False: 0]
  |  Branch (89:20): [True: 142, False: 0]
  ------------------
   90|    144|}
cairo-image-surface.c:_cairo_dither_to_pixman_dither:
  251|     71|{
  252|     71|    switch (dither) {
  253|      0|    case CAIRO_DITHER_FAST:
  ------------------
  |  Branch (253:5): [True: 0, False: 71]
  ------------------
  254|      0|        return PIXMAN_DITHER_FAST;
  255|      0|    case CAIRO_DITHER_GOOD:
  ------------------
  |  Branch (255:5): [True: 0, False: 71]
  ------------------
  256|      0|        return PIXMAN_DITHER_GOOD;
  257|      0|    case CAIRO_DITHER_BEST:
  ------------------
  |  Branch (257:5): [True: 0, False: 71]
  ------------------
  258|      0|        return PIXMAN_DITHER_BEST;
  259|      0|    case CAIRO_DITHER_NONE:
  ------------------
  |  Branch (259:5): [True: 0, False: 71]
  ------------------
  260|     71|    case CAIRO_DITHER_DEFAULT:
  ------------------
  |  Branch (260:5): [True: 71, False: 0]
  ------------------
  261|     71|    default:
  ------------------
  |  Branch (261:5): [True: 0, False: 71]
  ------------------
  262|     71|        return PIXMAN_DITHER_NONE;
  263|     71|    }
  264|     71|}

cairo-pattern.c:cairo_list_init:
  187|    213|{
  188|    213|    entry->next = entry;
  189|    213|    entry->prev = entry;
  190|    213|}
cairo-surface.c:cairo_list_init:
  187|    142|{
  188|    142|    entry->next = entry;
  189|    142|    entry->prev = entry;
  190|    142|}
cairo-surface.c:cairo_list_is_empty:
  345|    284|{
  346|    284|    cairo_list_validate (head);
  347|    284|    return head->next == head;
  348|    284|}
cairo-gstate.c:cairo_list_add:
  212|     71|{
  213|     71|    cairo_list_validate (head);
  214|     71|    cairo_list_validate_is_empty (entry);
  215|     71|    __cairo_list_add (entry, head, head->next);
  216|     71|    cairo_list_validate (head);
  217|     71|}
cairo-gstate.c:__cairo_list_add:
  196|     71|{
  197|     71|    next->prev = entry;
  198|     71|    entry->next = next;
  199|     71|    entry->prev = prev;
  200|     71|    prev->next = entry;
  201|     71|}
cairo-gstate.c:cairo_list_del:
  256|     71|{
  257|     71|    _cairo_list_del (entry);
  258|     71|    cairo_list_init (entry);
  259|     71|}
cairo-gstate.c:_cairo_list_del:
  244|     71|{
  245|     71|    __cairo_list_del (entry->prev, entry->next);
  246|     71|}
cairo-gstate.c:__cairo_list_del:
  237|     71|{
  238|     71|    next->prev = prev;
  239|     71|    prev->next = next;
  240|     71|}
cairo-gstate.c:cairo_list_init:
  187|     71|{
  188|     71|    entry->next = entry;
  189|     71|    entry->prev = entry;
  190|     71|}
cairo-path-fixed.c:cairo_list_init:
  187|     71|{
  188|     71|    entry->next = entry;
  189|     71|    entry->prev = entry;
  190|     71|}

cairo-png.c:_cairo_malloc_ab:
  100|    340|{
  101|    340|    size_t c;
  102|    340|    if (_cairo_mul_size_t_overflow (a, size, &c))
  ------------------
  |  |  223|    340|#define _cairo_mul_size_t_overflow(a, b, c)  __builtin_mul_overflow((size_t)(a), (size_t)(b), (size_t*)(c))
  |  |  ------------------
  |  |  |  Branch (223:46): [True: 0, False: 340]
  |  |  ------------------
  ------------------
  103|      0|	return NULL;
  104|       |
  105|    340|    return _cairo_malloc(c);
  ------------------
  |  |   63|    340|   ((size) != 0 ? malloc(size) : NULL)
  |  |  ------------------
  |  |  |  Branch (63:5): [True: 340, False: 0]
  |  |  ------------------
  ------------------
  106|    340|}
cairo-array.c:_cairo_realloc_ab:
  153|  1.62k|{
  154|  1.62k|    size_t c;
  155|  1.62k|    if (_cairo_mul_size_t_overflow (a, size, &c))
  ------------------
  |  |  223|  1.62k|#define _cairo_mul_size_t_overflow(a, b, c)  __builtin_mul_overflow((size_t)(a), (size_t)(b), (size_t*)(c))
  |  |  ------------------
  |  |  |  Branch (223:46): [True: 0, False: 1.62k]
  |  |  ------------------
  ------------------
  156|      0|	return NULL;
  157|       |
  158|  1.62k|    return realloc(ptr, c);
  159|  1.62k|}
cairo-hash.c:_cairo_calloc_ab:
  125|      1|{
  126|      1|    size_t c;
  127|      1|    if (_cairo_mul_size_t_overflow (a, size, &c))
  ------------------
  |  |  223|      1|#define _cairo_mul_size_t_overflow(a, b, c)  __builtin_mul_overflow((size_t)(a), (size_t)(b), (size_t*)(c))
  |  |  ------------------
  |  |  |  Branch (223:46): [True: 0, False: 1]
  |  |  ------------------
  ------------------
  128|      0|	return NULL;
  129|       |
  130|      1|    return _cairo_calloc(c);
  ------------------
  |  |   79|      1|    ((size) != 0 ? calloc(1,size) : NULL)
  |  |  ------------------
  |  |  |  Branch (79:6): [True: 1, False: 0]
  |  |  ------------------
  ------------------
  131|      1|}

cairo_matrix_init_identity:
   82|    284|{
   83|    284|    cairo_matrix_init (matrix,
   84|    284|		       1, 0,
   85|    284|		       0, 1,
   86|    284|		       0, 0);
   87|    284|}
cairo_matrix_init:
  115|    355|{
  116|    355|    matrix->xx = xx; matrix->yx = yx;
  117|    355|    matrix->xy = xy; matrix->yy = yy;
  118|    355|    matrix->x0 = x0; matrix->y0 = y0;
  119|    355|}
cairo_matrix_init_scale:
  217|     71|{
  218|     71|    cairo_matrix_init (matrix,
  219|     71|		       sx,  0,
  220|     71|		       0, sy,
  221|     71|		       0, 0);
  222|     71|}
_cairo_matrix_has_unity_scale:
  744|     71|{
  745|     71|    if (within_scaling_epsilon(matrix->xy, 0.0) && within_scaling_epsilon(matrix->yx, 0.0)) {
  ------------------
  |  Branch (745:9): [True: 71, False: 0]
  |  Branch (745:52): [True: 71, False: 0]
  ------------------
  746|     71|	return within_scaling_epsilon(fabs(matrix->xx), 1.0) &&
  ------------------
  |  Branch (746:9): [True: 71, False: 0]
  ------------------
  747|     71|	       within_scaling_epsilon(fabs(matrix->yy), 1.0);
  ------------------
  |  Branch (747:9): [True: 71, False: 0]
  ------------------
  748|     71|    } else if (within_scaling_epsilon(matrix->xx, 0.0) && within_scaling_epsilon(matrix->yy, 0.0)) {
  ------------------
  |  Branch (748:16): [True: 0, False: 0]
  |  Branch (748:59): [True: 0, False: 0]
  ------------------
  749|      0|	return within_scaling_epsilon(fabs(matrix->xy), 1.0) &&
  ------------------
  |  Branch (749:9): [True: 0, False: 0]
  ------------------
  750|      0|	       within_scaling_epsilon(fabs(matrix->yx), 1.0);
  ------------------
  |  Branch (750:9): [True: 0, False: 0]
  ------------------
  751|      0|    } else {
  752|      0|	return FALSE;
  ------------------
  |  |  102|      0|#define FALSE 0
  ------------------
  753|      0|    }
  754|     71|}
_cairo_matrix_is_pixel_exact:
  763|     71|{
  764|     71|    cairo_fixed_t x0_fixed, y0_fixed;
  765|       |
  766|     71|    if (! _cairo_matrix_has_unity_scale (matrix))
  ------------------
  |  Branch (766:9): [True: 0, False: 71]
  ------------------
  767|      0|	return FALSE;
  ------------------
  |  |  102|      0|#define FALSE 0
  ------------------
  768|       |
  769|     71|    x0_fixed = _cairo_fixed_from_double (matrix->x0);
  770|     71|    y0_fixed = _cairo_fixed_from_double (matrix->y0);
  771|       |
  772|     71|    return _cairo_fixed_is_integer (x0_fixed) && _cairo_fixed_is_integer (y0_fixed);
  ------------------
  |  Branch (772:12): [True: 71, False: 0]
  |  Branch (772:50): [True: 71, False: 0]
  ------------------
  773|     71|}
_cairo_matrix_is_pixman_translation:
 1053|     71|{
 1054|     71|    double tx, ty;
 1055|       |
 1056|     71|    if (!_cairo_matrix_is_translation (matrix))
  ------------------
  |  Branch (1056:9): [True: 0, False: 71]
  ------------------
 1057|      0|	return FALSE;
  ------------------
  |  |  102|      0|#define FALSE 0
  ------------------
 1058|       |
 1059|     71|    if (matrix->x0 == 0. && matrix->y0 == 0.)
  ------------------
  |  Branch (1059:9): [True: 71, False: 0]
  |  Branch (1059:29): [True: 71, False: 0]
  ------------------
 1060|     71|	return TRUE;
  ------------------
  |  |  106|     71|#define TRUE 1
  ------------------
 1061|       |
 1062|      0|    tx = matrix->x0 + *x_offset;
 1063|      0|    ty = matrix->y0 + *y_offset;
 1064|       |
 1065|      0|    if (filter == CAIRO_FILTER_FAST || filter == CAIRO_FILTER_NEAREST) {
  ------------------
  |  Branch (1065:9): [True: 0, False: 0]
  |  Branch (1065:40): [True: 0, False: 0]
  ------------------
 1066|      0|	tx = _pixman_nearest_sample (tx);
 1067|      0|	ty = _pixman_nearest_sample (ty);
 1068|      0|    } else if (tx != floor (tx) || ty != floor (ty)) {
  ------------------
  |  Branch (1068:16): [True: 0, False: 0]
  |  Branch (1068:36): [True: 0, False: 0]
  ------------------
 1069|      0|	return FALSE;
  ------------------
  |  |  102|      0|#define FALSE 0
  ------------------
 1070|      0|    }
 1071|       |
 1072|      0|    if (fabs (tx) > PIXMAN_MAX_INT || fabs (ty) > PIXMAN_MAX_INT)
  ------------------
  |  |   41|      0|#define PIXMAN_MAX_INT ((pixman_fixed_1 >> 1) - pixman_fixed_e) /* need to ensure deltas also fit */
  |  |  ------------------
  |  |  |  |  126|      0|#define pixman_fixed_1			(pixman_int_to_fixed(1))
  |  |  |  |  ------------------
  |  |  |  |  |  |  130|      0|#define pixman_int_to_fixed(i)		((pixman_fixed_t) ((uint32_t) (i) << 16))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PIXMAN_MAX_INT ((pixman_fixed_1 >> 1) - pixman_fixed_e) /* need to ensure deltas also fit */
  |  |  ------------------
  |  |  |  |  125|      0|#define pixman_fixed_e			((pixman_fixed_t) 1)
  |  |  ------------------
  ------------------
                  if (fabs (tx) > PIXMAN_MAX_INT || fabs (ty) > PIXMAN_MAX_INT)
  ------------------
  |  |   41|      0|#define PIXMAN_MAX_INT ((pixman_fixed_1 >> 1) - pixman_fixed_e) /* need to ensure deltas also fit */
  |  |  ------------------
  |  |  |  |  126|      0|#define pixman_fixed_1			(pixman_int_to_fixed(1))
  |  |  |  |  ------------------
  |  |  |  |  |  |  130|      0|#define pixman_int_to_fixed(i)		((pixman_fixed_t) ((uint32_t) (i) << 16))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PIXMAN_MAX_INT ((pixman_fixed_1 >> 1) - pixman_fixed_e) /* need to ensure deltas also fit */
  |  |  ------------------
  |  |  |  |  125|      0|#define pixman_fixed_e			((pixman_fixed_t) 1)
  |  |  ------------------
  ------------------
  |  Branch (1072:9): [True: 0, False: 0]
  |  Branch (1072:39): [True: 0, False: 0]
  ------------------
 1073|      0|	return FALSE;
  ------------------
  |  |  102|      0|#define FALSE 0
  ------------------
 1074|       |
 1075|      0|    *x_offset = _cairo_lround (tx);
 1076|      0|    *y_offset = _cairo_lround (ty);
 1077|      0|    return TRUE;
  ------------------
  |  |  106|      0|#define TRUE 1
  ------------------
 1078|      0|}
cairo-matrix.c:within_scaling_epsilon:
  732|    284|within_scaling_epsilon(double a, double b) {
  733|    284|    return fabs(a - b) < SCALING_EPSILON;
  ------------------
  |  |  729|    284|#define SCALING_EPSILON _cairo_fixed_to_double(1)
  ------------------
  734|    284|}

_cairo_operator_bounded_by_either:
  469|     71|{
  470|     71|    switch (op) {
  471|     71|    case CAIRO_OPERATOR_OVER:
  ------------------
  |  Branch (471:5): [True: 71, False: 0]
  ------------------
  472|     71|    case CAIRO_OPERATOR_ATOP:
  ------------------
  |  Branch (472:5): [True: 0, False: 71]
  ------------------
  473|     71|    case CAIRO_OPERATOR_DEST:
  ------------------
  |  Branch (473:5): [True: 0, False: 71]
  ------------------
  474|     71|    case CAIRO_OPERATOR_DEST_OVER:
  ------------------
  |  Branch (474:5): [True: 0, False: 71]
  ------------------
  475|     71|    case CAIRO_OPERATOR_DEST_OUT:
  ------------------
  |  Branch (475:5): [True: 0, False: 71]
  ------------------
  476|     71|    case CAIRO_OPERATOR_XOR:
  ------------------
  |  Branch (476:5): [True: 0, False: 71]
  ------------------
  477|     71|    case CAIRO_OPERATOR_ADD:
  ------------------
  |  Branch (477:5): [True: 0, False: 71]
  ------------------
  478|     71|    case CAIRO_OPERATOR_SATURATE:
  ------------------
  |  Branch (478:5): [True: 0, False: 71]
  ------------------
  479|     71|    case CAIRO_OPERATOR_MULTIPLY:
  ------------------
  |  Branch (479:5): [True: 0, False: 71]
  ------------------
  480|     71|    case CAIRO_OPERATOR_SCREEN:
  ------------------
  |  Branch (480:5): [True: 0, False: 71]
  ------------------
  481|     71|    case CAIRO_OPERATOR_OVERLAY:
  ------------------
  |  Branch (481:5): [True: 0, False: 71]
  ------------------
  482|     71|    case CAIRO_OPERATOR_DARKEN:
  ------------------
  |  Branch (482:5): [True: 0, False: 71]
  ------------------
  483|     71|    case CAIRO_OPERATOR_LIGHTEN:
  ------------------
  |  Branch (483:5): [True: 0, False: 71]
  ------------------
  484|     71|    case CAIRO_OPERATOR_COLOR_DODGE:
  ------------------
  |  Branch (484:5): [True: 0, False: 71]
  ------------------
  485|     71|    case CAIRO_OPERATOR_COLOR_BURN:
  ------------------
  |  Branch (485:5): [True: 0, False: 71]
  ------------------
  486|     71|    case CAIRO_OPERATOR_HARD_LIGHT:
  ------------------
  |  Branch (486:5): [True: 0, False: 71]
  ------------------
  487|     71|    case CAIRO_OPERATOR_SOFT_LIGHT:
  ------------------
  |  Branch (487:5): [True: 0, False: 71]
  ------------------
  488|     71|    case CAIRO_OPERATOR_DIFFERENCE:
  ------------------
  |  Branch (488:5): [True: 0, False: 71]
  ------------------
  489|     71|    case CAIRO_OPERATOR_EXCLUSION:
  ------------------
  |  Branch (489:5): [True: 0, False: 71]
  ------------------
  490|     71|    case CAIRO_OPERATOR_HSL_HUE:
  ------------------
  |  Branch (490:5): [True: 0, False: 71]
  ------------------
  491|     71|    case CAIRO_OPERATOR_HSL_SATURATION:
  ------------------
  |  Branch (491:5): [True: 0, False: 71]
  ------------------
  492|     71|    case CAIRO_OPERATOR_HSL_COLOR:
  ------------------
  |  Branch (492:5): [True: 0, False: 71]
  ------------------
  493|     71|    case CAIRO_OPERATOR_HSL_LUMINOSITY:
  ------------------
  |  Branch (493:5): [True: 0, False: 71]
  ------------------
  494|     71|	return CAIRO_OPERATOR_BOUND_BY_MASK | CAIRO_OPERATOR_BOUND_BY_SOURCE;
  495|      0|    case CAIRO_OPERATOR_CLEAR:
  ------------------
  |  Branch (495:5): [True: 0, False: 71]
  ------------------
  496|      0|    case CAIRO_OPERATOR_SOURCE:
  ------------------
  |  Branch (496:5): [True: 0, False: 71]
  ------------------
  497|      0|	return CAIRO_OPERATOR_BOUND_BY_MASK;
  498|      0|    case CAIRO_OPERATOR_OUT:
  ------------------
  |  Branch (498:5): [True: 0, False: 71]
  ------------------
  499|      0|    case CAIRO_OPERATOR_IN:
  ------------------
  |  Branch (499:5): [True: 0, False: 71]
  ------------------
  500|      0|    case CAIRO_OPERATOR_DEST_IN:
  ------------------
  |  Branch (500:5): [True: 0, False: 71]
  ------------------
  501|      0|    case CAIRO_OPERATOR_DEST_ATOP:
  ------------------
  |  Branch (501:5): [True: 0, False: 71]
  ------------------
  502|      0|	return 0;
  503|      0|    default:
  ------------------
  |  Branch (503:5): [True: 0, False: 71]
  ------------------
  504|      0|	ASSERT_NOT_REACHED;
  ------------------
  |  |  140|      0|#define ASSERT_NOT_REACHED		\
  |  |  141|      0|do {					\
  |  |  142|      0|    assert (!"reached");		\
  |  |  143|      0|} while (0)
  |  |  ------------------
  |  |  |  Branch (143:10): [Folded, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (504:2): [Folded, False: 0]
  |  Branch (504:2): [Folded, False: 0]
  ------------------
  505|      0|	return FALSE; /* squelch warning */
  ------------------
  |  |  102|      0|#define FALSE 0
  ------------------
  506|     71|    }
  507|       |
  508|     71|}
_cairo_fopen:
  937|    442|{
  938|    442|    FILE *result;
  939|       |#ifdef _WIN32 /* also defined on x86_64 */
  940|       |    uint16_t *filename_w;
  941|       |    uint16_t *mode_w;
  942|       |    cairo_status_t status;
  943|       |
  944|       |    *file_out = NULL;
  945|       |
  946|       |    if (filename == NULL || mode == NULL) {
  947|       |	errno = EINVAL;
  948|       |	return CAIRO_STATUS_SUCCESS;
  949|       |    }
  950|       |
  951|       |    if ((status = _cairo_utf8_to_utf16 (filename, -1, &filename_w, NULL)) != CAIRO_STATUS_SUCCESS) {
  952|       |	errno = EINVAL;
  953|       |	return status;
  954|       |    }
  955|       |
  956|       |    if ((status = _cairo_utf8_to_utf16 (mode, -1, &mode_w, NULL)) != CAIRO_STATUS_SUCCESS) {
  957|       |	free (filename_w);
  958|       |	errno = EINVAL;
  959|       |	return status;
  960|       |    }
  961|       |
  962|       |    result = _wfopen (filename_w, mode_w);
  963|       |
  964|       |    free (filename_w);
  965|       |    free (mode_w);
  966|       |
  967|       |#else /* Use fopen directly */
  968|       |
  969|    442|#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 7)
  970|       |    /* Glibc 2.7 supports the "e" mode flag that opens the file with O_CLOEXEC.
  971|       |     * this avoid the race condition in the fcntl fallback below. */
  972|       |
  973|    442|    char new_mode[20];
  974|    442|    snprintf (new_mode, sizeof (new_mode), "%s%s", mode, "e");
  975|    442|    result = fopen (filename, new_mode);
  976|       |
  977|       |#else /* fopen "e" not available */
  978|       |
  979|       |    result = fopen (filename, mode);
  980|       |
  981|       |#if defined(HAVE_FCNTL_H) && defined(FD_CLOEXEC)
  982|       |    /* Manually set CLOEXEC */
  983|       |    if (result != NULL) {
  984|       |	int fd = fileno (result);
  985|       |	if (fd != -1) {
  986|       |	    int flags = fcntl (fd, F_GETFD);
  987|       |	    if (flags >= 0)
  988|       |		flags = fcntl (fd, F_SETFD, flags | FD_CLOEXEC);
  989|       |	}
  990|       |    }
  991|       |#endif /* defined(HAVE_FCNTL_H) && defined(FD_CLOEXEC) */
  992|       |
  993|       |#endif /* fopen "e" not available */
  994|       |
  995|    442|#endif /* !_WIN32 */
  996|       |
  997|    442|    *file_out = result;
  998|       |
  999|    442|    return CAIRO_STATUS_SUCCESS;
 1000|    442|}
_cairo_string_hash:
 1118|     71|{
 1119|     71|    const signed char *p = (const signed char *) str;
 1120|     71|    unsigned int h = *p;
 1121|       |
 1122|    710|    for (p += 1; len > 0; len--, p++)
  ------------------
  |  Branch (1122:18): [True: 639, False: 71]
  ------------------
 1123|    639|	h = (h << 5) - h + *p;
 1124|       |
 1125|     71|    return h;
 1126|     71|}
_cairo_intern_string:
 1142|     71|{
 1143|     71|    char *str = (char *) *str_inout;
 1144|     71|    cairo_intern_string_t tmpl, *istring;
 1145|     71|    cairo_status_t status = CAIRO_STATUS_SUCCESS;
 1146|       |
 1147|     71|    if (CAIRO_INJECT_FAULT ())
  ------------------
  |  |   47|     71|#define CAIRO_INJECT_FAULT() 0
  |  |  ------------------
  |  |  |  Branch (47:30): [Folded, False: 71]
  |  |  ------------------
  ------------------
 1148|      0|	return _cairo_error (CAIRO_STATUS_NO_MEMORY);
 1149|       |
 1150|     71|    if (len < 0)
  ------------------
  |  Branch (1150:9): [True: 71, False: 0]
  ------------------
 1151|     71|	len = strlen (str);
 1152|     71|    tmpl.hash_entry.hash = _cairo_string_hash (str, len);
 1153|     71|    tmpl.len = len;
 1154|     71|    tmpl.string = (char *) str;
 1155|       |
 1156|     71|    CAIRO_MUTEX_LOCK (_cairo_intern_string_mutex);
  ------------------
  |  |  175|     71|#define CAIRO_MUTEX_LOCK		CAIRO_MUTEX_IMPL_LOCK
  |  |  ------------------
  |  |  |  |  206|     71|# define CAIRO_MUTEX_IMPL_LOCK(mutex) pthread_mutex_lock (&(mutex))
  |  |  ------------------
  ------------------
 1157|     71|    if (_cairo_intern_string_ht == NULL) {
  ------------------
  |  Branch (1157:9): [True: 1, False: 70]
  ------------------
 1158|      1|	_cairo_intern_string_ht = _cairo_hash_table_create (_intern_string_equal);
 1159|      1|	if (unlikely (_cairo_intern_string_ht == NULL)) {
  ------------------
  |  |  145|      1|#define unlikely(expr) (__builtin_expect (!!(expr), 0))
  |  |  ------------------
  |  |  |  Branch (145:24): [True: 0, False: 1]
  |  |  ------------------
  ------------------
 1160|      0|	    status = _cairo_error (CAIRO_STATUS_NO_MEMORY);
 1161|      0|	    goto BAIL;
 1162|      0|	}
 1163|      1|    }
 1164|       |
 1165|     71|    istring = _cairo_hash_table_lookup (_cairo_intern_string_ht,
 1166|     71|					&tmpl.hash_entry);
 1167|     71|    if (istring == NULL) {
  ------------------
  |  Branch (1167:9): [True: 1, False: 70]
  ------------------
 1168|      1|	istring = _cairo_malloc (sizeof (cairo_intern_string_t) + len + 1);
  ------------------
  |  |   63|      1|   ((size) != 0 ? malloc(size) : NULL)
  |  |  ------------------
  |  |  |  Branch (63:5): [True: 1, False: 0]
  |  |  ------------------
  ------------------
 1169|      1|	if (likely (istring != NULL)) {
  ------------------
  |  |  144|      1|#define likely(expr) (__builtin_expect (!!(expr), 1))
  |  |  ------------------
  |  |  |  Branch (144:22): [True: 1, False: 0]
  |  |  ------------------
  ------------------
 1170|      1|	    istring->hash_entry.hash = tmpl.hash_entry.hash;
 1171|      1|	    istring->len = tmpl.len;
 1172|      1|	    istring->string = (char *) (istring + 1);
 1173|      1|	    memcpy (istring->string, str, len);
 1174|      1|	    istring->string[len] = '\0';
 1175|       |
 1176|      1|	    status = _cairo_hash_table_insert (_cairo_intern_string_ht,
 1177|      1|					       &istring->hash_entry);
 1178|      1|	    if (unlikely (status)) {
  ------------------
  |  |  145|      1|#define unlikely(expr) (__builtin_expect (!!(expr), 0))
  |  |  ------------------
  |  |  |  Branch (145:24): [True: 0, False: 1]
  |  |  ------------------
  ------------------
 1179|      0|		free (istring);
 1180|      0|		goto BAIL;
 1181|      0|	    }
 1182|      1|	} else {
 1183|      0|	    status = _cairo_error (CAIRO_STATUS_NO_MEMORY);
 1184|      0|	    goto BAIL;
 1185|      0|	}
 1186|      1|    }
 1187|       |
 1188|     71|    *str_inout = istring->string;
 1189|       |
 1190|     71|  BAIL:
 1191|     71|    CAIRO_MUTEX_UNLOCK (_cairo_intern_string_mutex);
  ------------------
  |  |  177|     71|#define CAIRO_MUTEX_UNLOCK		CAIRO_MUTEX_IMPL_UNLOCK
  |  |  ------------------
  |  |  |  |  208|     71|# define CAIRO_MUTEX_IMPL_UNLOCK(mutex) pthread_mutex_unlock (&(mutex))
  |  |  ------------------
  ------------------
 1192|     71|    return status;
 1193|     71|}
cairo-misc.c:_intern_string_equal:
 1130|     70|{
 1131|     70|    const cairo_intern_string_t *a = _a;
 1132|     70|    const cairo_intern_string_t *b = _b;
 1133|       |
 1134|     70|    if (a->len != b->len)
  ------------------
  |  Branch (1134:9): [True: 0, False: 70]
  ------------------
 1135|      0|	return FALSE;
  ------------------
  |  |  102|      0|#define FALSE 0
  ------------------
 1136|       |
 1137|     70|    return memcmp (a->string, b->string, a->len) == 0;
 1138|     70|}

_cairo_output_stream_init:
   77|    371|{
   78|    371|    stream->write_func = write_func;
   79|    371|    stream->flush_func = flush_func;
   80|    371|    stream->close_func = close_func;
   81|    371|    stream->position = 0;
   82|    371|    stream->status = CAIRO_STATUS_SUCCESS;
   83|    371|    stream->closed = FALSE;
  ------------------
  |  |  102|    371|#define FALSE 0
  ------------------
   84|    371|}
_cairo_output_stream_fini:
   88|    371|{
   89|    371|    return _cairo_output_stream_close (stream);
   90|    371|}
_cairo_output_stream_close:
  215|    371|{
  216|    371|    cairo_status_t status;
  217|       |
  218|    371|    if (stream->closed)
  ------------------
  |  Branch (218:9): [True: 0, False: 371]
  ------------------
  219|      0|	return stream->status;
  220|       |
  221|    371|    if (stream == &_cairo_output_stream_nil ||
  ------------------
  |  Branch (221:9): [True: 0, False: 371]
  ------------------
  222|    371|	stream == &_cairo_output_stream_nil_write_error)
  ------------------
  |  Branch (222:2): [True: 0, False: 371]
  ------------------
  223|      0|    {
  224|      0|	return stream->status;
  225|      0|    }
  226|       |
  227|    371|    if (stream->close_func) {
  ------------------
  |  Branch (227:9): [True: 371, False: 0]
  ------------------
  228|    371|	status = stream->close_func (stream);
  229|       |	/* Don't overwrite a pre-existing status failure. */
  230|    371|	if (stream->status == CAIRO_STATUS_SUCCESS)
  ------------------
  |  Branch (230:6): [True: 371, False: 0]
  ------------------
  231|    371|	    stream->status = status;
  232|    371|    }
  233|       |
  234|    371|    stream->closed = TRUE;
  ------------------
  |  |  106|    371|#define TRUE 1
  ------------------
  235|       |
  236|    371|    return stream->status;
  237|    371|}
_cairo_output_stream_destroy:
  241|    371|{
  242|    371|    cairo_status_t status;
  243|       |
  244|    371|    assert (stream != NULL);
  ------------------
  |  Branch (244:5): [True: 0, False: 371]
  |  Branch (244:5): [True: 371, False: 0]
  ------------------
  245|       |
  246|    371|    if (stream == &_cairo_output_stream_nil ||
  ------------------
  |  Branch (246:9): [True: 0, False: 371]
  ------------------
  247|    371|	stream == &_cairo_output_stream_nil_write_error)
  ------------------
  |  Branch (247:2): [True: 0, False: 371]
  ------------------
  248|      0|    {
  249|      0|	return stream->status;
  250|      0|    }
  251|       |
  252|    371|    status = _cairo_output_stream_fini (stream);
  253|    371|    free (stream);
  254|       |
  255|    371|    return status;
  256|    371|}
_cairo_output_stream_write:
  261|  1.96M|{
  262|  1.96M|    if (length == 0 || stream->status)
  ------------------
  |  Branch (262:9): [True: 196, False: 1.96M]
  |  Branch (262:24): [True: 0, False: 1.96M]
  ------------------
  263|    196|	return;
  264|       |
  265|  1.96M|    if (stream->closed) {
  ------------------
  |  Branch (265:9): [True: 0, False: 1.96M]
  ------------------
  266|      0|	stream->status = CAIRO_STATUS_WRITE_ERROR;
  267|      0|	return;
  268|      0|    }
  269|       |
  270|  1.96M|    stream->status = stream->write_func (stream, data, length);
  271|  1.96M|    stream->position += length;
  272|  1.96M|}
_cairo_memory_stream_create:
  738|    371|{
  739|    371|    memory_stream_t *stream;
  740|       |
  741|    371|    stream = _cairo_calloc (sizeof *stream);
  ------------------
  |  |   79|    371|    ((size) != 0 ? calloc(1,size) : NULL)
  |  |  ------------------
  |  |  |  Branch (79:6): [True: 371, Folded]
  |  |  ------------------
  ------------------
  742|    371|    if (unlikely (stream == NULL)) {
  ------------------
  |  |  145|    371|#define unlikely(expr) (__builtin_expect (!!(expr), 0))
  |  |  ------------------
  |  |  |  Branch (145:24): [True: 0, False: 371]
  |  |  ------------------
  ------------------
  743|      0|	_cairo_error_throw (CAIRO_STATUS_NO_MEMORY);
  ------------------
  |  |  126|      0|#define _cairo_error_throw(status) do { \
  |  |  127|      0|    cairo_status_t status__ = _cairo_error (status); \
  |  |  128|      0|    (void) status__; \
  |  |  129|      0|} while (0)
  |  |  ------------------
  |  |  |  Branch (129:10): [Folded, False: 0]
  |  |  ------------------
  ------------------
  744|      0|	return (cairo_output_stream_t *) &_cairo_output_stream_nil;
  745|      0|    }
  746|       |
  747|    371|    _cairo_output_stream_init (&stream->base, memory_write, NULL, memory_close);
  748|    371|    _cairo_array_init (&stream->array, 1);
  749|       |
  750|    371|    return &stream->base;
  751|    371|}
_cairo_memory_stream_destroy:
  757|     71|{
  758|     71|    memory_stream_t *stream;
  759|     71|    cairo_status_t status;
  760|       |
  761|     71|    status = abstract_stream->status;
  762|     71|    if (unlikely (status))
  ------------------
  |  |  145|     71|#define unlikely(expr) (__builtin_expect (!!(expr), 0))
  |  |  ------------------
  |  |  |  Branch (145:24): [True: 0, False: 71]
  |  |  ------------------
  ------------------
  763|      0|	return _cairo_output_stream_destroy (abstract_stream);
  764|       |
  765|     71|    stream = (memory_stream_t *) abstract_stream;
  766|       |
  767|     71|    *length_out = _cairo_array_num_elements (&stream->array);
  768|     71|    *data_out = _cairo_calloc (*length_out);
  ------------------
  |  |   79|     71|    ((size) != 0 ? calloc(1,size) : NULL)
  |  |  ------------------
  |  |  |  Branch (79:6): [True: 71, False: 0]
  |  |  ------------------
  ------------------
  769|     71|    if (unlikely (*data_out == NULL)) {
  ------------------
  |  |  145|     71|#define unlikely(expr) (__builtin_expect (!!(expr), 0))
  |  |  ------------------
  |  |  |  Branch (145:24): [True: 0, False: 71]
  |  |  ------------------
  ------------------
  770|      0|	status = _cairo_output_stream_destroy (abstract_stream);
  771|      0|	assert (status == CAIRO_STATUS_SUCCESS);
  ------------------
  |  Branch (771:2): [True: 0, False: 0]
  |  Branch (771:2): [True: 0, False: 0]
  ------------------
  772|      0|	return _cairo_error (CAIRO_STATUS_NO_MEMORY);
  773|      0|    }
  774|     71|    memcpy (*data_out, _cairo_array_index (&stream->array, 0), *length_out);
  775|       |
  776|     71|    return _cairo_output_stream_destroy (abstract_stream);
  777|     71|}
cairo-output-stream.c:memory_write:
  720|  1.96M|{
  721|  1.96M|    memory_stream_t *stream = (memory_stream_t *) base;
  722|       |
  723|  1.96M|    return _cairo_array_append_multiple (&stream->array, data, length);
  724|  1.96M|}
cairo-output-stream.c:memory_close:
  728|    371|{
  729|    371|    memory_stream_t *stream = (memory_stream_t *) base;
  730|       |
  731|    371|    _cairo_array_fini (&stream->array);
  732|       |
  733|    371|    return CAIRO_STATUS_SUCCESS;
  734|    371|}

_cairo_path_fixed_init:
   74|     71|{
   75|     71|    VG (VALGRIND_MAKE_MEM_UNDEFINED (path, sizeof (cairo_path_fixed_t)));
   76|       |
   77|     71|    cairo_list_init (&path->buf.base.link);
   78|       |
   79|     71|    path->buf.base.num_ops = 0;
   80|     71|    path->buf.base.num_points = 0;
   81|     71|    path->buf.base.size_ops = ARRAY_LENGTH (path->buf.op);
  ------------------
  |  |  122|     71|#define ARRAY_LENGTH(__array) ((int) (sizeof (__array) / sizeof (__array[0])))
  ------------------
   82|     71|    path->buf.base.size_points = ARRAY_LENGTH (path->buf.points);
  ------------------
  |  |  122|     71|#define ARRAY_LENGTH(__array) ((int) (sizeof (__array) / sizeof (__array[0])))
  ------------------
   83|     71|    path->buf.base.op = path->buf.op;
   84|     71|    path->buf.base.points = path->buf.points;
   85|       |
   86|     71|    path->current_point.x = 0;
   87|     71|    path->current_point.y = 0;
   88|     71|    path->last_move_point = path->current_point;
   89|       |
   90|     71|    path->has_current_point = FALSE;
  ------------------
  |  |  102|     71|#define FALSE 0
  ------------------
   91|     71|    path->needs_move_to = TRUE;
  ------------------
  |  |  106|     71|#define TRUE 1
  ------------------
   92|     71|    path->has_extents = FALSE;
  ------------------
  |  |  102|     71|#define FALSE 0
  ------------------
   93|     71|    path->has_curve_to = FALSE;
  ------------------
  |  |  102|     71|#define FALSE 0
  ------------------
   94|     71|    path->stroke_is_rectilinear = TRUE;
  ------------------
  |  |  106|     71|#define TRUE 1
  ------------------
   95|     71|    path->fill_is_rectilinear = TRUE;
  ------------------
  |  |  106|     71|#define TRUE 1
  ------------------
   96|     71|    path->fill_maybe_region = TRUE;
  ------------------
  |  |  106|     71|#define TRUE 1
  ------------------
   97|     71|    path->fill_is_empty = TRUE;
  ------------------
  |  |  106|     71|#define TRUE 1
  ------------------
   98|       |
   99|     71|    path->extents.p1.x = path->extents.p1.y = 0;
  100|     71|    path->extents.p2.x = path->extents.p2.y = 0;
  101|     71|}
_cairo_path_fixed_fini:
  340|     71|{
  341|     71|    cairo_path_buf_t *buf;
  342|       |
  343|     71|    buf = cairo_path_buf_next (cairo_path_head (path));
  ------------------
  |  |   66|     71|    cairo_list_entry ((pos__)->link.next, cairo_path_buf_t, link)
  |  |  ------------------
  |  |  |  |   51|     71|	cairo_container_of(ptr, type, member)
  |  |  |  |  ------------------
  |  |  |  |  |  |  130|     71|#define cairo_container_of(ptr, type, member) ({ \
  |  |  |  |  |  |  131|     71|    const __typeof__ (((type *) 0)->member) *mptr__ = (ptr); \
  |  |  |  |  |  |  132|     71|    (type *) ((char *) mptr__ - offsetof (type, member)); \
  |  |  |  |  |  |  133|     71|})
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  344|     71|    while (buf != cairo_path_head (path)) {
  ------------------
  |  |   62|     71|#define cairo_path_head(path__) (&(path__)->buf.base)
  ------------------
  |  Branch (344:12): [True: 0, False: 71]
  ------------------
  345|      0|	cairo_path_buf_t *this = buf;
  346|      0|	buf = cairo_path_buf_next (buf);
  ------------------
  |  |   66|      0|    cairo_list_entry ((pos__)->link.next, cairo_path_buf_t, link)
  |  |  ------------------
  |  |  |  |   51|      0|	cairo_container_of(ptr, type, member)
  |  |  |  |  ------------------
  |  |  |  |  |  |  130|      0|#define cairo_container_of(ptr, type, member) ({ \
  |  |  |  |  |  |  131|      0|    const __typeof__ (((type *) 0)->member) *mptr__ = (ptr); \
  |  |  |  |  |  |  132|      0|    (type *) ((char *) mptr__ - offsetof (type, member)); \
  |  |  |  |  |  |  133|      0|})
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  347|      0|	_cairo_path_buf_destroy (this);
  348|      0|    }
  349|       |
  350|     71|    VG (VALGRIND_MAKE_MEM_UNDEFINED (path, sizeof (cairo_path_fixed_t)));
  351|     71|}

_cairo_pattern_init:
  212|     71|{
  213|       |#if HAVE_VALGRIND
  214|       |    switch (type) {
  215|       |    case CAIRO_PATTERN_TYPE_SOLID:
  216|       |	VALGRIND_MAKE_MEM_UNDEFINED (pattern, sizeof (cairo_solid_pattern_t));
  217|       |	break;
  218|       |    case CAIRO_PATTERN_TYPE_SURFACE:
  219|       |	VALGRIND_MAKE_MEM_UNDEFINED (pattern, sizeof (cairo_surface_pattern_t));
  220|       |	break;
  221|       |    case CAIRO_PATTERN_TYPE_LINEAR:
  222|       |	VALGRIND_MAKE_MEM_UNDEFINED (pattern, sizeof (cairo_linear_pattern_t));
  223|       |	break;
  224|       |    case CAIRO_PATTERN_TYPE_RADIAL:
  225|       |	VALGRIND_MAKE_MEM_UNDEFINED (pattern, sizeof (cairo_radial_pattern_t));
  226|       |	break;
  227|       |    case CAIRO_PATTERN_TYPE_MESH:
  228|       |	VALGRIND_MAKE_MEM_UNDEFINED (pattern, sizeof (cairo_mesh_pattern_t));
  229|       |	break;
  230|       |    case CAIRO_PATTERN_TYPE_RASTER_SOURCE:
  231|       |	break;
  232|       |    }
  233|       |#endif
  234|       |
  235|     71|    pattern->type      = type;
  236|     71|    pattern->status    = CAIRO_STATUS_SUCCESS;
  237|       |
  238|       |    /* Set the reference count to zero for on-stack patterns.
  239|       |     * Callers needs to explicitly increment the count for heap allocations. */
  240|     71|    CAIRO_REFERENCE_COUNT_INIT (&pattern->ref_count, 0);
  ------------------
  |  |   51|     71|#define CAIRO_REFERENCE_COUNT_INIT(RC, VALUE) ((RC)->ref_count = (VALUE))
  ------------------
  241|       |
  242|     71|    _cairo_user_data_array_init (&pattern->user_data);
  243|       |
  244|     71|    if (type == CAIRO_PATTERN_TYPE_SURFACE ||
  ------------------
  |  Branch (244:9): [True: 0, False: 71]
  ------------------
  245|     71|	type == CAIRO_PATTERN_TYPE_RASTER_SOURCE)
  ------------------
  |  Branch (245:2): [True: 71, False: 0]
  ------------------
  246|     71|	pattern->extend = CAIRO_EXTEND_SURFACE_DEFAULT;
  ------------------
  |  |  668|     71|#define CAIRO_EXTEND_SURFACE_DEFAULT CAIRO_EXTEND_NONE
  ------------------
  247|      0|    else
  248|      0|	pattern->extend = CAIRO_EXTEND_GRADIENT_DEFAULT;
  ------------------
  |  |  669|      0|#define CAIRO_EXTEND_GRADIENT_DEFAULT CAIRO_EXTEND_PAD
  ------------------
  249|       |
  250|     71|    pattern->filter    = CAIRO_FILTER_DEFAULT;
  ------------------
  |  |  670|     71|#define CAIRO_FILTER_DEFAULT CAIRO_FILTER_GOOD
  ------------------
  251|     71|    pattern->opacity   = 1.0;
  252|       |
  253|     71|    pattern->has_component_alpha = FALSE;
  ------------------
  |  |  102|     71|#define FALSE 0
  ------------------
  254|     71|    pattern->is_foreground_marker = FALSE;
  ------------------
  |  |  102|     71|#define FALSE 0
  ------------------
  255|       |
  256|     71|    pattern->dither    = CAIRO_DITHER_DEFAULT;
  257|       |
  258|     71|    cairo_matrix_init_identity (&pattern->matrix);
  259|       |
  260|     71|    cairo_list_init (&pattern->observers);
  261|     71|}
_cairo_pattern_init_static_copy:
  389|    142|{
  390|    142|    int size;
  391|       |
  392|    142|    assert (other->status == CAIRO_STATUS_SUCCESS);
  ------------------
  |  Branch (392:5): [True: 0, False: 142]
  |  Branch (392:5): [True: 142, False: 0]
  ------------------
  393|       |
  394|    142|    switch (other->type) {
  395|      0|    default:
  ------------------
  |  Branch (395:5): [True: 0, False: 142]
  ------------------
  396|      0|	ASSERT_NOT_REACHED;
  ------------------
  |  |  140|      0|#define ASSERT_NOT_REACHED		\
  |  |  141|      0|do {					\
  |  |  142|      0|    assert (!"reached");		\
  |  |  143|      0|} while (0)
  |  |  ------------------
  |  |  |  Branch (143:10): [Folded, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (396:2): [Folded, False: 0]
  |  Branch (396:2): [Folded, False: 0]
  ------------------
  397|      0|    case CAIRO_PATTERN_TYPE_SOLID:
  ------------------
  |  Branch (397:5): [True: 0, False: 142]
  ------------------
  398|      0|	size = sizeof (cairo_solid_pattern_t);
  399|      0|	break;
  400|      0|    case CAIRO_PATTERN_TYPE_SURFACE:
  ------------------
  |  Branch (400:5): [True: 0, False: 142]
  ------------------
  401|      0|	size = sizeof (cairo_surface_pattern_t);
  402|      0|	break;
  403|      0|    case CAIRO_PATTERN_TYPE_LINEAR:
  ------------------
  |  Branch (403:5): [True: 0, False: 142]
  ------------------
  404|      0|	size = sizeof (cairo_linear_pattern_t);
  405|      0|	break;
  406|      0|    case CAIRO_PATTERN_TYPE_RADIAL:
  ------------------
  |  Branch (406:5): [True: 0, False: 142]
  ------------------
  407|      0|	size = sizeof (cairo_radial_pattern_t);
  408|      0|	break;
  409|      0|    case CAIRO_PATTERN_TYPE_MESH:
  ------------------
  |  Branch (409:5): [True: 0, False: 142]
  ------------------
  410|      0|	size = sizeof (cairo_mesh_pattern_t);
  411|      0|	break;
  412|    142|    case CAIRO_PATTERN_TYPE_RASTER_SOURCE:
  ------------------
  |  Branch (412:5): [True: 142, False: 0]
  ------------------
  413|    142|	size = sizeof (cairo_raster_source_pattern_t);
  414|    142|	break;
  415|    142|    }
  416|       |
  417|    142|    memcpy (pattern, other, size);
  418|       |
  419|    142|    CAIRO_REFERENCE_COUNT_INIT (&pattern->ref_count, 0);
  ------------------
  |  |   51|    142|#define CAIRO_REFERENCE_COUNT_INIT(RC, VALUE) ((RC)->ref_count = (VALUE))
  ------------------
  420|    142|    _cairo_user_data_array_init (&pattern->user_data);
  421|    142|    cairo_list_init (&pattern->observers);
  422|    142|}
_cairo_pattern_fini:
  456|     71|{
  457|     71|    _cairo_user_data_array_fini (&pattern->user_data);
  458|       |
  459|     71|    switch (pattern->type) {
  ------------------
  |  Branch (459:13): [True: 71, False: 0]
  ------------------
  460|      0|    case CAIRO_PATTERN_TYPE_SOLID:
  ------------------
  |  Branch (460:5): [True: 0, False: 71]
  ------------------
  461|      0|	break;
  462|      0|    case CAIRO_PATTERN_TYPE_SURFACE: {
  ------------------
  |  Branch (462:5): [True: 0, False: 71]
  ------------------
  463|      0|	cairo_surface_pattern_t *surface_pattern =
  464|      0|	    (cairo_surface_pattern_t *) pattern;
  465|       |
  466|      0|	cairo_surface_destroy (surface_pattern->surface);
  467|      0|    } break;
  468|      0|    case CAIRO_PATTERN_TYPE_LINEAR:
  ------------------
  |  Branch (468:5): [True: 0, False: 71]
  ------------------
  469|      0|    case CAIRO_PATTERN_TYPE_RADIAL: {
  ------------------
  |  Branch (469:5): [True: 0, False: 71]
  ------------------
  470|      0|	cairo_gradient_pattern_t *gradient =
  471|      0|	    (cairo_gradient_pattern_t *) pattern;
  472|       |
  473|      0|	if (gradient->stops && gradient->stops != gradient->stops_embedded)
  ------------------
  |  Branch (473:6): [True: 0, False: 0]
  |  Branch (473:25): [True: 0, False: 0]
  ------------------
  474|      0|	    free (gradient->stops);
  475|      0|    } break;
  476|      0|    case CAIRO_PATTERN_TYPE_MESH: {
  ------------------
  |  Branch (476:5): [True: 0, False: 71]
  ------------------
  477|      0|	cairo_mesh_pattern_t *mesh =
  478|      0|	    (cairo_mesh_pattern_t *) pattern;
  479|       |
  480|      0|	_cairo_array_fini (&mesh->patches);
  481|      0|    } break;
  482|     71|    case CAIRO_PATTERN_TYPE_RASTER_SOURCE:
  ------------------
  |  Branch (482:5): [True: 71, False: 0]
  ------------------
  483|     71|	_cairo_raster_source_pattern_finish (pattern);
  484|     71|	break;
  485|     71|    }
  486|       |
  487|       |#if HAVE_VALGRIND
  488|       |    switch (pattern->type) {
  489|       |    case CAIRO_PATTERN_TYPE_SOLID:
  490|       |	VALGRIND_MAKE_MEM_UNDEFINED (pattern, sizeof (cairo_solid_pattern_t));
  491|       |	break;
  492|       |    case CAIRO_PATTERN_TYPE_SURFACE:
  493|       |	VALGRIND_MAKE_MEM_UNDEFINED (pattern, sizeof (cairo_surface_pattern_t));
  494|       |	break;
  495|       |    case CAIRO_PATTERN_TYPE_LINEAR:
  496|       |	VALGRIND_MAKE_MEM_UNDEFINED (pattern, sizeof (cairo_linear_pattern_t));
  497|       |	break;
  498|       |    case CAIRO_PATTERN_TYPE_RADIAL:
  499|       |	VALGRIND_MAKE_MEM_UNDEFINED (pattern, sizeof (cairo_radial_pattern_t));
  500|       |	break;
  501|       |    case CAIRO_PATTERN_TYPE_MESH:
  502|       |	VALGRIND_MAKE_MEM_UNDEFINED (pattern, sizeof (cairo_mesh_pattern_t));
  503|       |	break;
  504|       |    case CAIRO_PATTERN_TYPE_RASTER_SOURCE:
  505|       |	break;
  506|       |    }
  507|       |#endif
  508|     71|}
cairo_pattern_reference:
 1088|     71|{
 1089|     71|    if (pattern == NULL ||
  ------------------
  |  Branch (1089:9): [True: 0, False: 71]
  ------------------
 1090|     71|	    CAIRO_REFERENCE_COUNT_IS_INVALID (&pattern->ref_count))
  ------------------
  |  |   58|     71|#define CAIRO_REFERENCE_COUNT_IS_INVALID(RC) (CAIRO_REFERENCE_COUNT_GET_VALUE (RC) == CAIRO_REFERENCE_COUNT_INVALID_VALUE)
  |  |  ------------------
  |  |  |  |   53|     71|#define CAIRO_REFERENCE_COUNT_GET_VALUE(RC) _cairo_atomic_int_get (&(RC)->ref_count)
  |  |  ------------------
  |  |               #define CAIRO_REFERENCE_COUNT_IS_INVALID(RC) (CAIRO_REFERENCE_COUNT_GET_VALUE (RC) == CAIRO_REFERENCE_COUNT_INVALID_VALUE)
  |  |  ------------------
  |  |  |  |   55|     71|#define CAIRO_REFERENCE_COUNT_INVALID_VALUE ((int) -1)
  |  |  ------------------
  |  |  |  Branch (58:46): [True: 0, False: 71]
  |  |  ------------------
  ------------------
 1091|      0|	return pattern;
 1092|       |
 1093|     71|    assert (CAIRO_REFERENCE_COUNT_HAS_REFERENCE (&pattern->ref_count));
  ------------------
  |  Branch (1093:5): [True: 0, False: 71]
  |  Branch (1093:5): [True: 71, False: 0]
  ------------------
 1094|       |
 1095|     71|    _cairo_reference_count_inc (&pattern->ref_count);
  ------------------
  |  |   47|     71|#define _cairo_reference_count_inc(RC) _cairo_atomic_int_inc (&(RC)->ref_count)
  |  |  ------------------
  |  |  |  |   83|     71|# define _cairo_atomic_int_inc(x) ((void) atomic_fetch_add_explicit(x, 1, memory_order_seq_cst))
  |  |  ------------------
  ------------------
 1096|       |
 1097|     71|    return pattern;
 1098|     71|}
cairo_pattern_destroy:
 1148|    213|{
 1149|    213|    cairo_pattern_type_t type;
 1150|       |
 1151|    213|    if (pattern == NULL ||
  ------------------
  |  Branch (1151:9): [True: 0, False: 213]
  ------------------
 1152|    213|	    CAIRO_REFERENCE_COUNT_IS_INVALID (&pattern->ref_count))
  ------------------
  |  |   58|    213|#define CAIRO_REFERENCE_COUNT_IS_INVALID(RC) (CAIRO_REFERENCE_COUNT_GET_VALUE (RC) == CAIRO_REFERENCE_COUNT_INVALID_VALUE)
  |  |  ------------------
  |  |  |  |   53|    213|#define CAIRO_REFERENCE_COUNT_GET_VALUE(RC) _cairo_atomic_int_get (&(RC)->ref_count)
  |  |  ------------------
  |  |               #define CAIRO_REFERENCE_COUNT_IS_INVALID(RC) (CAIRO_REFERENCE_COUNT_GET_VALUE (RC) == CAIRO_REFERENCE_COUNT_INVALID_VALUE)
  |  |  ------------------
  |  |  |  |   55|    213|#define CAIRO_REFERENCE_COUNT_INVALID_VALUE ((int) -1)
  |  |  ------------------
  |  |  |  Branch (58:46): [True: 71, False: 142]
  |  |  ------------------
  ------------------
 1153|     71|	return;
 1154|       |
 1155|    213|    assert (CAIRO_REFERENCE_COUNT_HAS_REFERENCE (&pattern->ref_count));
  ------------------
  |  Branch (1155:5): [True: 0, False: 142]
  |  Branch (1155:5): [True: 142, False: 0]
  ------------------
 1156|       |
 1157|    142|    if (! _cairo_reference_count_dec_and_test (&pattern->ref_count))
  ------------------
  |  |   49|    142|#define _cairo_reference_count_dec_and_test(RC) _cairo_atomic_int_dec_and_test (&(RC)->ref_count)
  |  |  ------------------
  |  |  |  |   85|    142|# define _cairo_atomic_int_dec_and_test(x) (atomic_fetch_sub_explicit(x, 1, memory_order_seq_cst) == 1)
  |  |  ------------------
  ------------------
  |  Branch (1157:9): [True: 71, False: 71]
  ------------------
 1158|     71|	return;
 1159|       |
 1160|     71|    type = pattern->type;
 1161|     71|    _cairo_pattern_fini (pattern);
 1162|       |
 1163|       |    /* maintain a small cache of freed patterns */
 1164|     71|    if (type < ARRAY_LENGTH (freed_pattern_pool))
  ------------------
  |  |  122|     71|#define ARRAY_LENGTH(__array) ((int) (sizeof (__array) / sizeof (__array[0])))
  ------------------
  |  Branch (1164:9): [True: 0, False: 71]
  ------------------
 1165|      0|	_freed_pool_put (&freed_pattern_pool[type], pattern);
 1166|     71|    else
 1167|     71|	free (pattern);
 1168|     71|}
_cairo_pattern_is_opaque:
 3407|     71|{
 3408|     71|    const cairo_pattern_union_t *pattern;
 3409|       |
 3410|     71|    if (abstract_pattern->has_component_alpha)
  ------------------
  |  Branch (3410:9): [True: 0, False: 71]
  ------------------
 3411|      0|	return FALSE;
  ------------------
  |  |  102|      0|#define FALSE 0
  ------------------
 3412|       |
 3413|     71|    pattern = (cairo_pattern_union_t *) abstract_pattern;
 3414|     71|    switch (pattern->base.type) {
  ------------------
  |  Branch (3414:13): [True: 71, False: 0]
  ------------------
 3415|      0|    case CAIRO_PATTERN_TYPE_SOLID:
  ------------------
  |  Branch (3415:5): [True: 0, False: 71]
  ------------------
 3416|      0|	return _cairo_pattern_is_opaque_solid (abstract_pattern);
 3417|      0|    case CAIRO_PATTERN_TYPE_SURFACE:
  ------------------
  |  Branch (3417:5): [True: 0, False: 71]
  ------------------
 3418|      0|	return _surface_is_opaque (&pattern->surface, sample);
 3419|     71|    case CAIRO_PATTERN_TYPE_RASTER_SOURCE:
  ------------------
  |  Branch (3419:5): [True: 71, False: 0]
  ------------------
 3420|     71|	return _raster_source_is_opaque (&pattern->raster_source, sample);
 3421|      0|    case CAIRO_PATTERN_TYPE_LINEAR:
  ------------------
  |  Branch (3421:5): [True: 0, False: 71]
  ------------------
 3422|      0|    case CAIRO_PATTERN_TYPE_RADIAL:
  ------------------
  |  Branch (3422:5): [True: 0, False: 71]
  ------------------
 3423|      0|	return _gradient_is_opaque (&pattern->gradient.base, sample);
 3424|      0|    case CAIRO_PATTERN_TYPE_MESH:
  ------------------
  |  Branch (3424:5): [True: 0, False: 71]
  ------------------
 3425|      0|	return FALSE;
  ------------------
  |  |  102|      0|#define FALSE 0
  ------------------
 3426|     71|    }
 3427|       |
 3428|      0|    ASSERT_NOT_REACHED;
  ------------------
  |  |  140|      0|#define ASSERT_NOT_REACHED		\
  |  |  141|      0|do {					\
  |  |  142|      0|    assert (!"reached");		\
  |  |  143|      0|} while (0)
  |  |  ------------------
  |  |  |  Branch (143:10): [Folded, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (3428:5): [Folded, False: 0]
  |  Branch (3428:5): [Folded, False: 0]
  ------------------
 3429|      0|    return FALSE;
  ------------------
  |  |  102|      0|#define FALSE 0
  ------------------
 3430|      0|}
_cairo_pattern_is_clear:
 3434|    142|{
 3435|    142|    const cairo_pattern_union_t *pattern;
 3436|       |
 3437|    142|    if (abstract_pattern->has_component_alpha)
  ------------------
  |  Branch (3437:9): [True: 0, False: 142]
  ------------------
 3438|      0|	return FALSE;
  ------------------
  |  |  102|      0|#define FALSE 0
  ------------------
 3439|       |
 3440|    142|    pattern = (cairo_pattern_union_t *) abstract_pattern;
 3441|    142|    switch (abstract_pattern->type) {
  ------------------
  |  Branch (3441:13): [True: 142, False: 0]
  ------------------
 3442|      0|    case CAIRO_PATTERN_TYPE_SOLID:
  ------------------
  |  Branch (3442:5): [True: 0, False: 142]
  ------------------
 3443|      0|	return CAIRO_COLOR_IS_CLEAR (&pattern->solid.color);
  ------------------
  |  |  156|      0|#define CAIRO_COLOR_IS_CLEAR(color) CAIRO_ALPHA_SHORT_IS_CLEAR ((color)->alpha_short)
  |  |  ------------------
  |  |  |  |  150|      0|#define CAIRO_ALPHA_SHORT_IS_CLEAR(alpha) ((alpha) <= 0x00ff)
  |  |  ------------------
  ------------------
 3444|      0|    case CAIRO_PATTERN_TYPE_SURFACE:
  ------------------
  |  Branch (3444:5): [True: 0, False: 142]
  ------------------
 3445|      0|	return _surface_is_clear (&pattern->surface);
 3446|    142|    case CAIRO_PATTERN_TYPE_RASTER_SOURCE:
  ------------------
  |  Branch (3446:5): [True: 142, False: 0]
  ------------------
 3447|    142|	return _raster_source_is_clear (&pattern->raster_source);
 3448|      0|    case CAIRO_PATTERN_TYPE_LINEAR:
  ------------------
  |  Branch (3448:5): [True: 0, False: 142]
  ------------------
 3449|      0|    case CAIRO_PATTERN_TYPE_RADIAL:
  ------------------
  |  Branch (3449:5): [True: 0, False: 142]
  ------------------
 3450|      0|	return _gradient_is_clear (&pattern->gradient.base, NULL);
 3451|      0|    case CAIRO_PATTERN_TYPE_MESH:
  ------------------
  |  Branch (3451:5): [True: 0, False: 142]
  ------------------
 3452|      0|	return _mesh_is_clear (&pattern->mesh);
 3453|    142|    }
 3454|       |
 3455|      0|    ASSERT_NOT_REACHED;
  ------------------
  |  |  140|      0|#define ASSERT_NOT_REACHED		\
  |  |  141|      0|do {					\
  |  |  142|      0|    assert (!"reached");		\
  |  |  143|      0|} while (0)
  |  |  ------------------
  |  |  |  Branch (143:10): [Folded, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (3455:5): [Folded, False: 0]
  |  Branch (3455:5): [Folded, False: 0]
  ------------------
 3456|      0|    return FALSE;
  ------------------
  |  |  102|      0|#define FALSE 0
  ------------------
 3457|      0|}
_cairo_pattern_analyze_filter:
 3489|     71|{
 3490|     71|    switch (pattern->filter) {
 3491|     71|    case CAIRO_FILTER_GOOD:
  ------------------
  |  Branch (3491:5): [True: 71, False: 0]
  ------------------
 3492|     71|    case CAIRO_FILTER_BEST:
  ------------------
  |  Branch (3492:5): [True: 0, False: 71]
  ------------------
 3493|     71|    case CAIRO_FILTER_BILINEAR:
  ------------------
  |  Branch (3493:5): [True: 0, False: 71]
  ------------------
 3494|     71|    case CAIRO_FILTER_FAST:
  ------------------
  |  Branch (3494:5): [True: 0, False: 71]
  ------------------
 3495|       |	/* If source pixels map 1:1 onto destination pixels, we do
 3496|       |	 * not need to filter (and do not want to filter, since it
 3497|       |	 * will cause blurriness)
 3498|       |	 */
 3499|     71|	if (_cairo_matrix_is_pixel_exact (&pattern->matrix)) {
  ------------------
  |  Branch (3499:6): [True: 71, False: 0]
  ------------------
 3500|     71|	    return CAIRO_FILTER_NEAREST;
 3501|     71|	} else {
 3502|       |	    /* Use BILINEAR for any scale greater than .75 instead
 3503|       |	     * of GOOD. For scales of 1 and larger this is identical,
 3504|       |	     * for the smaller sizes it was judged that the artifacts
 3505|       |	     * were not worse than the artifacts from a box filer.
 3506|       |	     * BILINEAR can also be used if the scale is exactly .5
 3507|       |	     * and the translation in that direction is an integer.
 3508|       |	     */
 3509|      0|	    if (pattern->filter == CAIRO_FILTER_GOOD &&
  ------------------
  |  Branch (3509:10): [True: 0, False: 0]
  ------------------
 3510|      0|		use_bilinear (pattern->matrix.xx, pattern->matrix.xy,
  ------------------
  |  Branch (3510:3): [True: 0, False: 0]
  ------------------
 3511|      0|			      pattern->matrix.x0) &&
 3512|      0|		use_bilinear (pattern->matrix.yx, pattern->matrix.yy,
  ------------------
  |  Branch (3512:3): [True: 0, False: 0]
  ------------------
 3513|      0|			      pattern->matrix.y0))
 3514|      0|		return CAIRO_FILTER_BILINEAR;
 3515|      0|	}
 3516|      0|	break;
 3517|       |
 3518|      0|    case CAIRO_FILTER_NEAREST:
  ------------------
  |  Branch (3518:5): [True: 0, False: 71]
  ------------------
 3519|      0|    case CAIRO_FILTER_GAUSSIAN:
  ------------------
  |  Branch (3519:5): [True: 0, False: 71]
  ------------------
 3520|      0|    default:
  ------------------
  |  Branch (3520:5): [True: 0, False: 71]
  ------------------
 3521|      0|	break;
 3522|     71|    }
 3523|       |
 3524|      0|    return pattern->filter;
 3525|     71|}
_cairo_pattern_sampled_area:
 3559|     71|{
 3560|     71|    double x1, x2, y1, y2;
 3561|     71|    double padx, pady;
 3562|       |
 3563|       |    /* Assume filters are interpolating, which means identity
 3564|       |       cannot change the image */
 3565|     71|    if (_cairo_matrix_is_identity (&pattern->matrix)) {
  ------------------
  |  Branch (3565:9): [True: 71, False: 0]
  ------------------
 3566|     71|	*sample = *extents;
 3567|     71|	return;
 3568|     71|    }
 3569|       |
 3570|       |    /* Transform the centers of the corner pixels */
 3571|      0|    x1 = extents->x + 0.5;
 3572|      0|    y1 = extents->y + 0.5;
 3573|      0|    x2 = x1 + (extents->width - 1);
 3574|      0|    y2 = y1 + (extents->height - 1);
 3575|      0|    _cairo_matrix_transform_bounding_box (&pattern->matrix,
 3576|      0|					  &x1, &y1, &x2, &y2,
 3577|      0|					  NULL);
 3578|       |
 3579|       |    /* How far away from center will it actually sample?
 3580|       |     * This is the distance from a transformed pixel center to the
 3581|       |     * furthest sample of reasonable size.
 3582|       |     */
 3583|      0|    switch (pattern->filter) {
 3584|      0|    case CAIRO_FILTER_NEAREST:
  ------------------
  |  Branch (3584:5): [True: 0, False: 0]
  ------------------
 3585|      0|    case CAIRO_FILTER_FAST:
  ------------------
  |  Branch (3585:5): [True: 0, False: 0]
  ------------------
 3586|       |	/* Correct value is zero, but when the sample is on an integer
 3587|       |	 * it is unknown if the backend will sample the pixel to the
 3588|       |	 * left or right. This value makes it include both possible pixels.
 3589|       |	 */
 3590|      0|	padx = pady = 0.004;
 3591|      0|	break;
 3592|      0|    case CAIRO_FILTER_BILINEAR:
  ------------------
  |  Branch (3592:5): [True: 0, False: 0]
  ------------------
 3593|      0|    case CAIRO_FILTER_GAUSSIAN:
  ------------------
  |  Branch (3593:5): [True: 0, False: 0]
  ------------------
 3594|      0|    default:
  ------------------
  |  Branch (3594:5): [True: 0, False: 0]
  ------------------
 3595|       |	/* Correct value is .5 */
 3596|      0|	padx = pady = 0.495;
 3597|      0|	break;
 3598|      0|    case CAIRO_FILTER_GOOD:
  ------------------
  |  Branch (3598:5): [True: 0, False: 0]
  ------------------
 3599|       |	/* Correct value is max(width,1)*.5 */
 3600|      0|	padx = _cairo_hypot (pattern->matrix.xx, pattern->matrix.xy);
 3601|      0|	if (padx <= 1.0) padx = 0.495;
  ------------------
  |  Branch (3601:6): [True: 0, False: 0]
  ------------------
 3602|      0|	else if (padx >= 16.0) padx = 7.92;
  ------------------
  |  Branch (3602:11): [True: 0, False: 0]
  ------------------
 3603|      0|	else padx *= 0.495;
 3604|      0|	pady = _cairo_hypot (pattern->matrix.yx, pattern->matrix.yy);
 3605|      0|	if (pady <= 1.0) pady = 0.495;
  ------------------
  |  Branch (3605:6): [True: 0, False: 0]
  ------------------
 3606|      0|	else if (pady >= 16.0) pady = 7.92;
  ------------------
  |  Branch (3606:11): [True: 0, False: 0]
  ------------------
 3607|      0|	else pady *= 0.495;
 3608|      0|	break;
 3609|      0|    case CAIRO_FILTER_BEST:
  ------------------
  |  Branch (3609:5): [True: 0, False: 0]
  ------------------
 3610|       |	/* Correct value is width*2 */
 3611|      0|	padx = _cairo_hypot (pattern->matrix.xx, pattern->matrix.xy) * 1.98;
 3612|      0|	if (padx > 7.92) padx = 7.92;
  ------------------
  |  Branch (3612:6): [True: 0, False: 0]
  ------------------
 3613|      0|	pady = _cairo_hypot (pattern->matrix.yx, pattern->matrix.yy) * 1.98;
 3614|      0|	if (pady > 7.92) pady = 7.92;
  ------------------
  |  Branch (3614:6): [True: 0, False: 0]
  ------------------
 3615|      0|	break;
 3616|      0|    }
 3617|       |
 3618|       |    /* round furthest samples to edge of pixels */
 3619|      0|    x1 = floor (x1 - padx);
 3620|      0|    if (x1 < CAIRO_RECT_INT_MIN) x1 = CAIRO_RECT_INT_MIN;
  ------------------
  |  |  315|      0|#define CAIRO_RECT_INT_MIN (INT_MIN >> CAIRO_FIXED_FRAC_BITS)
  |  |  ------------------
  |  |  |  |   62|      0|#define CAIRO_FIXED_FRAC_BITS	8
  |  |  ------------------
  ------------------
                  if (x1 < CAIRO_RECT_INT_MIN) x1 = CAIRO_RECT_INT_MIN;
  ------------------
  |  |  315|      0|#define CAIRO_RECT_INT_MIN (INT_MIN >> CAIRO_FIXED_FRAC_BITS)
  |  |  ------------------
  |  |  |  |   62|      0|#define CAIRO_FIXED_FRAC_BITS	8
  |  |  ------------------
  ------------------
  |  Branch (3620:9): [True: 0, False: 0]
  ------------------
 3621|      0|    sample->x = x1;
 3622|       |
 3623|      0|    y1 = floor (y1 - pady);
 3624|      0|    if (y1 < CAIRO_RECT_INT_MIN) y1 = CAIRO_RECT_INT_MIN;
  ------------------
  |  |  315|      0|#define CAIRO_RECT_INT_MIN (INT_MIN >> CAIRO_FIXED_FRAC_BITS)
  |  |  ------------------
  |  |  |  |   62|      0|#define CAIRO_FIXED_FRAC_BITS	8
  |  |  ------------------
  ------------------
                  if (y1 < CAIRO_RECT_INT_MIN) y1 = CAIRO_RECT_INT_MIN;
  ------------------
  |  |  315|      0|#define CAIRO_RECT_INT_MIN (INT_MIN >> CAIRO_FIXED_FRAC_BITS)
  |  |  ------------------
  |  |  |  |   62|      0|#define CAIRO_FIXED_FRAC_BITS	8
  |  |  ------------------
  ------------------
  |  Branch (3624:9): [True: 0, False: 0]
  ------------------
 3625|      0|    sample->y = y1;
 3626|       |
 3627|      0|    x2 = floor (x2 + padx) + 1.0;
 3628|      0|    if (x2 > CAIRO_RECT_INT_MAX) x2 = CAIRO_RECT_INT_MAX;
  ------------------
  |  |  316|      0|#define CAIRO_RECT_INT_MAX (INT_MAX >> CAIRO_FIXED_FRAC_BITS)
  |  |  ------------------
  |  |  |  |   62|      0|#define CAIRO_FIXED_FRAC_BITS	8
  |  |  ------------------
  ------------------
                  if (x2 > CAIRO_RECT_INT_MAX) x2 = CAIRO_RECT_INT_MAX;
  ------------------
  |  |  316|      0|#define CAIRO_RECT_INT_MAX (INT_MAX >> CAIRO_FIXED_FRAC_BITS)
  |  |  ------------------
  |  |  |  |   62|      0|#define CAIRO_FIXED_FRAC_BITS	8
  |  |  ------------------
  ------------------
  |  Branch (3628:9): [True: 0, False: 0]
  ------------------
 3629|      0|    sample->width = x2 - x1;
 3630|       |
 3631|      0|    y2 = floor (y2 + pady) + 1.0;
 3632|      0|    if (y2 > CAIRO_RECT_INT_MAX) y2 = CAIRO_RECT_INT_MAX;
  ------------------
  |  |  316|      0|#define CAIRO_RECT_INT_MAX (INT_MAX >> CAIRO_FIXED_FRAC_BITS)
  |  |  ------------------
  |  |  |  |   62|      0|#define CAIRO_FIXED_FRAC_BITS	8
  |  |  ------------------
  ------------------
                  if (y2 > CAIRO_RECT_INT_MAX) y2 = CAIRO_RECT_INT_MAX;
  ------------------
  |  |  316|      0|#define CAIRO_RECT_INT_MAX (INT_MAX >> CAIRO_FIXED_FRAC_BITS)
  |  |  ------------------
  |  |  |  |   62|      0|#define CAIRO_FIXED_FRAC_BITS	8
  |  |  ------------------
  ------------------
  |  Branch (3632:9): [True: 0, False: 0]
  ------------------
 3633|      0|    sample->height = y2 - y1;
 3634|      0|}
_cairo_pattern_get_extents:
 3655|     71|{
 3656|     71|    double x1, y1, x2, y2;
 3657|     71|    int ix1, ix2, iy1, iy2;
 3658|     71|    cairo_bool_t round_x = FALSE;
  ------------------
  |  |  102|     71|#define FALSE 0
  ------------------
 3659|     71|    cairo_bool_t round_y = FALSE;
  ------------------
  |  |  102|     71|#define FALSE 0
  ------------------
 3660|       |
 3661|     71|    switch (pattern->type) {
 3662|      0|    case CAIRO_PATTERN_TYPE_SOLID:
  ------------------
  |  Branch (3662:5): [True: 0, False: 71]
  ------------------
 3663|      0|	goto UNBOUNDED;
 3664|       |
 3665|      0|    case CAIRO_PATTERN_TYPE_SURFACE:
  ------------------
  |  Branch (3665:5): [True: 0, False: 71]
  ------------------
 3666|      0|	{
 3667|      0|	    cairo_rectangle_int_t surface_extents;
 3668|      0|	    const cairo_surface_pattern_t *surface_pattern =
 3669|      0|		(const cairo_surface_pattern_t *) pattern;
 3670|      0|	    cairo_surface_t *surface = surface_pattern->surface;
 3671|       |
 3672|      0|	    if (! _cairo_surface_get_extents (surface, &surface_extents))
  ------------------
  |  Branch (3672:10): [True: 0, False: 0]
  ------------------
 3673|      0|		goto UNBOUNDED;
 3674|       |
 3675|      0|	    if (surface_extents.width == 0 || surface_extents.height == 0)
  ------------------
  |  Branch (3675:10): [True: 0, False: 0]
  |  Branch (3675:40): [True: 0, False: 0]
  ------------------
 3676|      0|		goto EMPTY;
 3677|       |
 3678|      0|	    if (pattern->extend != CAIRO_EXTEND_NONE)
  ------------------
  |  Branch (3678:10): [True: 0, False: 0]
  ------------------
 3679|      0|		goto UNBOUNDED;
 3680|       |
 3681|      0|	    x1 = surface_extents.x;
 3682|      0|	    y1 = surface_extents.y;
 3683|      0|	    x2 = surface_extents.x + (int) surface_extents.width;
 3684|      0|	    y2 = surface_extents.y + (int) surface_extents.height;
 3685|       |
 3686|      0|	    goto HANDLE_FILTER;
 3687|      0|	}
 3688|      0|	break;
 3689|       |
 3690|     71|    case CAIRO_PATTERN_TYPE_RASTER_SOURCE:
  ------------------
  |  Branch (3690:5): [True: 71, False: 0]
  ------------------
 3691|     71|	{
 3692|     71|	    const cairo_raster_source_pattern_t *raster =
 3693|     71|		(const cairo_raster_source_pattern_t *) pattern;
 3694|       |
 3695|     71|	    if (raster->extents.width == 0 || raster->extents.height == 0)
  ------------------
  |  Branch (3695:10): [True: 0, False: 71]
  |  Branch (3695:40): [True: 0, False: 71]
  ------------------
 3696|      0|		goto EMPTY;
 3697|       |
 3698|     71|	    if (pattern->extend != CAIRO_EXTEND_NONE)
  ------------------
  |  Branch (3698:10): [True: 0, False: 71]
  ------------------
 3699|      0|		goto UNBOUNDED;
 3700|       |
 3701|     71|	    x1 = raster->extents.x;
 3702|     71|	    y1 = raster->extents.y;
 3703|     71|	    x2 = raster->extents.x + (int) raster->extents.width;
 3704|     71|	    y2 = raster->extents.y + (int) raster->extents.height;
 3705|     71|	}
 3706|     71|    HANDLE_FILTER:
 3707|     71|	switch (pattern->filter) {
 3708|     71|	case CAIRO_FILTER_NEAREST:
  ------------------
  |  Branch (3708:2): [True: 71, False: 0]
  ------------------
 3709|     71|	case CAIRO_FILTER_FAST:
  ------------------
  |  Branch (3709:2): [True: 0, False: 71]
  ------------------
 3710|     71|	    round_x = round_y = TRUE;
  ------------------
  |  |  106|     71|#define TRUE 1
  ------------------
 3711|       |	    /* We don't know which way .5 will go, so fudge it slightly. */
 3712|     71|	    x1 -= 0.004;
 3713|     71|	    y1 -= 0.004;
 3714|     71|	    x2 += 0.004;
 3715|     71|	    y2 += 0.004;
 3716|     71|	    break;
 3717|      0|	case CAIRO_FILTER_BEST:
  ------------------
  |  Branch (3717:2): [True: 0, False: 71]
  ------------------
 3718|       |	    /* Assume best filter will produce nice antialiased edges */
 3719|      0|	    break;
 3720|      0|	case CAIRO_FILTER_BILINEAR:
  ------------------
  |  Branch (3720:2): [True: 0, False: 71]
  ------------------
 3721|      0|	case CAIRO_FILTER_GAUSSIAN:
  ------------------
  |  Branch (3721:2): [True: 0, False: 71]
  ------------------
 3722|      0|	case CAIRO_FILTER_GOOD:
  ------------------
  |  Branch (3722:2): [True: 0, False: 71]
  ------------------
 3723|      0|	default:
  ------------------
  |  Branch (3723:2): [True: 0, False: 71]
  ------------------
 3724|       |	    /* These filters can blur the edge out 1/2 pixel when scaling up */
 3725|      0|	    if (_cairo_hypot (pattern->matrix.xx, pattern->matrix.yx) < 1.0) {
  ------------------
  |  Branch (3725:10): [True: 0, False: 0]
  ------------------
 3726|      0|		x1 -= 0.5;
 3727|      0|		x2 += 0.5;
 3728|      0|		round_x = TRUE;
  ------------------
  |  |  106|      0|#define TRUE 1
  ------------------
 3729|      0|	    }
 3730|      0|	    if (_cairo_hypot (pattern->matrix.xy, pattern->matrix.yy) < 1.0) {
  ------------------
  |  Branch (3730:10): [True: 0, False: 0]
  ------------------
 3731|      0|		y1 -= 0.5;
 3732|      0|		y2 += 0.5;
 3733|      0|		round_y = TRUE;
  ------------------
  |  |  106|      0|#define TRUE 1
  ------------------
 3734|      0|	    }
 3735|      0|	    break;
 3736|     71|	}
 3737|     71|	break;
 3738|       |
 3739|     71|    case CAIRO_PATTERN_TYPE_RADIAL:
  ------------------
  |  Branch (3739:5): [True: 0, False: 71]
  ------------------
 3740|      0|	{
 3741|      0|	    const cairo_radial_pattern_t *radial =
 3742|      0|		(const cairo_radial_pattern_t *) pattern;
 3743|      0|	    double cx1, cy1;
 3744|      0|	    double cx2, cy2;
 3745|      0|	    double r1, r2;
 3746|       |
 3747|      0|	    if (_radial_pattern_is_degenerate (radial)) {
  ------------------
  |  Branch (3747:10): [True: 0, False: 0]
  ------------------
 3748|       |		/* cairo-gstate should have optimised degenerate
 3749|       |		 * patterns to solid clear patterns, so we can ignore
 3750|       |		 * them here. */
 3751|      0|		goto EMPTY;
 3752|      0|	    }
 3753|       |
 3754|       |	    /* TODO: in some cases (focus outside/on the circle) it is
 3755|       |	     * half-bounded. */
 3756|      0|	    if (pattern->extend != CAIRO_EXTEND_NONE)
  ------------------
  |  Branch (3756:10): [True: 0, False: 0]
  ------------------
 3757|      0|		goto UNBOUNDED;
 3758|       |
 3759|      0|	    cx1 = radial->cd1.center.x;
 3760|      0|	    cy1 = radial->cd1.center.y;
 3761|      0|	    r1  = radial->cd1.radius;
 3762|       |
 3763|      0|	    cx2 = radial->cd2.center.x;
 3764|      0|	    cy2 = radial->cd2.center.y;
 3765|      0|	    r2  = radial->cd2.radius;
 3766|       |
 3767|      0|	    x1 = MIN (cx1 - r1, cx2 - r2);
  ------------------
  |  |   90|      0|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (90:20): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 3768|      0|	    y1 = MIN (cy1 - r1, cy2 - r2);
  ------------------
  |  |   90|      0|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (90:20): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 3769|      0|	    x2 = MAX (cx1 + r1, cx2 + r2);
  ------------------
  |  |   93|      0|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (93:20): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 3770|      0|	    y2 = MAX (cy1 + r1, cy2 + r2);
  ------------------
  |  |   93|      0|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (93:20): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 3771|      0|	}
 3772|      0|	break;
 3773|       |
 3774|      0|    case CAIRO_PATTERN_TYPE_LINEAR:
  ------------------
  |  Branch (3774:5): [True: 0, False: 71]
  ------------------
 3775|      0|	{
 3776|      0|	    const cairo_linear_pattern_t *linear =
 3777|      0|		(const cairo_linear_pattern_t *) pattern;
 3778|       |
 3779|      0|	    if (pattern->extend != CAIRO_EXTEND_NONE)
  ------------------
  |  Branch (3779:10): [True: 0, False: 0]
  ------------------
 3780|      0|		goto UNBOUNDED;
 3781|       |
 3782|      0|	    if (_linear_pattern_is_degenerate (linear)) {
  ------------------
  |  Branch (3782:10): [True: 0, False: 0]
  ------------------
 3783|       |		/* cairo-gstate should have optimised degenerate
 3784|       |		 * patterns to solid ones, so we can again ignore
 3785|       |		 * them here. */
 3786|      0|		goto EMPTY;
 3787|      0|	    }
 3788|       |
 3789|       |	    /* TODO: to get tight extents, use the matrix to transform
 3790|       |	     * the pattern instead of transforming the extents later. */
 3791|      0|	    if (pattern->matrix.xy != 0. || pattern->matrix.yx != 0.)
  ------------------
  |  Branch (3791:10): [True: 0, False: 0]
  |  Branch (3791:38): [True: 0, False: 0]
  ------------------
 3792|      0|		goto UNBOUNDED;
 3793|       |
 3794|      0|	    if (linear->pd1.x == linear->pd2.x) {
  ------------------
  |  Branch (3794:10): [True: 0, False: 0]
  ------------------
 3795|      0|		x1 = -HUGE_VAL;
 3796|      0|		x2 = HUGE_VAL;
 3797|      0|		y1 = MIN (linear->pd1.y, linear->pd2.y);
  ------------------
  |  |   90|      0|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (90:20): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 3798|      0|		y2 = MAX (linear->pd1.y, linear->pd2.y);
  ------------------
  |  |   93|      0|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (93:20): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 3799|      0|	    } else if (linear->pd1.y == linear->pd2.y) {
  ------------------
  |  Branch (3799:17): [True: 0, False: 0]
  ------------------
 3800|      0|		x1 = MIN (linear->pd1.x, linear->pd2.x);
  ------------------
  |  |   90|      0|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (90:20): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 3801|      0|		x2 = MAX (linear->pd1.x, linear->pd2.x);
  ------------------
  |  |   93|      0|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (93:20): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 3802|      0|		y1 = -HUGE_VAL;
 3803|      0|		y2 = HUGE_VAL;
 3804|      0|	    } else {
 3805|      0|		goto  UNBOUNDED;
 3806|      0|	    }
 3807|       |
 3808|       |	    /* The current linear renderer just point-samples in the middle
 3809|       |	       of the pixels, similar to the NEAREST filter: */
 3810|      0|	    round_x = round_y = TRUE;
  ------------------
  |  |  106|      0|#define TRUE 1
  ------------------
 3811|      0|	}
 3812|      0|	break;
 3813|       |
 3814|      0|    case CAIRO_PATTERN_TYPE_MESH:
  ------------------
  |  Branch (3814:5): [True: 0, False: 71]
  ------------------
 3815|      0|	{
 3816|      0|	    const cairo_mesh_pattern_t *mesh =
 3817|      0|		(const cairo_mesh_pattern_t *) pattern;
 3818|      0|	    if (! _cairo_mesh_pattern_coord_box (mesh, &x1, &y1, &x2, &y2))
  ------------------
  |  Branch (3818:10): [True: 0, False: 0]
  ------------------
 3819|      0|		goto EMPTY;
 3820|      0|	}
 3821|      0|	break;
 3822|       |
 3823|      0|    default:
  ------------------
  |  Branch (3823:5): [True: 0, False: 71]
  ------------------
 3824|      0|	ASSERT_NOT_REACHED;
  ------------------
  |  |  140|      0|#define ASSERT_NOT_REACHED		\
  |  |  141|      0|do {					\
  |  |  142|      0|    assert (!"reached");		\
  |  |  143|      0|} while (0)
  |  |  ------------------
  |  |  |  Branch (143:10): [Folded, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (3824:2): [Folded, False: 0]
  |  Branch (3824:2): [Folded, False: 0]
  ------------------
 3825|     71|    }
 3826|       |
 3827|     71|    if (_cairo_matrix_is_translation (&pattern->matrix)) {
  ------------------
  |  Branch (3827:9): [True: 71, False: 0]
  ------------------
 3828|     71|	x1 -= pattern->matrix.x0; x2 -= pattern->matrix.x0;
 3829|     71|	y1 -= pattern->matrix.y0; y2 -= pattern->matrix.y0;
 3830|     71|    } else {
 3831|      0|	cairo_matrix_t imatrix;
 3832|      0|	cairo_status_t status;
 3833|       |
 3834|      0|	imatrix = pattern->matrix;
 3835|      0|	status = cairo_matrix_invert (&imatrix);
 3836|       |	/* cairo_pattern_set_matrix ensures the matrix is invertible */
 3837|      0|	assert (status == CAIRO_STATUS_SUCCESS);
  ------------------
  |  Branch (3837:2): [True: 0, False: 0]
  |  Branch (3837:2): [True: 0, False: 0]
  ------------------
 3838|       |
 3839|      0|	_cairo_matrix_transform_bounding_box (&imatrix,
 3840|      0|					      &x1, &y1, &x2, &y2,
 3841|      0|					      NULL);
 3842|      0|    }
 3843|       |
 3844|     71|    if (!round_x) {
  ------------------
  |  Branch (3844:9): [True: 0, False: 71]
  ------------------
 3845|      0|	x1 -= 0.5;
 3846|      0|	x2 += 0.5;
 3847|      0|    }
 3848|     71|    if (x1 < CAIRO_RECT_INT_MIN)
  ------------------
  |  |  315|     71|#define CAIRO_RECT_INT_MIN (INT_MIN >> CAIRO_FIXED_FRAC_BITS)
  |  |  ------------------
  |  |  |  |   62|     71|#define CAIRO_FIXED_FRAC_BITS	8
  |  |  ------------------
  ------------------
  |  Branch (3848:9): [True: 0, False: 71]
  ------------------
 3849|      0|	ix1 = CAIRO_RECT_INT_MIN;
  ------------------
  |  |  315|      0|#define CAIRO_RECT_INT_MIN (INT_MIN >> CAIRO_FIXED_FRAC_BITS)
  |  |  ------------------
  |  |  |  |   62|      0|#define CAIRO_FIXED_FRAC_BITS	8
  |  |  ------------------
  ------------------
 3850|     71|    else 
 3851|     71|	ix1 = _cairo_lround (x1);
 3852|     71|    if (x2 > CAIRO_RECT_INT_MAX)
  ------------------
  |  |  316|     71|#define CAIRO_RECT_INT_MAX (INT_MAX >> CAIRO_FIXED_FRAC_BITS)
  |  |  ------------------
  |  |  |  |   62|     71|#define CAIRO_FIXED_FRAC_BITS	8
  |  |  ------------------
  ------------------
  |  Branch (3852:9): [True: 0, False: 71]
  ------------------
 3853|      0|	ix2 = CAIRO_RECT_INT_MAX;
  ------------------
  |  |  316|      0|#define CAIRO_RECT_INT_MAX (INT_MAX >> CAIRO_FIXED_FRAC_BITS)
  |  |  ------------------
  |  |  |  |   62|      0|#define CAIRO_FIXED_FRAC_BITS	8
  |  |  ------------------
  ------------------
 3854|     71|    else
 3855|     71|	ix2 = _cairo_lround (x2);
 3856|     71|    extents->x = ix1; extents->width  = ix2 - ix1;
 3857|     71|    if (is_vector && extents->width == 0 && x1 != x2)
  ------------------
  |  Branch (3857:9): [True: 0, False: 71]
  |  Branch (3857:22): [True: 0, False: 0]
  |  Branch (3857:45): [True: 0, False: 0]
  ------------------
 3858|      0|	extents->width += 1;
 3859|       |
 3860|     71|    if (!round_y) {
  ------------------
  |  Branch (3860:9): [True: 0, False: 71]
  ------------------
 3861|      0|	y1 -= 0.5;
 3862|      0|	y2 += 0.5;
 3863|      0|    }
 3864|     71|    if (y1 < CAIRO_RECT_INT_MIN)
  ------------------
  |  |  315|     71|#define CAIRO_RECT_INT_MIN (INT_MIN >> CAIRO_FIXED_FRAC_BITS)
  |  |  ------------------
  |  |  |  |   62|     71|#define CAIRO_FIXED_FRAC_BITS	8
  |  |  ------------------
  ------------------
  |  Branch (3864:9): [True: 0, False: 71]
  ------------------
 3865|      0|	iy1 = CAIRO_RECT_INT_MIN;
  ------------------
  |  |  315|      0|#define CAIRO_RECT_INT_MIN (INT_MIN >> CAIRO_FIXED_FRAC_BITS)
  |  |  ------------------
  |  |  |  |   62|      0|#define CAIRO_FIXED_FRAC_BITS	8
  |  |  ------------------
  ------------------
 3866|     71|    else
 3867|     71|	iy1 = _cairo_lround (y1);
 3868|     71|    if (y2 > CAIRO_RECT_INT_MAX)
  ------------------
  |  |  316|     71|#define CAIRO_RECT_INT_MAX (INT_MAX >> CAIRO_FIXED_FRAC_BITS)
  |  |  ------------------
  |  |  |  |   62|     71|#define CAIRO_FIXED_FRAC_BITS	8
  |  |  ------------------
  ------------------
  |  Branch (3868:9): [True: 0, False: 71]
  ------------------
 3869|      0|	iy2 = CAIRO_RECT_INT_MAX;
  ------------------
  |  |  316|      0|#define CAIRO_RECT_INT_MAX (INT_MAX >> CAIRO_FIXED_FRAC_BITS)
  |  |  ------------------
  |  |  |  |   62|      0|#define CAIRO_FIXED_FRAC_BITS	8
  |  |  ------------------
  ------------------
 3870|     71|    else
 3871|     71|	iy2 = _cairo_lround (y2);
 3872|     71|    extents->y = iy1; extents->height = iy2 - iy1;
 3873|     71|    if (is_vector && extents->height == 0 && y1 != y2)
  ------------------
  |  Branch (3873:9): [True: 0, False: 71]
  |  Branch (3873:22): [True: 0, False: 0]
  |  Branch (3873:46): [True: 0, False: 0]
  ------------------
 3874|      0|	extents->height += 1;
 3875|       |
 3876|     71|    return;
 3877|       |
 3878|      0|  UNBOUNDED:
 3879|       |    /* unbounded patterns -> 'infinite' extents */
 3880|      0|    _cairo_unbounded_rectangle_init (extents);
 3881|      0|    return;
 3882|       |
 3883|      0|  EMPTY:
 3884|      0|    extents->x = extents->y = 0;
 3885|      0|    extents->width = extents->height = 0;
 3886|      0|    return;
 3887|     71|}
cairo-pattern.c:_raster_source_is_opaque:
 3317|     71|{
 3318|     71|    if (pattern->content & CAIRO_CONTENT_ALPHA)
  ------------------
  |  Branch (3318:9): [True: 24, False: 47]
  ------------------
 3319|     24|	return FALSE;
  ------------------
  |  |  102|     24|#define FALSE 0
  ------------------
 3320|       |
 3321|     47|    if (pattern->base.extend != CAIRO_EXTEND_NONE)
  ------------------
  |  Branch (3321:9): [True: 0, False: 47]
  ------------------
 3322|      0|	return TRUE;
  ------------------
  |  |  106|      0|#define TRUE 1
  ------------------
 3323|       |
 3324|     47|    if (sample == NULL)
  ------------------
  |  Branch (3324:9): [True: 0, False: 47]
  ------------------
 3325|      0|	return FALSE;
  ------------------
  |  |  102|      0|#define FALSE 0
  ------------------
 3326|       |
 3327|     47|    return _cairo_rectangle_contains_rectangle (&pattern->extents, sample);
 3328|     47|}
cairo-pattern.c:_raster_source_is_clear:
 3345|    142|{
 3346|    142|    return pattern->extents.width == 0 || pattern->extents.height == 0;
  ------------------
  |  Branch (3346:12): [True: 0, False: 142]
  |  Branch (3346:43): [True: 0, False: 142]
  ------------------
 3347|    142|}

cairo_image_surface_create_from_png:
  915|    442|{
  916|    442|    struct png_read_closure_t png_closure;
  917|    442|    cairo_surface_t *surface;
  918|    442|    cairo_status_t status;
  919|       |
  920|    442|    status = _cairo_fopen (filename, "rb", (FILE **) &png_closure.closure);
  921|       |
  922|    442|    if (status != CAIRO_STATUS_SUCCESS)
  ------------------
  |  Branch (922:9): [True: 0, False: 442]
  ------------------
  923|      0|	return _cairo_surface_create_in_error (status);
  924|       |
  925|    442|    if (png_closure.closure == NULL) {
  ------------------
  |  Branch (925:9): [True: 71, False: 371]
  ------------------
  926|     71|	switch (errno) {
  927|      0|	case ENOMEM:
  ------------------
  |  Branch (927:2): [True: 0, False: 71]
  ------------------
  928|      0|	    status = _cairo_error (CAIRO_STATUS_NO_MEMORY);
  929|      0|	    break;
  930|     71|	case ENOENT:
  ------------------
  |  Branch (930:2): [True: 71, False: 0]
  ------------------
  931|     71|	    status = _cairo_error (CAIRO_STATUS_FILE_NOT_FOUND);
  932|     71|	    break;
  933|      0|	default:
  ------------------
  |  Branch (933:2): [True: 0, False: 71]
  ------------------
  934|      0|	    status = _cairo_error (CAIRO_STATUS_READ_ERROR);
  935|      0|	    break;
  936|     71|	}
  937|     71|	return _cairo_surface_create_in_error (status);
  938|     71|    }
  939|       |
  940|    371|    png_closure.read_func = stdio_read_func;
  941|       |
  942|    371|    surface = read_png (&png_closure);
  943|       |
  944|    371|    fclose (png_closure.closure);
  945|       |
  946|    371|    return surface;
  947|    442|}
cairo-png.c:png_simple_error_callback:
  212|    298|{
  213|    298|    cairo_status_t *error = png_get_error_ptr (png);
  214|       |
  215|       |    /* default to the most likely error */
  216|    298|    if (*error == CAIRO_STATUS_SUCCESS)
  ------------------
  |  Branch (216:9): [True: 90, False: 208]
  ------------------
  217|     90|	*error = _cairo_error (CAIRO_STATUS_PNG_ERROR);
  218|       |
  219|    298|#ifdef PNG_SETJMP_SUPPORTED
  220|    298|    longjmp (png_jmpbuf (png), 1);
  ------------------
  |  |  953|    298|      (*png_set_longjmp_fn((png_ptr), longjmp, (sizeof (jmp_buf))))
  ------------------
  221|    298|#endif
  222|       |
  223|       |    /* if we get here, then we have to choice but to abort ... */
  224|    298|}
cairo-png.c:png_simple_warning_callback:
  229|    512|{
  230|       |    /* png does not expect to abort and will try to tidy up and continue
  231|       |     * loading the image after a warning. So we also want to return the
  232|       |     * (incorrect?) surface.
  233|       |     *
  234|       |     * We use our own warning callback to squelch any attempts by libpng
  235|       |     * to write to stderr as we may not be in control of that output.
  236|       |     */
  237|    512|}
cairo-png.c:stdio_read_func:
  631|  1.96M|{
  632|  1.96M|    FILE *file = closure;
  633|       |
  634|  3.93M|    while (size) {
  ------------------
  |  Branch (634:12): [True: 1.96M, False: 1.96M]
  ------------------
  635|  1.96M|	size_t ret;
  636|       |
  637|  1.96M|	ret = fread (data, 1, size, file);
  638|  1.96M|	size -= ret;
  639|  1.96M|	data += ret;
  640|       |
  641|  1.96M|	if (size && (feof (file) || ferror (file)))
  ------------------
  |  Branch (641:6): [True: 208, False: 1.96M]
  |  Branch (641:15): [True: 208, False: 0]
  |  Branch (641:30): [True: 0, False: 0]
  ------------------
  642|    208|	    return _cairo_error (CAIRO_STATUS_READ_ERROR);
  643|  1.96M|    }
  644|       |
  645|  1.96M|    return CAIRO_STATUS_SUCCESS;
  646|  1.96M|}
cairo-png.c:read_png:
  668|    371|{
  669|    371|    cairo_surface_t * volatile surface;
  670|    371|    png_struct *png = NULL;
  671|    371|    png_info *info;
  672|    371|    png_byte * volatile data = NULL;
  673|    371|    png_byte ** volatile row_pointers = NULL;
  674|    371|    png_uint_32 png_width, png_height;
  675|    371|    int depth, color_type, interlace, stride;
  676|    371|    unsigned int i;
  677|    371|    cairo_format_t format;
  678|    371|    cairo_status_t status;
  679|    371|    unsigned char *mime_data;
  680|    371|    unsigned long mime_data_length;
  681|       |
  682|    371|    png_closure->png_data = _cairo_memory_stream_create ();
  683|       |
  684|       |    /* XXX: Perhaps we'll want some other error handlers? */
  685|    371|    png = png_create_read_struct (PNG_LIBPNG_VER_STRING,
  ------------------
  |  |  281|    371|#define PNG_LIBPNG_VER_STRING "1.6.37"
  ------------------
  686|    371|                                  &status,
  687|    371|	                          png_simple_error_callback,
  688|    371|	                          png_simple_warning_callback);
  689|    371|    if (unlikely (png == NULL)) {
  ------------------
  |  |  145|    371|#define unlikely(expr) (__builtin_expect (!!(expr), 0))
  |  |  ------------------
  |  |  |  Branch (145:24): [True: 0, False: 371]
  |  |  ------------------
  ------------------
  690|      0|	surface = _cairo_surface_create_in_error (_cairo_error (CAIRO_STATUS_NO_MEMORY));
  691|      0|	goto BAIL;
  692|      0|    }
  693|       |
  694|    371|    info = png_create_info_struct (png);
  695|    371|    if (unlikely (info == NULL)) {
  ------------------
  |  |  145|    371|#define unlikely(expr) (__builtin_expect (!!(expr), 0))
  |  |  ------------------
  |  |  |  Branch (145:24): [True: 0, False: 371]
  |  |  ------------------
  ------------------
  696|      0|	surface = _cairo_surface_create_in_error (_cairo_error (CAIRO_STATUS_NO_MEMORY));
  697|      0|	goto BAIL;
  698|      0|    }
  699|       |
  700|    371|    png_set_read_fn (png, png_closure, stream_read_func);
  701|       |
  702|    371|    status = CAIRO_STATUS_SUCCESS;
  703|    371|#ifdef PNG_SETJMP_SUPPORTED
  704|    371|    if (setjmp (png_jmpbuf (png))) {
  ------------------
  |  Branch (704:9): [True: 298, False: 73]
  ------------------
  705|    298|	surface = _cairo_surface_create_in_error (status);
  706|    298|	goto BAIL;
  707|    298|    }
  708|     73|#endif
  709|       |
  710|     73|    png_read_info (png, info);
  711|       |
  712|     73|#ifndef WORDS_BIGENDIAN
  713|       |    /* libpng treats 16-bit data as big-endian by default. Swapping the
  714|       |     * byte-order on little endian ensures the native-endian data can be
  715|       |     * provided to png_read_image. This does not affect 8-bit data.
  716|       |     */
  717|     73|    png_set_swap (png);
  718|     73|#endif
  719|       |
  720|     73|    png_get_IHDR (png, info,
  721|     73|                  &png_width, &png_height, &depth,
  722|     73|                  &color_type, &interlace, NULL, NULL);
  723|     73|    if (unlikely (status)) { /* catch any early warnings */
  ------------------
  |  |  145|     73|#define unlikely(expr) (__builtin_expect (!!(expr), 0))
  |  |  ------------------
  |  |  |  Branch (145:24): [True: 0, False: 73]
  |  |  ------------------
  ------------------
  724|      0|	surface = _cairo_surface_create_in_error (status);
  725|      0|	goto BAIL;
  726|      0|    }
  727|       |
  728|       |    /* convert palette/gray image to rgb */
  729|     73|    if (color_type == PNG_COLOR_TYPE_PALETTE)
  ------------------
  |  |  669|     73|#define PNG_COLOR_TYPE_PALETTE  (PNG_COLOR_MASK_COLOR | PNG_COLOR_MASK_PALETTE)
  |  |  ------------------
  |  |  |  |  664|     73|#define PNG_COLOR_MASK_COLOR      2
  |  |  ------------------
  |  |               #define PNG_COLOR_TYPE_PALETTE  (PNG_COLOR_MASK_COLOR | PNG_COLOR_MASK_PALETTE)
  |  |  ------------------
  |  |  |  |  663|     73|#define PNG_COLOR_MASK_PALETTE    1
  |  |  ------------------
  ------------------
  |  Branch (729:9): [True: 5, False: 68]
  ------------------
  730|      5|        png_set_palette_to_rgb (png);
  731|       |
  732|       |    /* expand gray bit depth if needed */
  733|     73|    if (color_type == PNG_COLOR_TYPE_GRAY)
  ------------------
  |  |  668|     73|#define PNG_COLOR_TYPE_GRAY 0
  ------------------
  |  Branch (733:9): [True: 49, False: 24]
  ------------------
  734|     49|        png_set_expand_gray_1_2_4_to_8 (png);
  735|       |
  736|       |    /* transform transparency to alpha */
  737|     73|    if (png_get_valid (png, info, PNG_INFO_tRNS))
  ------------------
  |  |  736|     73|#define PNG_INFO_tRNS 0x0010U
  ------------------
  |  Branch (737:9): [True: 19, False: 54]
  ------------------
  738|     19|        png_set_tRNS_to_alpha (png);
  739|       |
  740|     73|    if (depth < 8)
  ------------------
  |  Branch (740:9): [True: 39, False: 34]
  ------------------
  741|     39|        png_set_packing (png);
  742|       |
  743|       |    /* convert grayscale to RGB */
  744|     73|    if (color_type == PNG_COLOR_TYPE_GRAY ||
  ------------------
  |  |  668|    146|#define PNG_COLOR_TYPE_GRAY 0
  ------------------
  |  Branch (744:9): [True: 18.4E, False: 121]
  ------------------
  745|    121|	color_type == PNG_COLOR_TYPE_GRAY_ALPHA)
  ------------------
  |  |  672|    121|#define PNG_COLOR_TYPE_GRAY_ALPHA (PNG_COLOR_MASK_ALPHA)
  |  |  ------------------
  |  |  |  |  665|    121|#define PNG_COLOR_MASK_ALPHA      4
  |  |  ------------------
  ------------------
  |  Branch (745:2): [True: 20, False: 101]
  ------------------
  746|     69|    {
  747|     69|	png_set_gray_to_rgb (png);
  748|     69|    }
  749|       |
  750|     73|    if (interlace != PNG_INTERLACE_NONE)
  ------------------
  |  |  687|     73|#define PNG_INTERLACE_NONE        0 /* Non-interlaced image */
  ------------------
  |  Branch (750:9): [True: 79, False: 18.4E]
  ------------------
  751|     79|        png_set_interlace_handling (png);
  752|       |
  753|     73|    png_set_filler (png, 0xff, PNG_FILLER_AFTER);
  ------------------
  |  | 1249|     73|#  define PNG_FILLER_AFTER 1
  ------------------
  754|       |
  755|       |    /* recheck header after setting EXPAND options */
  756|     73|    png_read_update_info (png, info);
  757|     73|    png_get_IHDR (png, info,
  758|     73|                  &png_width, &png_height, &depth,
  759|     73|                  &color_type, &interlace, NULL, NULL);
  760|     73|    if ((depth != 8 && depth != 16) ||
  ------------------
  |  Branch (760:10): [True: 40, False: 33]
  |  Branch (760:24): [True: 0, False: 40]
  ------------------
  761|    170|	! (color_type == PNG_COLOR_TYPE_RGB ||
  ------------------
  |  |  670|    340|#define PNG_COLOR_TYPE_RGB        (PNG_COLOR_MASK_COLOR)
  |  |  ------------------
  |  |  |  |  664|    170|#define PNG_COLOR_MASK_COLOR      2
  |  |  ------------------
  ------------------
  |  Branch (761:5): [True: 94, False: 76]
  ------------------
  762|     76|	   color_type == PNG_COLOR_TYPE_RGB_ALPHA))
  ------------------
  |  |  671|     76|#define PNG_COLOR_TYPE_RGB_ALPHA  (PNG_COLOR_MASK_COLOR | PNG_COLOR_MASK_ALPHA)
  |  |  ------------------
  |  |  |  |  664|     76|#define PNG_COLOR_MASK_COLOR      2
  |  |  ------------------
  |  |               #define PNG_COLOR_TYPE_RGB_ALPHA  (PNG_COLOR_MASK_COLOR | PNG_COLOR_MASK_ALPHA)
  |  |  ------------------
  |  |  |  |  665|     76|#define PNG_COLOR_MASK_ALPHA      4
  |  |  ------------------
  ------------------
  |  Branch (762:5): [True: 76, False: 0]
  ------------------
  763|      0|    {
  764|      0|	surface = _cairo_surface_create_in_error (_cairo_error (CAIRO_STATUS_READ_ERROR));
  765|      0|	goto BAIL;
  766|      0|    }
  767|       |
  768|     73|    switch (color_type) {
  769|      0|	default:
  ------------------
  |  Branch (769:2): [True: 0, False: 73]
  ------------------
  770|      0|	    ASSERT_NOT_REACHED;
  ------------------
  |  |  140|      0|#define ASSERT_NOT_REACHED		\
  |  |  141|      0|do {					\
  |  |  142|      0|    assert (!"reached");		\
  |  |  143|      0|} while (0)
  |  |  ------------------
  |  |  |  Branch (143:10): [Folded, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (770:6): [Folded, False: 0]
  |  Branch (770:6): [Folded, False: 0]
  ------------------
  771|       |	    /* fall-through just in case ;-) */
  772|       |
  773|     76|	case PNG_COLOR_TYPE_RGB_ALPHA:
  ------------------
  |  |  671|     76|#define PNG_COLOR_TYPE_RGB_ALPHA  (PNG_COLOR_MASK_COLOR | PNG_COLOR_MASK_ALPHA)
  |  |  ------------------
  |  |  |  |  664|     76|#define PNG_COLOR_MASK_COLOR      2
  |  |  ------------------
  |  |               #define PNG_COLOR_TYPE_RGB_ALPHA  (PNG_COLOR_MASK_COLOR | PNG_COLOR_MASK_ALPHA)
  |  |  ------------------
  |  |  |  |  665|     76|#define PNG_COLOR_MASK_ALPHA      4
  |  |  ------------------
  ------------------
  |  Branch (773:2): [True: 76, False: 18.4E]
  ------------------
  774|     76|	    if (depth == 8) {
  ------------------
  |  Branch (774:10): [True: 58, False: 18]
  ------------------
  775|     58|		format = CAIRO_FORMAT_ARGB32;
  776|     58|		png_set_read_user_transform_fn (png, premultiply_data);
  777|     58|	    } else {
  778|     18|		format = CAIRO_FORMAT_RGBA128F;
  779|     18|	    }
  780|     76|	    break;
  781|       |
  782|     94|	case PNG_COLOR_TYPE_RGB:
  ------------------
  |  |  670|     94|#define PNG_COLOR_TYPE_RGB        (PNG_COLOR_MASK_COLOR)
  |  |  ------------------
  |  |  |  |  664|     94|#define PNG_COLOR_MASK_COLOR      2
  |  |  ------------------
  ------------------
  |  Branch (782:2): [True: 94, False: 18.4E]
  ------------------
  783|     94|	    if (depth == 8) {
  ------------------
  |  Branch (783:10): [True: 72, False: 22]
  ------------------
  784|     72|		format = CAIRO_FORMAT_RGB24;
  785|     72|		png_set_read_user_transform_fn (png, convert_bytes_to_data);
  786|     72|	    } else {
  787|     22|		format = CAIRO_FORMAT_RGB96F;
  788|     22|	    }
  789|     94|	    break;
  790|     73|    }
  791|       |
  792|    170|    stride = cairo_format_stride_for_width (format, png_width);
  793|    170|    if (stride < 0) {
  ------------------
  |  Branch (793:9): [True: 0, False: 170]
  ------------------
  794|      0|	surface = _cairo_surface_create_in_error (_cairo_error (CAIRO_STATUS_INVALID_STRIDE));
  795|      0|	goto BAIL;
  796|      0|    }
  797|       |
  798|    170|    data = _cairo_malloc_ab (png_height, stride);
  799|    170|    if (unlikely (data == NULL)) {
  ------------------
  |  |  145|    170|#define unlikely(expr) (__builtin_expect (!!(expr), 0))
  |  |  ------------------
  |  |  |  Branch (145:24): [True: 0, False: 170]
  |  |  ------------------
  ------------------
  800|      0|	surface = _cairo_surface_create_in_error (_cairo_error (CAIRO_STATUS_NO_MEMORY));
  801|      0|	goto BAIL;
  802|      0|    }
  803|       |
  804|    170|    row_pointers = _cairo_malloc_ab (png_height, sizeof (char *));
  805|    170|    if (unlikely (row_pointers == NULL)) {
  ------------------
  |  |  145|    170|#define unlikely(expr) (__builtin_expect (!!(expr), 0))
  |  |  ------------------
  |  |  |  Branch (145:24): [True: 0, False: 170]
  |  |  ------------------
  ------------------
  806|      0|	surface = _cairo_surface_create_in_error (_cairo_error (CAIRO_STATUS_NO_MEMORY));
  807|      0|	goto BAIL;
  808|      0|    }
  809|       |
  810|  5.76M|    for (i = 0; i < png_height; i++)
  ------------------
  |  Branch (810:17): [True: 5.76M, False: 170]
  ------------------
  811|  5.76M|        row_pointers[i] = &data[i * (ptrdiff_t)stride];
  812|       |
  813|    170|    png_read_image (png, row_pointers);
  814|    170|    png_read_end (png, info);
  815|       |
  816|    170|    if (unlikely (status)) { /* catch any late warnings - probably hit an error already */
  ------------------
  |  |  145|    170|#define unlikely(expr) (__builtin_expect (!!(expr), 0))
  |  |  ------------------
  |  |  |  Branch (145:24): [True: 0, False: 170]
  |  |  ------------------
  ------------------
  817|      0|	surface = _cairo_surface_create_in_error (status);
  818|      0|	goto BAIL;
  819|      0|    }
  820|       |
  821|    170|    if (format == CAIRO_FORMAT_RGBA128F) {
  ------------------
  |  Branch (821:9): [True: 14, False: 156]
  ------------------
  822|     14|	i = png_height;
  823|       |
  824|    691|	while (i--) {
  ------------------
  |  Branch (824:9): [True: 677, False: 14]
  ------------------
  825|    677|	    float *float_line = (float *)row_pointers[i];
  826|    677|	    uint16_t *u16_line = (uint16_t *)row_pointers[i];
  827|       |
  828|    677|	    premultiply_float (float_line, u16_line, png_width);
  829|    677|	}
  830|    156|    } else if (format == CAIRO_FORMAT_RGB96F) {
  ------------------
  |  Branch (830:16): [True: 15, False: 141]
  ------------------
  831|     15|	i = png_height;
  832|       |
  833|  1.18k|	while (i--) {
  ------------------
  |  Branch (833:9): [True: 1.17k, False: 15]
  ------------------
  834|  1.17k|	    float *float_line = (float *)row_pointers[i];
  835|  1.17k|	    uint16_t *u16_line = (uint16_t *)row_pointers[i];
  836|       |
  837|  1.17k|	    convert_u16_to_float (float_line, u16_line, png_width);
  838|  1.17k|	}
  839|     15|    }
  840|       |
  841|    170|    surface = cairo_image_surface_create_for_data (data, format,
  842|    170|						   png_width, png_height,
  843|    170|						   stride);
  844|    170|    if (surface->status)
  ------------------
  |  Branch (844:9): [True: 2, False: 168]
  ------------------
  845|      2|	goto BAIL;
  846|       |
  847|    168|    _cairo_image_surface_assume_ownership_of_data ((cairo_image_surface_t*)surface);
  848|    168|    data = NULL;
  849|       |
  850|    168|    _cairo_debug_check_image_surface_is_defined (surface);
  851|       |
  852|    168|    status = _cairo_memory_stream_destroy (png_closure->png_data,
  853|    168|					   &mime_data,
  854|    168|					   &mime_data_length);
  855|    168|    png_closure->png_data = NULL;
  856|    168|    if (unlikely (status)) {
  ------------------
  |  |  145|    168|#define unlikely(expr) (__builtin_expect (!!(expr), 0))
  |  |  ------------------
  |  |  |  Branch (145:24): [True: 0, False: 168]
  |  |  ------------------
  ------------------
  857|      0|	cairo_surface_destroy (surface);
  858|      0|	surface = _cairo_surface_create_in_error (status);
  859|      0|	goto BAIL;
  860|      0|    }
  861|       |
  862|    168|    status = cairo_surface_set_mime_data (surface,
  863|    168|					  CAIRO_MIME_TYPE_PNG,
  ------------------
  |  | 2621|    168|#define CAIRO_MIME_TYPE_PNG "image/png"
  ------------------
  864|    168|					  mime_data,
  865|    168|					  mime_data_length,
  866|    168|					  free,
  867|    168|					  mime_data);
  868|    168|    if (unlikely (status)) {
  ------------------
  |  |  145|    168|#define unlikely(expr) (__builtin_expect (!!(expr), 0))
  |  |  ------------------
  |  |  |  Branch (145:24): [True: 0, False: 168]
  |  |  ------------------
  ------------------
  869|      0|	free (mime_data);
  870|      0|	cairo_surface_destroy (surface);
  871|      0|	surface = _cairo_surface_create_in_error (status);
  872|      0|	goto BAIL;
  873|      0|    }
  874|       |
  875|    371| BAIL:
  876|    371|    free (row_pointers);
  877|    371|    free (data);
  878|    371|    if (png != NULL)
  ------------------
  |  Branch (878:9): [True: 371, False: 0]
  ------------------
  879|    371|	png_destroy_read_struct (&png, &info, NULL);
  880|    371|    if (png_closure->png_data != NULL) {
  ------------------
  |  Branch (880:9): [True: 300, False: 71]
  ------------------
  881|    300|	cairo_status_t status_ignored;
  882|       |
  883|    300|	status_ignored = _cairo_output_stream_destroy (png_closure->png_data);
  884|    300|    }
  885|       |
  886|    371|    return surface;
  887|    168|}
cairo-png.c:stream_read_func:
  650|  1.96M|{
  651|  1.96M|    cairo_status_t status;
  652|  1.96M|    struct png_read_closure_t *png_closure;
  653|       |
  654|  1.96M|    png_closure = png_get_io_ptr (png);
  655|  1.96M|    status = png_closure->read_func (png_closure->closure, data, size);
  656|  1.96M|    if (unlikely (status)) {
  ------------------
  |  |  145|  1.96M|#define unlikely(expr) (__builtin_expect (!!(expr), 0))
  |  |  ------------------
  |  |  |  Branch (145:24): [True: 208, False: 1.96M]
  |  |  ------------------
  ------------------
  657|    208|	cairo_status_t *error = png_get_error_ptr (png);
  658|    208|	if (*error == CAIRO_STATUS_SUCCESS)
  ------------------
  |  Branch (658:6): [True: 208, False: 0]
  ------------------
  659|    208|	    *error = status;
  660|    208|	png_error (png, NULL);
  661|    208|    }
  662|       |
  663|  1.96M|    _cairo_output_stream_write (png_closure->png_data, data, size);
  664|  1.96M|}
cairo-png.c:premultiply_data:
  585|  2.48k|{
  586|  2.48k|    unsigned int i;
  587|       |
  588|  3.00M|    for (i = 0; i < row_info->rowbytes; i += 4) {
  ------------------
  |  Branch (588:17): [True: 3.00M, False: 2.48k]
  ------------------
  589|  3.00M|	uint8_t *base  = &data[i];
  590|  3.00M|	uint8_t  alpha = base[3];
  591|  3.00M|	uint32_t p;
  592|       |
  593|  3.00M|	if (alpha == 0) {
  ------------------
  |  Branch (593:6): [True: 212k, False: 2.79M]
  ------------------
  594|   212k|	    p = 0;
  595|  2.79M|	} else {
  596|  2.79M|	    uint8_t  red   = base[0];
  597|  2.79M|	    uint8_t  green = base[1];
  598|  2.79M|	    uint8_t  blue  = base[2];
  599|       |
  600|  2.79M|	    if (alpha != 0xff) {
  ------------------
  |  Branch (600:10): [True: 251k, False: 2.54M]
  ------------------
  601|   251k|		red   = multiply_alpha (alpha, red);
  602|   251k|		green = multiply_alpha (alpha, green);
  603|   251k|		blue  = multiply_alpha (alpha, blue);
  604|   251k|	    }
  605|  2.79M|	    p = ((uint32_t)alpha << 24) | (red << 16) | (green << 8) | (blue << 0);
  606|  2.79M|	}
  607|  3.00M|	memcpy (base, &p, sizeof (uint32_t));
  608|  3.00M|    }
  609|  2.48k|}
cairo-png.c:multiply_alpha:
  575|   753k|{
  576|   753k|    int temp = (alpha * color) + 0x80;
  577|   753k|    return ((temp + (temp >> 8)) >> 8);
  578|   753k|}
cairo-png.c:convert_bytes_to_data:
  614|  4.22k|{
  615|  4.22k|    unsigned int i;
  616|       |
  617|  3.43M|    for (i = 0; i < row_info->rowbytes; i += 4) {
  ------------------
  |  Branch (617:17): [True: 3.43M, False: 4.22k]
  ------------------
  618|  3.43M|	uint8_t *base  = &data[i];
  619|  3.43M|	uint8_t  red   = base[0];
  620|  3.43M|	uint8_t  green = base[1];
  621|  3.43M|	uint8_t  blue  = base[2];
  622|  3.43M|	uint32_t pixel;
  623|       |
  624|  3.43M|	pixel = (0xffu << 24) | (red << 16) | (green << 8) | (blue << 0);
  625|  3.43M|	memcpy (base, &pixel, sizeof (uint32_t));
  626|  3.43M|    }
  627|  4.22k|}
cairo-png.c:premultiply_float:
  147|    677|{
  148|    677|    unsigned int i = width;
  149|       |
  150|       |    /* Convert d16 in place back to float */
  151|  1.89k|    while (i--) {
  ------------------
  |  Branch (151:12): [True: 1.21k, False: 677]
  ------------------
  152|  1.21k|	float a = d16[i * 4 + 3] / 65535.f;
  153|       |
  154|  1.21k|	f[i * 4 + 3] = a;
  155|  1.21k|	f[i * 4 + 2] = (float)d16[i * 4 + 2] / 65535.f * a;
  156|  1.21k|	f[i * 4 + 1] = (float)d16[i * 4 + 1] / 65535.f * a;
  157|  1.21k|	f[i * 4] = (float)d16[i * 4] / 65535.f * a;
  158|  1.21k|    }
  159|    677|}
cairo-png.c:convert_u16_to_float:
  162|  1.17k|{
  163|       |    /* Convert d16 in place back to float */
  164|  1.17k|    unsigned int i = width;
  165|       |
  166|  3.79k|    while (i--) {
  ------------------
  |  Branch (166:12): [True: 2.62k, False: 1.17k]
  ------------------
  167|  2.62k|	f[i * 3 + 2] = (float)d16[i * 4 + 2] / 65535.f;
  168|  2.62k|	f[i * 3 + 1] = (float)d16[i * 4 + 1] / 65535.f;
  169|  2.62k|	f[i * 3] = (float)d16[i * 4] / 65535.f;
  170|  2.62k|    }
  171|  1.17k|}

_cairo_raster_source_pattern_acquire:
   66|     71|{
   67|     71|    cairo_raster_source_pattern_t *pattern =
   68|     71|	(cairo_raster_source_pattern_t *) abstract_pattern;
   69|       |
   70|     71|    if (pattern->acquire == NULL)
  ------------------
  |  Branch (70:9): [True: 0, False: 71]
  ------------------
   71|      0|	return NULL;
   72|       |
   73|     71|    if (extents == NULL)
  ------------------
  |  Branch (73:9): [True: 71, False: 0]
  ------------------
   74|     71|	extents = &pattern->extents;
   75|       |
   76|     71|    return pattern->acquire (&pattern->base, pattern->user_data,
   77|     71|			     target, extents);
   78|     71|}
_cairo_raster_source_pattern_finish:
  125|     71|{
  126|     71|    cairo_raster_source_pattern_t *pattern =
  127|     71|	(cairo_raster_source_pattern_t *) abstract_pattern;
  128|       |
  129|     71|    if (pattern->finish == NULL)
  ------------------
  |  Branch (129:9): [True: 71, False: 0]
  ------------------
  130|     71|	return;
  131|       |
  132|      0|    pattern->finish (&pattern->base, pattern->user_data);
  133|      0|}
cairo_pattern_create_raster_source:
  160|     71|{
  161|     71|    cairo_raster_source_pattern_t *pattern;
  162|       |
  163|     71|    CAIRO_MUTEX_INITIALIZE ();
  ------------------
  |  |  173|     71|#define CAIRO_MUTEX_INITIALIZE		CAIRO_MUTEX_IMPL_INITIALIZE
  |  |  ------------------
  |  |  |  |   88|     71|#  define CAIRO_MUTEX_IMPL_INITIALIZE() CAIRO_MUTEX_IMPL_NOOP
  |  |  |  |  ------------------
  |  |  |  |  |  |   53|     71|#define CAIRO_MUTEX_IMPL_NOOP	do {/*no-op*/} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (53:53): [Folded, False: 71]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  164|       |
  165|     71|    if (width < 0 || height < 0)
  ------------------
  |  Branch (165:9): [True: 0, False: 71]
  |  Branch (165:22): [True: 0, False: 71]
  ------------------
  166|      0|	return _cairo_pattern_create_in_error (CAIRO_STATUS_INVALID_SIZE);
  167|       |
  168|     71|    if (! CAIRO_CONTENT_VALID (content))
  ------------------
  |  | 1564|     71|#define CAIRO_CONTENT_VALID(content) ((content) && 			         \
  |  |  ------------------
  |  |  |  Branch (1564:39): [True: 71, False: 0]
  |  |  ------------------
  |  | 1565|     71|				      (((content) & ~(CAIRO_CONTENT_COLOR |      \
  |  |  ------------------
  |  |  |  Branch (1565:11): [True: 71, False: 0]
  |  |  ------------------
  |  | 1566|     71|						      CAIRO_CONTENT_ALPHA |      \
  |  | 1567|     71|						      CAIRO_CONTENT_COLOR_ALPHA))\
  |  | 1568|     71|				       == 0))
  ------------------
  169|      0|	return _cairo_pattern_create_in_error (CAIRO_STATUS_INVALID_CONTENT);
  170|       |
  171|     71|    pattern = _cairo_calloc (sizeof (*pattern));
  ------------------
  |  |   79|     71|    ((size) != 0 ? calloc(1,size) : NULL)
  |  |  ------------------
  |  |  |  Branch (79:6): [True: 71, Folded]
  |  |  ------------------
  ------------------
  172|     71|    if (unlikely (pattern == NULL))
  ------------------
  |  |  145|     71|#define unlikely(expr) (__builtin_expect (!!(expr), 0))
  |  |  ------------------
  |  |  |  Branch (145:24): [True: 0, False: 71]
  |  |  ------------------
  ------------------
  173|      0|	return _cairo_pattern_create_in_error (CAIRO_STATUS_NO_MEMORY);
  174|       |
  175|     71|    _cairo_pattern_init (&pattern->base,
  176|     71|			 CAIRO_PATTERN_TYPE_RASTER_SOURCE);
  177|     71|    CAIRO_REFERENCE_COUNT_INIT (&pattern->base.ref_count, 1);
  ------------------
  |  |   51|     71|#define CAIRO_REFERENCE_COUNT_INIT(RC, VALUE) ((RC)->ref_count = (VALUE))
  ------------------
  178|       |
  179|     71|    pattern->content = content;
  180|       |
  181|     71|    pattern->extents.x = 0;
  182|     71|    pattern->extents.y = 0;
  183|     71|    pattern->extents.width  = width;
  184|     71|    pattern->extents.height = height;
  185|       |
  186|     71|    pattern->user_data = user_data;
  187|       |
  188|     71|    return &pattern->base;
  189|     71|}
cairo_raster_source_pattern_set_acquire:
  258|     71|{
  259|     71|    cairo_raster_source_pattern_t *pattern;
  260|       |
  261|     71|    if (abstract_pattern->type != CAIRO_PATTERN_TYPE_RASTER_SOURCE)
  ------------------
  |  Branch (261:9): [True: 0, False: 71]
  ------------------
  262|      0|	return;
  263|       |
  264|     71|    pattern = (cairo_raster_source_pattern_t *) abstract_pattern;
  265|     71|    pattern->acquire = acquire;
  266|     71|    pattern->release = release;
  267|     71|}

_cairo_box_round_to_rectangle:
  111|     71|{
  112|     71|    rectangle->x = _cairo_fixed_integer_floor (box->p1.x);
  113|     71|    rectangle->y = _cairo_fixed_integer_floor (box->p1.y);
  114|     71|    rectangle->width = _cairo_fixed_integer_ceil (box->p2.x) - rectangle->x;
  115|     71|    rectangle->height = _cairo_fixed_integer_ceil (box->p2.y) - rectangle->y;
  116|     71|}
_cairo_rectangle_intersect:
  121|    142|{
  122|    142|    int x1, y1, x2, y2;
  123|       |
  124|    142|    x1 = MAX (dst->x, src->x);
  ------------------
  |  |   93|    142|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (93:20): [True: 0, False: 142]
  |  |  ------------------
  ------------------
  125|    142|    y1 = MAX (dst->y, src->y);
  ------------------
  |  |   93|    142|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (93:20): [True: 0, False: 142]
  |  |  ------------------
  ------------------
  126|       |    /* Beware the unsigned promotion, fortunately we have bits to spare
  127|       |     * as (CAIRO_RECT_INT_MAX - CAIRO_RECT_INT_MIN) < UINT_MAX
  128|       |     */
  129|    142|    x2 = MIN (dst->x + (int) dst->width,  src->x + (int) src->width);
  ------------------
  |  |   90|    142|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (90:20): [True: 0, False: 142]
  |  |  ------------------
  ------------------
  130|    142|    y2 = MIN (dst->y + (int) dst->height, src->y + (int) src->height);
  ------------------
  |  |   90|    142|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (90:20): [True: 0, False: 142]
  |  |  ------------------
  ------------------
  131|       |
  132|    142|    if (x1 >= x2 || y1 >= y2) {
  ------------------
  |  Branch (132:9): [True: 0, False: 142]
  |  Branch (132:21): [True: 0, False: 142]
  ------------------
  133|      0|	dst->x = 0;
  134|      0|	dst->y = 0;
  135|      0|	dst->width  = 0;
  136|      0|	dst->height = 0;
  137|       |
  138|      0|	return FALSE;
  ------------------
  |  |  102|      0|#define FALSE 0
  ------------------
  139|    142|    } else {
  140|    142|	dst->x = x1;
  141|    142|	dst->y = y1;
  142|    142|	dst->width  = x2 - x1;
  143|    142|	dst->height = y2 - y1;
  144|       |
  145|    142|	return TRUE;
  ------------------
  |  |  106|    142|#define TRUE 1
  ------------------
  146|    142|    }
  147|    142|}

cairo_region_destroy:
  421|     71|{
  422|     71|    if (region == NULL || CAIRO_REFERENCE_COUNT_IS_INVALID (&region->ref_count))
  ------------------
  |  |   58|      0|#define CAIRO_REFERENCE_COUNT_IS_INVALID(RC) (CAIRO_REFERENCE_COUNT_GET_VALUE (RC) == CAIRO_REFERENCE_COUNT_INVALID_VALUE)
  |  |  ------------------
  |  |  |  |   53|      0|#define CAIRO_REFERENCE_COUNT_GET_VALUE(RC) _cairo_atomic_int_get (&(RC)->ref_count)
  |  |  ------------------
  |  |               #define CAIRO_REFERENCE_COUNT_IS_INVALID(RC) (CAIRO_REFERENCE_COUNT_GET_VALUE (RC) == CAIRO_REFERENCE_COUNT_INVALID_VALUE)
  |  |  ------------------
  |  |  |  |   55|      0|#define CAIRO_REFERENCE_COUNT_INVALID_VALUE ((int) -1)
  |  |  ------------------
  |  |  |  Branch (58:46): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (422:9): [True: 71, False: 0]
  ------------------
  423|     71|	return;
  424|       |
  425|     71|    assert (CAIRO_REFERENCE_COUNT_HAS_REFERENCE (&region->ref_count));
  ------------------
  |  Branch (425:5): [True: 0, False: 0]
  |  Branch (425:5): [True: 0, False: 0]
  ------------------
  426|       |
  427|      0|    if (! _cairo_reference_count_dec_and_test (&region->ref_count))
  ------------------
  |  |   49|      0|#define _cairo_reference_count_dec_and_test(RC) _cairo_atomic_int_dec_and_test (&(RC)->ref_count)
  |  |  ------------------
  |  |  |  |   85|      0|# define _cairo_atomic_int_dec_and_test(x) (atomic_fetch_sub_explicit(x, 1, memory_order_seq_cst) == 1)
  |  |  ------------------
  ------------------
  |  Branch (427:9): [True: 0, False: 0]
  ------------------
  428|      0|	return;
  429|       |
  430|      0|    _cairo_region_fini (region);
  431|      0|    free (region);
  432|      0|}

cairo_scaled_font_destroy:
 1348|    142|{
 1349|    142|    cairo_scaled_font_t *lru = NULL;
 1350|    142|    cairo_scaled_font_map_t *font_map;
 1351|       |
 1352|    142|    assert (CAIRO_MUTEX_IS_UNLOCKED (_cairo_scaled_font_map_mutex));
  ------------------
  |  Branch (1352:5): [True: 0, Folded]
  |  Branch (1352:5): [True: 142, Folded]
  ------------------
 1353|       |
 1354|    142|    if (scaled_font == NULL ||
  ------------------
  |  Branch (1354:9): [True: 142, False: 0]
  ------------------
 1355|      0|	    CAIRO_REFERENCE_COUNT_IS_INVALID (&scaled_font->ref_count))
  ------------------
  |  |   58|      0|#define CAIRO_REFERENCE_COUNT_IS_INVALID(RC) (CAIRO_REFERENCE_COUNT_GET_VALUE (RC) == CAIRO_REFERENCE_COUNT_INVALID_VALUE)
  |  |  ------------------
  |  |  |  |   53|      0|#define CAIRO_REFERENCE_COUNT_GET_VALUE(RC) _cairo_atomic_int_get (&(RC)->ref_count)
  |  |  ------------------
  |  |               #define CAIRO_REFERENCE_COUNT_IS_INVALID(RC) (CAIRO_REFERENCE_COUNT_GET_VALUE (RC) == CAIRO_REFERENCE_COUNT_INVALID_VALUE)
  |  |  ------------------
  |  |  |  |   55|      0|#define CAIRO_REFERENCE_COUNT_INVALID_VALUE ((int) -1)
  |  |  ------------------
  |  |  |  Branch (58:46): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1356|    142|	return;
 1357|       |
 1358|    142|    assert (CAIRO_REFERENCE_COUNT_HAS_REFERENCE (&scaled_font->ref_count));
  ------------------
  |  Branch (1358:5): [True: 0, False: 0]
  |  Branch (1358:5): [True: 0, False: 0]
  ------------------
 1359|       |
 1360|      0|    font_map = _cairo_scaled_font_map_lock ();
 1361|      0|    assert (font_map != NULL);
  ------------------
  |  Branch (1361:5): [True: 0, False: 0]
  |  Branch (1361:5): [True: 0, False: 0]
  ------------------
 1362|       |
 1363|      0|    if (! _cairo_reference_count_dec_and_test (&scaled_font->ref_count))
  ------------------
  |  |   49|      0|#define _cairo_reference_count_dec_and_test(RC) _cairo_atomic_int_dec_and_test (&(RC)->ref_count)
  |  |  ------------------
  |  |  |  |   85|      0|# define _cairo_atomic_int_dec_and_test(x) (atomic_fetch_sub_explicit(x, 1, memory_order_seq_cst) == 1)
  |  |  ------------------
  ------------------
  |  Branch (1363:9): [True: 0, False: 0]
  ------------------
 1364|      0|	goto unlock;
 1365|       |
 1366|      0|    assert (! scaled_font->cache_frozen);
  ------------------
  |  Branch (1366:5): [True: 0, False: 0]
  |  Branch (1366:5): [True: 0, False: 0]
  ------------------
 1367|      0|    assert (! scaled_font->global_cache_frozen);
  ------------------
  |  Branch (1367:5): [True: 0, False: 0]
  |  Branch (1367:5): [True: 0, False: 0]
  ------------------
 1368|       |
 1369|       |    /* Another thread may have resurrected the font whilst we waited */
 1370|      0|    if (! CAIRO_REFERENCE_COUNT_HAS_REFERENCE (&scaled_font->ref_count)) {
  ------------------
  |  |   60|      0|#define CAIRO_REFERENCE_COUNT_HAS_REFERENCE(RC) (CAIRO_REFERENCE_COUNT_GET_VALUE (RC) > 0)
  |  |  ------------------
  |  |  |  |   53|      0|#define CAIRO_REFERENCE_COUNT_GET_VALUE(RC) _cairo_atomic_int_get (&(RC)->ref_count)
  |  |  ------------------
  ------------------
  |  Branch (1370:9): [True: 0, False: 0]
  ------------------
 1371|      0|	if (! scaled_font->placeholder &&
  ------------------
  |  Branch (1371:6): [True: 0, False: 0]
  ------------------
 1372|      0|	    scaled_font->hash_entry.hash != ZOMBIE)
  ------------------
  |  |  236|      0|#define ZOMBIE 0
  ------------------
  |  Branch (1372:6): [True: 0, False: 0]
  ------------------
 1373|      0|	{
 1374|       |	    /* Another thread may have already inserted us into the holdovers */
 1375|      0|	    if (scaled_font->holdover)
  ------------------
  |  Branch (1375:10): [True: 0, False: 0]
  ------------------
 1376|      0|		goto unlock;
 1377|       |
 1378|       |	    /* Rather than immediately destroying this object, we put it into
 1379|       |	     * the font_map->holdovers array in case it will get used again
 1380|       |	     * soon (and is why we must hold the lock over the atomic op on
 1381|       |	     * the reference count). To make room for it, we do actually
 1382|       |	     * destroy the least-recently-used holdover.
 1383|       |	     */
 1384|       |
 1385|      0|	    if (font_map->num_holdovers == CAIRO_SCALED_FONT_MAX_HOLDOVERS) {
  ------------------
  |  |  361|      0|#define CAIRO_SCALED_FONT_MAX_HOLDOVERS 256
  ------------------
  |  Branch (1385:10): [True: 0, False: 0]
  ------------------
 1386|      0|		lru = font_map->holdovers[0];
 1387|      0|		assert (! CAIRO_REFERENCE_COUNT_HAS_REFERENCE (&lru->ref_count));
  ------------------
  |  Branch (1387:3): [True: 0, False: 0]
  |  Branch (1387:3): [True: 0, False: 0]
  ------------------
 1388|       |
 1389|      0|		_cairo_hash_table_remove (font_map->hash_table,
 1390|      0|					  &lru->hash_entry);
 1391|       |
 1392|      0|		font_map->num_holdovers--;
 1393|      0|		memmove (&font_map->holdovers[0],
 1394|      0|			 &font_map->holdovers[1],
 1395|      0|			 font_map->num_holdovers * sizeof (cairo_scaled_font_t*));
 1396|      0|	    }
 1397|       |
 1398|      0|	    font_map->holdovers[font_map->num_holdovers++] = scaled_font;
 1399|      0|	    scaled_font->holdover = TRUE;
  ------------------
  |  |  106|      0|#define TRUE 1
  ------------------
 1400|      0|	} else
 1401|      0|	    lru = scaled_font;
 1402|      0|    }
 1403|       |
 1404|      0|  unlock:
 1405|      0|    _cairo_scaled_font_map_unlock ();
 1406|       |
 1407|       |    /* If we pulled an item from the holdovers array, (while the font
 1408|       |     * map lock was held, of course), then there is no way that anyone
 1409|       |     * else could have acquired a reference to it. So we can now
 1410|       |     * safely call fini on it without any lock held. This is desirable
 1411|       |     * as we never want to call into any backend function with a lock
 1412|       |     * held. */
 1413|      0|    if (lru != NULL) {
  ------------------
  |  Branch (1413:9): [True: 0, False: 0]
  ------------------
 1414|      0|	_cairo_scaled_font_fini_internal (lru);
 1415|      0|	free (lru);
 1416|      0|    }
 1417|      0|}

_cairo_shape_mask_compositor_init:
  332|      1|{
  333|      1|    compositor->delegate = delegate;
  334|       |
  335|      1|    compositor->paint  = NULL;
  336|       |    compositor->mask   = NULL;
  337|      1|    compositor->fill   = _cairo_shape_mask_compositor_fill;
  338|      1|    compositor->stroke = _cairo_shape_mask_compositor_stroke;
  339|      1|    compositor->glyphs = _cairo_shape_mask_compositor_glyphs;
  340|      1|}

_cairo_spans_compositor_init:
 1193|      1|{
 1194|      1|    compositor->base.delegate = delegate;
 1195|       |
 1196|      1|    compositor->base.paint  = _cairo_spans_compositor_paint;
 1197|      1|    compositor->base.mask   = _cairo_spans_compositor_mask;
 1198|      1|    compositor->base.fill   = _cairo_spans_compositor_fill;
 1199|      1|    compositor->base.stroke = _cairo_spans_compositor_stroke;
 1200|       |    compositor->base.glyphs = NULL;
 1201|      1|}
cairo-spans-compositor.c:_cairo_spans_compositor_paint:
  976|     71|{
  977|     71|    const cairo_spans_compositor_t *compositor = (cairo_spans_compositor_t*)_compositor;
  978|     71|    cairo_boxes_t boxes;
  979|     71|    cairo_int_status_t status;
  980|       |
  981|     71|    TRACE ((stderr, "%s\n", __FUNCTION__));
  982|     71|    _cairo_clip_steal_boxes (extents->clip, &boxes);
  983|     71|    status = clip_and_composite_boxes (compositor, extents, &boxes);
  984|     71|    _cairo_clip_unsteal_boxes (extents->clip, &boxes);
  985|       |
  986|     71|    return status;
  987|     71|}
cairo-spans-compositor.c:clip_and_composite_boxes:
  831|     71|{
  832|     71|    cairo_int_status_t status;
  833|     71|    cairo_polygon_t polygon;
  834|       |
  835|     71|    TRACE ((stderr, "%s\n", __FUNCTION__));
  836|     71|    status = trim_extents_to_boxes (extents, boxes);
  837|     71|    if (unlikely (status))
  ------------------
  |  |  145|     71|#define unlikely(expr) (__builtin_expect (!!(expr), 0))
  |  |  ------------------
  |  |  |  Branch (145:24): [True: 0, False: 71]
  |  |  ------------------
  ------------------
  838|      0|	return status;
  839|       |
  840|     71|    if (boxes->num_boxes == 0) {
  ------------------
  |  Branch (840:9): [True: 0, False: 71]
  ------------------
  841|      0|	if (extents->is_bounded)
  ------------------
  |  Branch (841:6): [True: 0, False: 0]
  ------------------
  842|      0|	    return CAIRO_STATUS_SUCCESS;
  843|       |
  844|      0|	return fixup_unbounded_boxes (compositor, extents, boxes);
  845|      0|    }
  846|       |
  847|       |    /* Can we reduce drawing through a clip-mask to simply drawing the clip? */
  848|     71|    if (extents->clip->path != NULL && extents->is_bounded) {
  ------------------
  |  Branch (848:9): [True: 0, False: 71]
  |  Branch (848:40): [True: 0, False: 0]
  ------------------
  849|      0|	cairo_polygon_t polygon;
  850|      0|	cairo_fill_rule_t fill_rule;
  851|      0|	cairo_antialias_t antialias;
  852|      0|	cairo_clip_t *clip;
  853|       |
  854|      0|	clip = _cairo_clip_copy (extents->clip);
  855|      0|	clip = _cairo_clip_intersect_boxes (clip, boxes);
  856|      0|	if (_cairo_clip_is_all_clipped (clip))
  ------------------
  |  Branch (856:6): [True: 0, False: 0]
  ------------------
  857|      0|	    return CAIRO_INT_STATUS_NOTHING_TO_DO;
  858|       |
  859|      0|	status = _cairo_clip_get_polygon (clip, &polygon,
  860|      0|					  &fill_rule, &antialias);
  861|      0|	_cairo_clip_path_destroy (clip->path);
  862|      0|	clip->path = NULL;
  863|      0|	if (likely (status == CAIRO_INT_STATUS_SUCCESS)) {
  ------------------
  |  |  144|      0|#define likely(expr) (__builtin_expect (!!(expr), 1))
  |  |  ------------------
  |  |  |  Branch (144:22): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  864|      0|	    cairo_clip_t *saved_clip = extents->clip;
  865|      0|	    extents->clip = clip;
  866|       |
  867|      0|	    status = clip_and_composite_polygon (compositor, extents, &polygon,
  868|      0|						 fill_rule, antialias);
  869|       |
  870|      0|	    clip = extents->clip;
  871|      0|	    extents->clip = saved_clip;
  872|       |
  873|      0|	    _cairo_polygon_fini (&polygon);
  874|      0|	}
  875|      0|	_cairo_clip_destroy (clip);
  876|       |
  877|      0|	if (status != CAIRO_INT_STATUS_UNSUPPORTED)
  ------------------
  |  Branch (877:6): [True: 0, False: 0]
  ------------------
  878|      0|	    return status;
  879|      0|    }
  880|       |
  881|     71|    if (boxes->is_pixel_aligned) {
  ------------------
  |  Branch (881:9): [True: 71, False: 0]
  ------------------
  882|     71|	status = composite_aligned_boxes (compositor, extents, boxes);
  883|     71|	if (status != CAIRO_INT_STATUS_UNSUPPORTED)
  ------------------
  |  Branch (883:6): [True: 71, False: 0]
  ------------------
  884|     71|	    return status;
  885|     71|    }
  886|       |
  887|      0|    status = composite_boxes (compositor, extents, boxes);
  888|      0|    if (status != CAIRO_INT_STATUS_UNSUPPORTED)
  ------------------
  |  Branch (888:9): [True: 0, False: 0]
  ------------------
  889|      0|	return status;
  890|       |
  891|      0|    status = _cairo_polygon_init_boxes (&polygon, boxes);
  892|      0|    if (unlikely (status))
  ------------------
  |  |  145|      0|#define unlikely(expr) (__builtin_expect (!!(expr), 0))
  |  |  ------------------
  |  |  |  Branch (145:24): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  893|      0|	return status;
  894|       |
  895|      0|    status = composite_polygon (compositor, extents, &polygon,
  896|      0|				CAIRO_FILL_RULE_WINDING,
  897|      0|				CAIRO_ANTIALIAS_DEFAULT);
  898|      0|    _cairo_polygon_fini (&polygon);
  899|       |
  900|      0|    return status;
  901|      0|}
cairo-spans-compositor.c:trim_extents_to_boxes:
  812|     71|{
  813|     71|    cairo_box_t box;
  814|       |
  815|     71|    _cairo_boxes_extents (boxes, &box);
  816|     71|    return _cairo_composite_rectangles_intersect_mask_extents (extents, &box);
  817|     71|}
cairo-spans-compositor.c:composite_aligned_boxes:
  548|     71|{
  549|     71|    cairo_surface_t *dst = extents->surface;
  550|     71|    cairo_operator_t op = extents->op;
  551|     71|    const cairo_pattern_t *source = &extents->source_pattern.base;
  552|     71|    cairo_int_status_t status;
  553|     71|    cairo_bool_t need_clip_mask = ! _clip_is_region (extents->clip);
  554|     71|    cairo_bool_t op_is_source;
  555|     71|    cairo_bool_t no_mask;
  556|     71|    cairo_bool_t inplace;
  557|       |
  558|     71|    TRACE ((stderr, "%s: need_clip_mask=%d, is-bounded=%d\n",
  559|     71|	    __FUNCTION__, need_clip_mask, extents->is_bounded));
  560|     71|    if (need_clip_mask && ! extents->is_bounded) {
  ------------------
  |  Branch (560:9): [True: 0, False: 71]
  |  Branch (560:27): [True: 0, False: 0]
  ------------------
  561|      0|	TRACE ((stderr, "%s: unsupported clip\n", __FUNCTION__));
  562|      0|	return CAIRO_INT_STATUS_UNSUPPORTED;
  563|      0|    }
  564|       |
  565|     71|    no_mask = extents->mask_pattern.base.type == CAIRO_PATTERN_TYPE_SOLID &&
  ------------------
  |  Branch (565:15): [True: 71, False: 0]
  ------------------
  566|     71|	CAIRO_COLOR_IS_OPAQUE (&extents->mask_pattern.solid.color);
  ------------------
  |  |  157|     71|#define CAIRO_COLOR_IS_OPAQUE(color) CAIRO_ALPHA_SHORT_IS_OPAQUE ((color)->alpha_short)
  |  |  ------------------
  |  |  |  |  153|    142|#define CAIRO_ALPHA_SHORT_IS_OPAQUE(alpha) ((alpha) >= 0xff00)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (153:44): [True: 71, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  567|     71|    op_is_source = op_reduces_to_source (extents, no_mask);
  568|     71|    inplace = ! need_clip_mask && op_is_source && no_mask;
  ------------------
  |  Branch (568:15): [True: 71, False: 0]
  |  Branch (568:35): [True: 47, False: 24]
  |  Branch (568:51): [True: 47, False: 0]
  ------------------
  569|       |
  570|     71|    TRACE ((stderr, "%s: op-is-source=%d [op=%d], no-mask=%d, inplace=%d\n",
  571|     71|	    __FUNCTION__, op_is_source, op, no_mask, inplace));
  572|       |
  573|     71|    if (op == CAIRO_OPERATOR_SOURCE && (need_clip_mask || ! no_mask)) {
  ------------------
  |  Branch (573:9): [True: 0, False: 71]
  |  Branch (573:41): [True: 0, False: 0]
  |  Branch (573:59): [True: 0, False: 0]
  ------------------
  574|       |	/* SOURCE with a mask is actually a LERP in cairo semantics */
  575|      0|	if ((compositor->flags & CAIRO_SPANS_COMPOSITOR_HAS_LERP) == 0) {
  ------------------
  |  |   56|      0|#define CAIRO_SPANS_COMPOSITOR_HAS_LERP 0x1
  ------------------
  |  Branch (575:6): [True: 0, False: 0]
  ------------------
  576|      0|	    TRACE ((stderr, "%s: unsupported lerp\n", __FUNCTION__));
  577|      0|	    return CAIRO_INT_STATUS_UNSUPPORTED;
  578|      0|	}
  579|      0|    }
  580|       |
  581|       |    /* Are we just copying a recording surface? */
  582|     71|    if (inplace &&
  ------------------
  |  Branch (582:9): [True: 47, False: 24]
  ------------------
  583|     47|	recording_pattern_contains_sample (&extents->source_pattern.base,
  ------------------
  |  Branch (583:2): [True: 0, False: 47]
  ------------------
  584|     47|					   &extents->source_sample_area))
  585|      0|    {
  586|      0|	cairo_clip_t *recording_clip;
  587|      0|	const cairo_pattern_t *source = &extents->source_pattern.base;
  588|      0|	const cairo_matrix_t *m;
  589|      0|	cairo_matrix_t matrix;
  590|       |
  591|       |	/* XXX could also do tiling repeat modes... */
  592|       |
  593|       |	/* first clear the area about to be overwritten */
  594|      0|	if (! dst->is_clear) {
  ------------------
  |  Branch (594:6): [True: 0, False: 0]
  ------------------
  595|      0|	    status = compositor->fill_boxes (dst,
  596|      0|					     CAIRO_OPERATOR_CLEAR,
  597|      0|					     CAIRO_COLOR_TRANSPARENT,
  ------------------
  |  |  799|      0|#define CAIRO_COLOR_TRANSPARENT _cairo_stock_color (CAIRO_STOCK_TRANSPARENT)
  ------------------
  598|      0|					     boxes);
  599|      0|	    if (unlikely (status))
  ------------------
  |  |  145|      0|#define unlikely(expr) (__builtin_expect (!!(expr), 0))
  |  |  ------------------
  |  |  |  Branch (145:24): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  600|      0|		return status;
  601|       |
  602|      0|	    dst->is_clear = TRUE;
  ------------------
  |  |  106|      0|#define TRUE 1
  ------------------
  603|      0|	}
  604|       |
  605|      0|	m = &source->matrix;
  606|      0|	if (_cairo_surface_has_device_transform (dst)) {
  ------------------
  |  Branch (606:6): [True: 0, False: 0]
  ------------------
  607|      0|	    cairo_matrix_multiply (&matrix,
  608|      0|				   &source->matrix,
  609|      0|				   &dst->device_transform);
  610|      0|	    m = &matrix;
  611|      0|	}
  612|       |
  613|      0|	recording_clip = _cairo_clip_from_boxes (boxes);
  614|      0|	status = _cairo_recording_surface_replay_with_clip (unwrap_source (source),
  615|      0|							    m, dst, recording_clip);
  616|      0|	_cairo_clip_destroy (recording_clip);
  617|       |
  618|      0|	return status;
  619|      0|    }
  620|       |
  621|     71|    status = CAIRO_INT_STATUS_UNSUPPORTED;
  622|     71|    if (! need_clip_mask && no_mask && source->type == CAIRO_PATTERN_TYPE_SOLID) {
  ------------------
  |  Branch (622:9): [True: 71, False: 0]
  |  Branch (622:29): [True: 71, False: 0]
  |  Branch (622:40): [True: 0, False: 71]
  ------------------
  623|      0|	const cairo_color_t *color;
  624|       |
  625|      0|	color = &((cairo_solid_pattern_t *) source)->color;
  626|      0|	if (op_is_source)
  ------------------
  |  Branch (626:6): [True: 0, False: 0]
  ------------------
  627|      0|	    op = CAIRO_OPERATOR_SOURCE;
  628|      0|	status = compositor->fill_boxes (dst, op, color, boxes);
  629|     71|    } else if (inplace && source->type == CAIRO_PATTERN_TYPE_SURFACE) {
  ------------------
  |  Branch (629:16): [True: 47, False: 24]
  |  Branch (629:27): [True: 0, False: 47]
  ------------------
  630|      0|	status = upload_boxes (compositor, extents, boxes);
  631|      0|    }
  632|     71|    if (status == CAIRO_INT_STATUS_UNSUPPORTED) {
  ------------------
  |  Branch (632:9): [True: 71, False: 0]
  ------------------
  633|     71|	cairo_surface_t *src;
  634|     71|	cairo_surface_t *mask = NULL;
  635|     71|	int src_x, src_y;
  636|     71|	int mask_x = 0, mask_y = 0;
  637|       |
  638|       |	/* All typical cases will have been resolved before now... */
  639|     71|	if (need_clip_mask) {
  ------------------
  |  Branch (639:6): [True: 0, False: 71]
  ------------------
  640|      0|	    mask = get_clip_surface (compositor, dst, extents->clip,
  641|      0|				     &extents->bounded);
  642|      0|	    if (unlikely (mask->status))
  ------------------
  |  |  145|      0|#define unlikely(expr) (__builtin_expect (!!(expr), 0))
  |  |  ------------------
  |  |  |  Branch (145:24): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  643|      0|		return mask->status;
  644|       |
  645|      0|	    mask_x = -extents->bounded.x;
  646|      0|	    mask_y = -extents->bounded.y;
  647|      0|	}
  648|       |
  649|       |	/* XXX but this is still ugly */
  650|     71|	if (! no_mask) {
  ------------------
  |  Branch (650:6): [True: 0, False: 71]
  ------------------
  651|      0|	    src = compositor->pattern_to_surface (dst,
  652|      0|						  &extents->mask_pattern.base,
  653|      0|						  TRUE,
  ------------------
  |  |  106|      0|#define TRUE 1
  ------------------
  654|      0|						  &extents->bounded,
  655|      0|						  &extents->mask_sample_area,
  656|      0|						  &src_x, &src_y);
  657|      0|	    if (unlikely (src->status)) {
  ------------------
  |  |  145|      0|#define unlikely(expr) (__builtin_expect (!!(expr), 0))
  |  |  ------------------
  |  |  |  Branch (145:24): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  658|      0|		cairo_surface_destroy (mask);
  659|      0|		return src->status;
  660|      0|	    }
  661|       |
  662|      0|	    if (mask != NULL) {
  ------------------
  |  Branch (662:10): [True: 0, False: 0]
  ------------------
  663|      0|		status = compositor->composite_boxes (mask, CAIRO_OPERATOR_IN,
  664|      0|						      src, NULL,
  665|      0|						      src_x, src_y,
  666|      0|						      0, 0,
  667|      0|						      mask_x, mask_y,
  668|      0|						      boxes, &extents->bounded);
  669|       |
  670|      0|		cairo_surface_destroy (src);
  671|      0|	    } else {
  672|      0|		mask = src;
  673|      0|		mask_x = src_x;
  674|      0|		mask_y = src_y;
  675|      0|	    }
  676|      0|	}
  677|       |
  678|     71|	src = compositor->pattern_to_surface (dst, source, FALSE,
  ------------------
  |  |  102|     71|#define FALSE 0
  ------------------
  679|     71|					      &extents->bounded,
  680|     71|					      &extents->source_sample_area,
  681|     71|					      &src_x, &src_y);
  682|     71|	if (likely (src->status == CAIRO_STATUS_SUCCESS)) {
  ------------------
  |  |  144|     71|#define likely(expr) (__builtin_expect (!!(expr), 1))
  |  |  ------------------
  |  |  |  Branch (144:22): [True: 0, False: 71]
  |  |  ------------------
  ------------------
  683|      0|	    status = compositor->composite_boxes (dst, op, src, mask,
  684|      0|						  src_x, src_y,
  685|      0|						  mask_x, mask_y,
  686|      0|						  0, 0,
  687|      0|						  boxes, &extents->bounded);
  688|      0|	    cairo_surface_destroy (src);
  689|      0|	} else
  690|     71|	    status = src->status;
  691|       |
  692|     71|	cairo_surface_destroy (mask);
  693|     71|    }
  694|       |
  695|     71|    if (status == CAIRO_INT_STATUS_SUCCESS && ! extents->is_bounded)
  ------------------
  |  Branch (695:9): [True: 0, False: 71]
  |  Branch (695:47): [True: 0, False: 0]
  ------------------
  696|      0|	status = fixup_unbounded_boxes (compositor, extents, boxes);
  697|       |
  698|     71|    return status;
  699|     71|}
cairo-spans-compositor.c:_clip_is_region:
  526|     71|{
  527|     71|    int i;
  528|       |
  529|     71|    if (clip->is_region)
  ------------------
  |  Branch (529:9): [True: 71, False: 0]
  ------------------
  530|     71|	return TRUE;
  ------------------
  |  |  106|     71|#define TRUE 1
  ------------------
  531|       |
  532|      0|    if (clip->path)
  ------------------
  |  Branch (532:9): [True: 0, False: 0]
  ------------------
  533|      0|	return FALSE;
  ------------------
  |  |  102|      0|#define FALSE 0
  ------------------
  534|       |
  535|      0|    for (i = 0; i < clip->num_boxes; i++) {
  ------------------
  |  Branch (535:17): [True: 0, False: 0]
  ------------------
  536|      0|	const cairo_box_t *b = &clip->boxes[i];
  537|      0|	if (!_cairo_fixed_is_integer (b->p1.x | b->p1.y |  b->p2.x | b->p2.y))
  ------------------
  |  Branch (537:6): [True: 0, False: 0]
  ------------------
  538|      0|	    return FALSE;
  ------------------
  |  |  102|      0|#define FALSE 0
  ------------------
  539|      0|    }
  540|       |
  541|      0|    return TRUE;
  ------------------
  |  |  106|      0|#define TRUE 1
  ------------------
  542|      0|}
cairo-spans-compositor.c:op_reduces_to_source:
  467|     71|{
  468|     71|    if (extents->op == CAIRO_OPERATOR_SOURCE)
  ------------------
  |  Branch (468:9): [True: 0, False: 71]
  ------------------
  469|      0|	return TRUE;
  ------------------
  |  |  106|      0|#define TRUE 1
  ------------------
  470|       |
  471|     71|    if (extents->surface->is_clear)
  ------------------
  |  Branch (471:9): [True: 0, False: 71]
  ------------------
  472|      0|	return extents->op == CAIRO_OPERATOR_OVER || extents->op == CAIRO_OPERATOR_ADD;
  ------------------
  |  Branch (472:9): [True: 0, False: 0]
  |  Branch (472:47): [True: 0, False: 0]
  ------------------
  473|       |
  474|     71|    if (no_mask && extents->op == CAIRO_OPERATOR_OVER)
  ------------------
  |  Branch (474:9): [True: 71, False: 0]
  |  Branch (474:20): [True: 71, False: 0]
  ------------------
  475|     71|	return _cairo_pattern_is_opaque (&extents->source_pattern.base,
  476|     71|					 &extents->source_sample_area);
  477|       |
  478|      0|    return FALSE;
  ------------------
  |  |  102|      0|#define FALSE 0
  ------------------
  479|     71|}
cairo-spans-compositor.c:recording_pattern_contains_sample:
  448|     47|{
  449|     47|    cairo_recording_surface_t *surface;
  450|       |
  451|     47|    if (! is_recording_pattern (pattern))
  ------------------
  |  Branch (451:9): [True: 47, False: 0]
  ------------------
  452|     47|	return FALSE;
  ------------------
  |  |  102|     47|#define FALSE 0
  ------------------
  453|       |
  454|      0|    if (pattern->extend == CAIRO_EXTEND_NONE)
  ------------------
  |  Branch (454:9): [True: 0, False: 0]
  ------------------
  455|      0|	return TRUE;
  ------------------
  |  |  106|      0|#define TRUE 1
  ------------------
  456|       |
  457|      0|    surface = (cairo_recording_surface_t *) unwrap_source (pattern);
  458|      0|    if (surface->unbounded)
  ------------------
  |  Branch (458:9): [True: 0, False: 0]
  ------------------
  459|      0|	return TRUE;
  ------------------
  |  |  106|      0|#define TRUE 1
  ------------------
  460|       |
  461|      0|    return _cairo_rectangle_contains_rectangle (&surface->extents, sample);
  462|      0|}
cairo-spans-compositor.c:is_recording_pattern:
  435|     47|{
  436|     47|    cairo_surface_t *surface;
  437|       |
  438|     47|    if (pattern->type != CAIRO_PATTERN_TYPE_SURFACE)
  ------------------
  |  Branch (438:9): [True: 47, False: 0]
  ------------------
  439|     47|	return FALSE;
  ------------------
  |  |  102|     47|#define FALSE 0
  ------------------
  440|       |
  441|      0|    surface = ((const cairo_surface_pattern_t *) pattern)->surface;
  442|      0|    return _cairo_surface_is_recording (surface);
  443|     47|}

_cairo_stroke_style_init:
   41|     71|{
   42|     71|    VG (VALGRIND_MAKE_MEM_UNDEFINED (style, sizeof (cairo_stroke_style_t)));
   43|       |
   44|     71|    style->line_width = CAIRO_GSTATE_LINE_WIDTH_DEFAULT;
  ------------------
  |  |  725|     71|#define CAIRO_GSTATE_LINE_WIDTH_DEFAULT	2.0
  ------------------
   45|     71|    style->line_cap = CAIRO_GSTATE_LINE_CAP_DEFAULT;
  ------------------
  |  |  726|     71|#define CAIRO_GSTATE_LINE_CAP_DEFAULT	CAIRO_LINE_CAP_BUTT
  ------------------
   46|     71|    style->line_join = CAIRO_GSTATE_LINE_JOIN_DEFAULT;
  ------------------
  |  |  727|     71|#define CAIRO_GSTATE_LINE_JOIN_DEFAULT	CAIRO_LINE_JOIN_MITER
  ------------------
   47|     71|    style->miter_limit = CAIRO_GSTATE_MITER_LIMIT_DEFAULT;
  ------------------
  |  |  728|     71|#define CAIRO_GSTATE_MITER_LIMIT_DEFAULT	10.0
  ------------------
   48|       |
   49|     71|    style->dash = NULL;
   50|     71|    style->num_dashes = 0;
   51|     71|    style->dash_offset = 0.0;
   52|       |
   53|     71|    style->is_hairline = FALSE;
  ------------------
  |  |  102|     71|#define FALSE 0
  ------------------
   54|     71|}
_cairo_stroke_style_fini:
   92|     71|{
   93|     71|    free (style->dash);
   94|     71|    style->dash = NULL;
   95|       |
   96|     71|    style->num_dashes = 0;
   97|       |
   98|     71|    VG (VALGRIND_MAKE_MEM_UNDEFINED (style, sizeof (cairo_stroke_style_t)));
   99|     71|}

cairo-surface.c:__cairo_surface_flush:
   45|    142|{
   46|    142|    cairo_status_t status = CAIRO_STATUS_SUCCESS;
   47|    142|    if (surface->backend->flush)
  ------------------
  |  Branch (47:9): [True: 0, False: 142]
  ------------------
   48|      0|	status = surface->backend->flush (surface, flags);
   49|    142|    return status;
   50|    142|}

_cairo_surface_set_error:
  193|     71|{
  194|       |    /* NOTHING_TO_DO is magic. We use it to break out of the inner-most
  195|       |     * surface function, but anything higher just sees "success".
  196|       |     */
  197|     71|    if (status == CAIRO_INT_STATUS_NOTHING_TO_DO)
  ------------------
  |  Branch (197:9): [True: 0, False: 71]
  ------------------
  198|      0|	status = CAIRO_INT_STATUS_SUCCESS;
  199|       |
  200|     71|    if (status == CAIRO_INT_STATUS_SUCCESS ||
  ------------------
  |  Branch (200:9): [True: 0, False: 71]
  ------------------
  201|     71|        status >= (int)CAIRO_INT_STATUS_LAST_STATUS)
  ------------------
  |  Branch (201:9): [True: 0, False: 71]
  ------------------
  202|      0|        return status;
  203|       |
  204|       |    /* Don't overwrite an existing error. This preserves the first
  205|       |     * error, which is the most significant. */
  206|     71|    _cairo_status_set_error (&surface->status, (cairo_status_t)status);
  ------------------
  |  |  477|     71|#define _cairo_status_set_error(status, err) do { \
  |  |  478|     71|    int ret__; \
  |  |  479|     71|    assert (err < CAIRO_STATUS_LAST_STATUS); \
  |  |  480|     71|    assert (sizeof(*status) == sizeof(cairo_atomic_int_t)); \
  |  |  481|     71|    /* hide compiler warnings about cairo_status_t != int (gcc treats its as \
  |  |  482|     71|     * an unsigned integer instead, and about ignoring the return value. */  \
  |  |  483|     71|    ret__ = _cairo_atomic_int_cmpxchg ((cairo_atomic_int_t *) status, CAIRO_STATUS_SUCCESS, err); \
  |  |  ------------------
  |  |  |  |   98|     71|  _cairo_atomic_int_cmpxchg_impl(x, oldv, newv)
  |  |  ------------------
  |  |  484|     71|    (void) ret__; \
  |  |  485|     71|} while (0)
  |  |  ------------------
  |  |  |  Branch (485:10): [Folded, False: 71]
  |  |  ------------------
  ------------------
  |  Branch (206:5): [True: 0, False: 71]
  |  Branch (206:5): [True: 71, False: 0]
  |  Branch (206:5): [True: 0, Folded]
  |  Branch (206:5): [True: 71, Folded]
  ------------------
  207|       |
  208|     71|    return _cairo_error (status);
  209|     71|}
cairo_surface_get_content:
  246|     71|{
  247|     71|    return surface->content;
  248|     71|}
cairo_surface_status:
  266|    371|{
  267|    371|    return surface->status;
  268|    371|}
_cairo_surface_begin_modification:
  399|     71|{
  400|     71|    assert (surface->status == CAIRO_STATUS_SUCCESS);
  ------------------
  |  Branch (400:5): [True: 0, False: 71]
  |  Branch (400:5): [True: 71, False: 0]
  ------------------
  401|     71|    assert (! surface->finished);
  ------------------
  |  Branch (401:5): [True: 0, False: 71]
  |  Branch (401:5): [True: 71, False: 0]
  ------------------
  402|       |
  403|     71|    return _cairo_surface_flush (surface, 1);
  404|     71|}
_cairo_surface_init:
  412|     71|{
  413|     71|    CAIRO_MUTEX_INITIALIZE ();
  ------------------
  |  |  173|     71|#define CAIRO_MUTEX_INITIALIZE		CAIRO_MUTEX_IMPL_INITIALIZE
  |  |  ------------------
  |  |  |  |   88|     71|#  define CAIRO_MUTEX_IMPL_INITIALIZE() CAIRO_MUTEX_IMPL_NOOP
  |  |  |  |  ------------------
  |  |  |  |  |  |   53|     71|#define CAIRO_MUTEX_IMPL_NOOP	do {/*no-op*/} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (53:53): [Folded, False: 71]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  414|       |
  415|     71|    surface->backend = backend;
  416|     71|    surface->device = cairo_device_reference (device);
  417|     71|    surface->content = content;
  418|     71|    surface->type = backend->type;
  419|     71|    surface->is_vector = is_vector;
  420|       |
  421|     71|    CAIRO_REFERENCE_COUNT_INIT (&surface->ref_count, 1);
  ------------------
  |  |   51|     71|#define CAIRO_REFERENCE_COUNT_INIT(RC, VALUE) ((RC)->ref_count = (VALUE))
  ------------------
  422|     71|    surface->status = CAIRO_STATUS_SUCCESS;
  423|     71|    surface->unique_id = _cairo_surface_allocate_unique_id ();
  424|     71|    surface->finished = FALSE;
  ------------------
  |  |  102|     71|#define FALSE 0
  ------------------
  425|     71|    surface->_finishing = FALSE;
  ------------------
  |  |  102|     71|#define FALSE 0
  ------------------
  426|     71|    surface->is_clear = FALSE;
  ------------------
  |  |  102|     71|#define FALSE 0
  ------------------
  427|     71|    surface->serial = 0;
  428|     71|    surface->damage = NULL;
  429|     71|    surface->owns_device = (device != NULL);
  430|       |
  431|     71|    _cairo_user_data_array_init (&surface->user_data);
  432|     71|    _cairo_user_data_array_init (&surface->mime_data);
  433|       |
  434|     71|    cairo_matrix_init_identity (&surface->device_transform);
  435|     71|    cairo_matrix_init_identity (&surface->device_transform_inverse);
  436|     71|    cairo_list_init (&surface->device_transform_observers);
  437|       |
  438|     71|    surface->x_resolution = CAIRO_SURFACE_RESOLUTION_DEFAULT;
  ------------------
  |  |  731|     71|#define CAIRO_SURFACE_RESOLUTION_DEFAULT 72.0
  ------------------
  439|     71|    surface->y_resolution = CAIRO_SURFACE_RESOLUTION_DEFAULT;
  ------------------
  |  |  731|     71|#define CAIRO_SURFACE_RESOLUTION_DEFAULT 72.0
  ------------------
  440|       |
  441|     71|    surface->x_fallback_resolution = CAIRO_SURFACE_FALLBACK_RESOLUTION_DEFAULT;
  ------------------
  |  |  732|     71|#define CAIRO_SURFACE_FALLBACK_RESOLUTION_DEFAULT 300.0
  ------------------
  442|     71|    surface->y_fallback_resolution = CAIRO_SURFACE_FALLBACK_RESOLUTION_DEFAULT;
  ------------------
  |  |  732|     71|#define CAIRO_SURFACE_FALLBACK_RESOLUTION_DEFAULT 300.0
  ------------------
  443|       |
  444|     71|    cairo_list_init (&surface->snapshots);
  445|     71|    surface->snapshot_of = NULL;
  446|       |
  447|     71|    surface->has_font_options = FALSE;
  ------------------
  |  |  102|     71|#define FALSE 0
  ------------------
  448|       |
  449|     71|    surface->foreground_source = NULL;
  450|     71|    surface->foreground_used = FALSE;
  ------------------
  |  |  102|     71|#define FALSE 0
  ------------------
  451|     71|}
cairo_surface_reference:
  934|    142|{
  935|    142|    if (surface == NULL ||
  ------------------
  |  Branch (935:9): [True: 0, False: 142]
  ------------------
  936|    142|	    CAIRO_REFERENCE_COUNT_IS_INVALID (&surface->ref_count))
  ------------------
  |  |   58|    142|#define CAIRO_REFERENCE_COUNT_IS_INVALID(RC) (CAIRO_REFERENCE_COUNT_GET_VALUE (RC) == CAIRO_REFERENCE_COUNT_INVALID_VALUE)
  |  |  ------------------
  |  |  |  |   53|    142|#define CAIRO_REFERENCE_COUNT_GET_VALUE(RC) _cairo_atomic_int_get (&(RC)->ref_count)
  |  |  ------------------
  |  |               #define CAIRO_REFERENCE_COUNT_IS_INVALID(RC) (CAIRO_REFERENCE_COUNT_GET_VALUE (RC) == CAIRO_REFERENCE_COUNT_INVALID_VALUE)
  |  |  ------------------
  |  |  |  |   55|    142|#define CAIRO_REFERENCE_COUNT_INVALID_VALUE ((int) -1)
  |  |  ------------------
  |  |  |  Branch (58:46): [True: 0, False: 142]
  |  |  ------------------
  ------------------
  937|      0|	return surface;
  938|       |
  939|    142|    assert (CAIRO_REFERENCE_COUNT_HAS_REFERENCE (&surface->ref_count));
  ------------------
  |  Branch (939:5): [True: 0, False: 142]
  |  Branch (939:5): [True: 142, False: 0]
  ------------------
  940|       |
  941|    142|    _cairo_reference_count_inc (&surface->ref_count);
  ------------------
  |  |   47|    142|#define _cairo_reference_count_inc(RC) _cairo_atomic_int_inc (&(RC)->ref_count)
  |  |  ------------------
  |  |  |  |   83|    142|# define _cairo_atomic_int_inc(x) ((void) atomic_fetch_add_explicit(x, 1, memory_order_seq_cst))
  |  |  ------------------
  ------------------
  942|       |
  943|    142|    return surface;
  944|    142|}
cairo_surface_destroy:
  958|    355|{
  959|    355|    if (surface == NULL ||
  ------------------
  |  Branch (959:9): [True: 142, False: 213]
  ------------------
  960|    213|	    CAIRO_REFERENCE_COUNT_IS_INVALID (&surface->ref_count))
  ------------------
  |  |   58|    213|#define CAIRO_REFERENCE_COUNT_IS_INVALID(RC) (CAIRO_REFERENCE_COUNT_GET_VALUE (RC) == CAIRO_REFERENCE_COUNT_INVALID_VALUE)
  |  |  ------------------
  |  |  |  |   53|    213|#define CAIRO_REFERENCE_COUNT_GET_VALUE(RC) _cairo_atomic_int_get (&(RC)->ref_count)
  |  |  ------------------
  |  |               #define CAIRO_REFERENCE_COUNT_IS_INVALID(RC) (CAIRO_REFERENCE_COUNT_GET_VALUE (RC) == CAIRO_REFERENCE_COUNT_INVALID_VALUE)
  |  |  ------------------
  |  |  |  |   55|    213|#define CAIRO_REFERENCE_COUNT_INVALID_VALUE ((int) -1)
  |  |  ------------------
  |  |  |  Branch (58:46): [True: 0, False: 213]
  |  |  ------------------
  ------------------
  961|    142|	return;
  962|       |
  963|    355|    assert (CAIRO_REFERENCE_COUNT_HAS_REFERENCE (&surface->ref_count));
  ------------------
  |  Branch (963:5): [True: 0, False: 213]
  |  Branch (963:5): [True: 213, False: 0]
  ------------------
  964|       |
  965|    213|    if (! _cairo_reference_count_dec_and_test (&surface->ref_count))
  ------------------
  |  |   49|    213|#define _cairo_reference_count_dec_and_test(RC) _cairo_atomic_int_dec_and_test (&(RC)->ref_count)
  |  |  ------------------
  |  |  |  |   85|    213|# define _cairo_atomic_int_dec_and_test(x) (atomic_fetch_sub_explicit(x, 1, memory_order_seq_cst) == 1)
  |  |  ------------------
  ------------------
  |  Branch (965:9): [True: 142, False: 71]
  ------------------
  966|    142|	return;
  967|       |
  968|    213|    assert (surface->snapshot_of == NULL);
  ------------------
  |  Branch (968:5): [True: 0, False: 71]
  |  Branch (968:5): [True: 71, False: 0]
  ------------------
  969|       |
  970|     71|    if (! surface->finished) {
  ------------------
  |  Branch (970:9): [True: 71, False: 0]
  ------------------
  971|     71|	_cairo_surface_finish_snapshots (surface);
  972|       |	/* We may have been referenced by a snapshot prior to have
  973|       |	 * detaching it with the copy-on-write.
  974|       |	 */
  975|     71|	if (CAIRO_REFERENCE_COUNT_GET_VALUE (&surface->ref_count))
  ------------------
  |  |   53|     71|#define CAIRO_REFERENCE_COUNT_GET_VALUE(RC) _cairo_atomic_int_get (&(RC)->ref_count)
  |  |  ------------------
  |  |  |  Branch (53:45): [True: 0, False: 71]
  |  |  ------------------
  ------------------
  976|      0|	    return;
  977|       |
  978|     71|	_cairo_surface_finish (surface);
  979|     71|    }
  980|       |
  981|     71|    if (surface->damage)
  ------------------
  |  Branch (981:9): [True: 0, False: 71]
  ------------------
  982|      0|	_cairo_damage_destroy (surface->damage);
  983|       |
  984|     71|    _cairo_user_data_array_fini (&surface->user_data);
  985|     71|    _cairo_user_data_array_fini (&surface->mime_data);
  986|       |
  987|     71|    if (surface->foreground_source)
  ------------------
  |  Branch (987:9): [True: 0, False: 71]
  ------------------
  988|      0|	cairo_pattern_destroy (surface->foreground_source);
  989|       |
  990|     71|    if (surface->owns_device)
  ------------------
  |  Branch (990:9): [True: 0, False: 71]
  ------------------
  991|      0|        cairo_device_destroy (surface->device);
  992|       |
  993|     71|    if (surface->has_font_options)
  ------------------
  |  Branch (993:9): [True: 0, False: 71]
  ------------------
  994|      0|	_cairo_font_options_fini (&surface->font_options);
  995|       |
  996|     71|    assert (surface->snapshot_of == NULL);
  ------------------
  |  Branch (996:5): [True: 0, False: 71]
  |  Branch (996:5): [True: 71, False: 0]
  ------------------
  997|     71|    assert (! _cairo_surface_has_snapshots (surface));
  ------------------
  |  Branch (997:5): [True: 0, False: 71]
  |  Branch (997:5): [True: 71, False: 0]
  ------------------
  998|       |    /* paranoid check that nobody took a reference whilst finishing */
  999|     71|    assert (! CAIRO_REFERENCE_COUNT_HAS_REFERENCE (&surface->ref_count));
  ------------------
  |  Branch (999:5): [True: 0, False: 71]
  |  Branch (999:5): [True: 71, False: 0]
  ------------------
 1000|       |
 1001|     71|    free (surface);
 1002|     71|}
cairo_surface_set_mime_data:
 1432|     71|{
 1433|     71|    cairo_status_t status;
 1434|     71|    cairo_mime_data_t *mime_data;
 1435|       |
 1436|     71|    if (CAIRO_REFERENCE_COUNT_IS_INVALID (&surface->ref_count))
  ------------------
  |  |   58|     71|#define CAIRO_REFERENCE_COUNT_IS_INVALID(RC) (CAIRO_REFERENCE_COUNT_GET_VALUE (RC) == CAIRO_REFERENCE_COUNT_INVALID_VALUE)
  |  |  ------------------
  |  |  |  |   53|     71|#define CAIRO_REFERENCE_COUNT_GET_VALUE(RC) _cairo_atomic_int_get (&(RC)->ref_count)
  |  |  ------------------
  |  |               #define CAIRO_REFERENCE_COUNT_IS_INVALID(RC) (CAIRO_REFERENCE_COUNT_GET_VALUE (RC) == CAIRO_REFERENCE_COUNT_INVALID_VALUE)
  |  |  ------------------
  |  |  |  |   55|     71|#define CAIRO_REFERENCE_COUNT_INVALID_VALUE ((int) -1)
  |  |  ------------------
  |  |  |  Branch (58:46): [True: 0, False: 71]
  |  |  ------------------
  ------------------
 1437|      0|	return surface->status;
 1438|       |
 1439|     71|    if (! CAIRO_REFERENCE_COUNT_HAS_REFERENCE (&surface->ref_count))
  ------------------
  |  |   60|     71|#define CAIRO_REFERENCE_COUNT_HAS_REFERENCE(RC) (CAIRO_REFERENCE_COUNT_GET_VALUE (RC) > 0)
  |  |  ------------------
  |  |  |  |   53|     71|#define CAIRO_REFERENCE_COUNT_GET_VALUE(RC) _cairo_atomic_int_get (&(RC)->ref_count)
  |  |  ------------------
  ------------------
  |  Branch (1439:9): [True: 0, False: 71]
  ------------------
 1440|      0|	return _cairo_error (CAIRO_STATUS_SURFACE_FINISHED);
 1441|       |
 1442|     71|    if (unlikely (surface->status))
  ------------------
  |  |  145|     71|#define unlikely(expr) (__builtin_expect (!!(expr), 0))
  |  |  ------------------
  |  |  |  Branch (145:24): [True: 0, False: 71]
  |  |  ------------------
  ------------------
 1443|      0|	return surface->status;
 1444|     71|    if (unlikely (surface->finished))
  ------------------
  |  |  145|     71|#define unlikely(expr) (__builtin_expect (!!(expr), 0))
  |  |  ------------------
  |  |  |  Branch (145:24): [True: 0, False: 71]
  |  |  ------------------
  ------------------
 1445|      0|	return _cairo_surface_set_error (surface, _cairo_error (CAIRO_STATUS_SURFACE_FINISHED));
 1446|       |
 1447|     71|    status = _cairo_intern_string (&mime_type, -1);
 1448|     71|    if (unlikely (status))
  ------------------
  |  |  145|     71|#define unlikely(expr) (__builtin_expect (!!(expr), 0))
  |  |  ------------------
  |  |  |  Branch (145:24): [True: 0, False: 71]
  |  |  ------------------
  ------------------
 1449|      0|	return _cairo_surface_set_error (surface, status);
 1450|       |
 1451|     71|    if (data != NULL) {
  ------------------
  |  Branch (1451:9): [True: 71, False: 0]
  ------------------
 1452|     71|	mime_data = _cairo_calloc (sizeof (cairo_mime_data_t));
  ------------------
  |  |   79|     71|    ((size) != 0 ? calloc(1,size) : NULL)
  |  |  ------------------
  |  |  |  Branch (79:6): [True: 71, Folded]
  |  |  ------------------
  ------------------
 1453|     71|	if (unlikely (mime_data == NULL))
  ------------------
  |  |  145|     71|#define unlikely(expr) (__builtin_expect (!!(expr), 0))
  |  |  ------------------
  |  |  |  Branch (145:24): [True: 0, False: 71]
  |  |  ------------------
  ------------------
 1454|      0|	    return _cairo_surface_set_error (surface, _cairo_error (CAIRO_STATUS_NO_MEMORY));
 1455|       |
 1456|     71|	CAIRO_REFERENCE_COUNT_INIT (&mime_data->ref_count, 1);
  ------------------
  |  |   51|     71|#define CAIRO_REFERENCE_COUNT_INIT(RC, VALUE) ((RC)->ref_count = (VALUE))
  ------------------
 1457|       |
 1458|     71|	mime_data->data = (unsigned char *) data;
 1459|     71|	mime_data->length = length;
 1460|     71|	mime_data->destroy = destroy;
 1461|     71|	mime_data->closure = closure;
 1462|     71|    } else
 1463|      0|	mime_data = NULL;
 1464|       |
 1465|     71|    status = _cairo_user_data_array_set_data (&surface->mime_data,
 1466|     71|					      (cairo_user_data_key_t *) mime_type,
 1467|     71|					      mime_data,
 1468|     71|					      _cairo_mime_data_destroy);
 1469|     71|    if (unlikely (status)) {
  ------------------
  |  |  145|     71|#define unlikely(expr) (__builtin_expect (!!(expr), 0))
  |  |  ------------------
  |  |  |  Branch (145:24): [True: 0, False: 71]
  |  |  ------------------
  ------------------
 1470|      0|	free (mime_data);
 1471|       |
 1472|      0|	return _cairo_surface_set_error (surface, status);
 1473|      0|    }
 1474|       |
 1475|     71|    surface->is_clear = FALSE;
  ------------------
  |  |  102|     71|#define FALSE 0
  ------------------
 1476|       |
 1477|     71|    return CAIRO_STATUS_SUCCESS;
 1478|     71|}
_cairo_surface_flush:
 1632|    142|{
 1633|       |    /* update the current snapshots *before* the user updates the surface */
 1634|    142|    _cairo_surface_detach_snapshots (surface);
 1635|    142|    if (surface->snapshot_of != NULL)
  ------------------
  |  Branch (1635:9): [True: 0, False: 142]
  ------------------
 1636|      0|	_cairo_surface_detach_snapshot (surface);
 1637|    142|    _cairo_surface_detach_mime_data (surface);
 1638|       |
 1639|    142|    return __cairo_surface_flush (surface, flags);
 1640|    142|}
_cairo_surface_has_device_transform:
 2018|     71|{
 2019|     71|    return ! _cairo_matrix_is_identity (&surface->device_transform);
 2020|     71|}
_cairo_surface_paint:
 2175|     71|{
 2176|     71|    cairo_int_status_t status;
 2177|     71|    cairo_bool_t is_clear;
 2178|       |
 2179|     71|    TRACE ((stderr, "%s\n", __FUNCTION__));
 2180|     71|    if (unlikely (surface->status))
  ------------------
  |  |  145|     71|#define unlikely(expr) (__builtin_expect (!!(expr), 0))
  |  |  ------------------
  |  |  |  Branch (145:24): [True: 0, False: 71]
  |  |  ------------------
  ------------------
 2181|      0|	return surface->status;
 2182|     71|    if (unlikely (surface->finished))
  ------------------
  |  |  145|     71|#define unlikely(expr) (__builtin_expect (!!(expr), 0))
  |  |  ------------------
  |  |  |  Branch (145:24): [True: 0, False: 71]
  |  |  ------------------
  ------------------
 2183|      0|	return _cairo_surface_set_error (surface, _cairo_error (CAIRO_STATUS_SURFACE_FINISHED));
 2184|       |
 2185|     71|    if (_cairo_clip_is_all_clipped (clip))
  ------------------
  |  Branch (2185:9): [True: 0, False: 71]
  ------------------
 2186|      0|	return CAIRO_STATUS_SUCCESS;
 2187|       |
 2188|     71|    status = _pattern_has_error (source);
 2189|     71|    if (unlikely (status))
  ------------------
  |  |  145|     71|#define unlikely(expr) (__builtin_expect (!!(expr), 0))
  |  |  ------------------
  |  |  |  Branch (145:24): [True: 0, False: 71]
  |  |  ------------------
  ------------------
 2190|      0|	return status;
 2191|       |
 2192|     71|    if (nothing_to_do (surface, op, source))
  ------------------
  |  Branch (2192:9): [True: 0, False: 71]
  ------------------
 2193|      0|	return CAIRO_STATUS_SUCCESS;
 2194|       |
 2195|     71|    status = _cairo_surface_begin_modification (surface);
 2196|     71|    if (unlikely (status))
  ------------------
  |  |  145|     71|#define unlikely(expr) (__builtin_expect (!!(expr), 0))
  |  |  ------------------
  |  |  |  Branch (145:24): [True: 0, False: 71]
  |  |  ------------------
  ------------------
 2197|      0|	return status;
 2198|       |
 2199|     71|    if (source->is_foreground_marker && surface->foreground_source) {
  ------------------
  |  Branch (2199:9): [True: 0, False: 71]
  |  Branch (2199:41): [True: 0, False: 0]
  ------------------
 2200|      0|	source = surface->foreground_source;
 2201|      0|	surface->foreground_used = TRUE;
  ------------------
  |  |  106|      0|#define TRUE 1
  ------------------
 2202|      0|    }
 2203|       |
 2204|     71|    status = surface->backend->paint (surface, op, source, clip);
 2205|     71|    is_clear = op == CAIRO_OPERATOR_CLEAR && clip == NULL;
  ------------------
  |  Branch (2205:16): [True: 0, False: 71]
  |  Branch (2205:46): [True: 0, False: 0]
  ------------------
 2206|     71|    if (status != CAIRO_INT_STATUS_NOTHING_TO_DO || is_clear) {
  ------------------
  |  Branch (2206:9): [True: 71, False: 0]
  |  Branch (2206:53): [True: 0, False: 0]
  ------------------
 2207|     71|	surface->is_clear = is_clear;
 2208|     71|	surface->serial++;
 2209|     71|    }
 2210|       |
 2211|     71|    return _cairo_surface_set_error (surface, status);
 2212|     71|}
_cairo_surface_get_extents:
 2565|     71|{
 2566|     71|    cairo_bool_t bounded;
 2567|       |
 2568|     71|    if (unlikely (surface->status))
  ------------------
  |  |  145|     71|#define unlikely(expr) (__builtin_expect (!!(expr), 0))
  |  |  ------------------
  |  |  |  Branch (145:24): [True: 0, False: 71]
  |  |  ------------------
  ------------------
 2569|      0|	goto zero_extents;
 2570|     71|    if (unlikely (surface->finished)) {
  ------------------
  |  |  145|     71|#define unlikely(expr) (__builtin_expect (!!(expr), 0))
  |  |  ------------------
  |  |  |  Branch (145:24): [True: 0, False: 71]
  |  |  ------------------
  ------------------
 2571|      0|	_cairo_surface_set_error(surface, CAIRO_STATUS_SURFACE_FINISHED);
 2572|      0|	goto zero_extents;
 2573|      0|    }
 2574|       |
 2575|     71|    bounded = FALSE;
  ------------------
  |  |  102|     71|#define FALSE 0
  ------------------
 2576|     71|    if (surface->backend->get_extents != NULL)
  ------------------
  |  Branch (2576:9): [True: 71, False: 0]
  ------------------
 2577|     71|	bounded = surface->backend->get_extents (surface, extents);
 2578|       |
 2579|     71|    if (! bounded)
  ------------------
  |  Branch (2579:9): [True: 0, False: 71]
  ------------------
 2580|      0|	_cairo_unbounded_rectangle_init (extents);
 2581|       |
 2582|     71|    return bounded;
 2583|       |
 2584|      0|zero_extents:
 2585|      0|    extents->x = extents->y = 0;
 2586|      0|    extents->width = extents->height = 0;
 2587|      0|    return TRUE;
  ------------------
  |  |  106|      0|#define TRUE 1
  ------------------
 2588|     71|}
_cairo_surface_create_in_error:
 3106|    442|{
 3107|    442|    assert (status < CAIRO_STATUS_LAST_STATUS);
  ------------------
  |  Branch (3107:5): [True: 0, False: 442]
  |  Branch (3107:5): [True: 442, False: 0]
  ------------------
 3108|    442|    switch (status) {
 3109|     71|    case CAIRO_STATUS_NO_MEMORY:
  ------------------
  |  Branch (3109:5): [True: 71, False: 371]
  ------------------
 3110|     71|	return (cairo_surface_t *) &_cairo_surface_nil;
 3111|      0|    case CAIRO_STATUS_SURFACE_TYPE_MISMATCH:
  ------------------
  |  Branch (3111:5): [True: 0, False: 442]
  ------------------
 3112|      0|	return (cairo_surface_t *) &_cairo_surface_nil_surface_type_mismatch;
 3113|      0|    case CAIRO_STATUS_INVALID_STATUS:
  ------------------
  |  Branch (3113:5): [True: 0, False: 442]
  ------------------
 3114|      0|	return (cairo_surface_t *) &_cairo_surface_nil_invalid_status;
 3115|      0|    case CAIRO_STATUS_INVALID_CONTENT:
  ------------------
  |  Branch (3115:5): [True: 0, False: 442]
  ------------------
 3116|      0|	return (cairo_surface_t *) &_cairo_surface_nil_invalid_content;
 3117|      0|    case CAIRO_STATUS_INVALID_FORMAT:
  ------------------
  |  Branch (3117:5): [True: 0, False: 442]
  ------------------
 3118|      0|	return (cairo_surface_t *) &_cairo_surface_nil_invalid_format;
 3119|      0|    case CAIRO_STATUS_INVALID_VISUAL:
  ------------------
  |  Branch (3119:5): [True: 0, False: 442]
  ------------------
 3120|      0|	return (cairo_surface_t *) &_cairo_surface_nil_invalid_visual;
 3121|    208|    case CAIRO_STATUS_READ_ERROR:
  ------------------
  |  Branch (3121:5): [True: 208, False: 234]
  ------------------
 3122|    208|	return (cairo_surface_t *) &_cairo_surface_nil_read_error;
 3123|      0|    case CAIRO_STATUS_WRITE_ERROR:
  ------------------
  |  Branch (3123:5): [True: 0, False: 442]
  ------------------
 3124|      0|	return (cairo_surface_t *) &_cairo_surface_nil_write_error;
 3125|     71|    case CAIRO_STATUS_FILE_NOT_FOUND:
  ------------------
  |  Branch (3125:5): [True: 71, False: 371]
  ------------------
 3126|     71|	return (cairo_surface_t *) &_cairo_surface_nil_file_not_found;
 3127|      0|    case CAIRO_STATUS_TEMP_FILE_ERROR:
  ------------------
  |  Branch (3127:5): [True: 0, False: 442]
  ------------------
 3128|      0|	return (cairo_surface_t *) &_cairo_surface_nil_temp_file_error;
 3129|      0|    case CAIRO_STATUS_INVALID_STRIDE:
  ------------------
  |  Branch (3129:5): [True: 0, False: 442]
  ------------------
 3130|      0|	return (cairo_surface_t *) &_cairo_surface_nil_invalid_stride;
 3131|      2|    case CAIRO_STATUS_INVALID_SIZE:
  ------------------
  |  Branch (3131:5): [True: 2, False: 440]
  ------------------
 3132|      2|	return (cairo_surface_t *) &_cairo_surface_nil_invalid_size;
 3133|      0|    case CAIRO_STATUS_DEVICE_TYPE_MISMATCH:
  ------------------
  |  Branch (3133:5): [True: 0, False: 442]
  ------------------
 3134|      0|	return (cairo_surface_t *) &_cairo_surface_nil_device_type_mismatch;
 3135|      0|    case CAIRO_STATUS_DEVICE_ERROR:
  ------------------
  |  Branch (3135:5): [True: 0, False: 442]
  ------------------
 3136|      0|	return (cairo_surface_t *) &_cairo_surface_nil_device_error;
 3137|     90|    case CAIRO_STATUS_PNG_ERROR:
  ------------------
  |  Branch (3137:5): [True: 90, False: 352]
  ------------------
 3138|     90|	return (cairo_surface_t *) &_cairo_surface_nil_png_error;
 3139|      0|    case CAIRO_STATUS_SUCCESS:
  ------------------
  |  Branch (3139:5): [True: 0, False: 442]
  ------------------
 3140|      0|    case CAIRO_STATUS_LAST_STATUS:
  ------------------
  |  Branch (3140:5): [True: 0, False: 442]
  ------------------
 3141|      0|	ASSERT_NOT_REACHED;
  ------------------
  |  |  140|      0|#define ASSERT_NOT_REACHED		\
  |  |  141|      0|do {					\
  |  |  142|      0|    assert (!"reached");		\
  |  |  143|      0|} while (0)
  |  |  ------------------
  |  |  |  Branch (143:10): [Folded, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (3141:2): [Folded, False: 0]
  |  Branch (3141:2): [Folded, False: 0]
  ------------------
 3142|       |	/* fall-through */
 3143|      0|    case CAIRO_STATUS_INVALID_RESTORE:
  ------------------
  |  Branch (3143:5): [True: 0, False: 442]
  ------------------
 3144|      0|    case CAIRO_STATUS_INVALID_POP_GROUP:
  ------------------
  |  Branch (3144:5): [True: 0, False: 442]
  ------------------
 3145|      0|    case CAIRO_STATUS_NO_CURRENT_POINT:
  ------------------
  |  Branch (3145:5): [True: 0, False: 442]
  ------------------
 3146|      0|    case CAIRO_STATUS_INVALID_MATRIX:
  ------------------
  |  Branch (3146:5): [True: 0, False: 442]
  ------------------
 3147|      0|    case CAIRO_STATUS_NULL_POINTER:
  ------------------
  |  Branch (3147:5): [True: 0, False: 442]
  ------------------
 3148|      0|    case CAIRO_STATUS_INVALID_STRING:
  ------------------
  |  Branch (3148:5): [True: 0, False: 442]
  ------------------
 3149|      0|    case CAIRO_STATUS_INVALID_PATH_DATA:
  ------------------
  |  Branch (3149:5): [True: 0, False: 442]
  ------------------
 3150|      0|    case CAIRO_STATUS_SURFACE_FINISHED:
  ------------------
  |  Branch (3150:5): [True: 0, False: 442]
  ------------------
 3151|      0|    case CAIRO_STATUS_PATTERN_TYPE_MISMATCH:
  ------------------
  |  Branch (3151:5): [True: 0, False: 442]
  ------------------
 3152|      0|    case CAIRO_STATUS_INVALID_DASH:
  ------------------
  |  Branch (3152:5): [True: 0, False: 442]
  ------------------
 3153|      0|    case CAIRO_STATUS_INVALID_DSC_COMMENT:
  ------------------
  |  Branch (3153:5): [True: 0, False: 442]
  ------------------
 3154|      0|    case CAIRO_STATUS_INVALID_INDEX:
  ------------------
  |  Branch (3154:5): [True: 0, False: 442]
  ------------------
 3155|      0|    case CAIRO_STATUS_CLIP_NOT_REPRESENTABLE:
  ------------------
  |  Branch (3155:5): [True: 0, False: 442]
  ------------------
 3156|      0|    case CAIRO_STATUS_FONT_TYPE_MISMATCH:
  ------------------
  |  Branch (3156:5): [True: 0, False: 442]
  ------------------
 3157|      0|    case CAIRO_STATUS_USER_FONT_IMMUTABLE:
  ------------------
  |  Branch (3157:5): [True: 0, False: 442]
  ------------------
 3158|      0|    case CAIRO_STATUS_USER_FONT_ERROR:
  ------------------
  |  Branch (3158:5): [True: 0, False: 442]
  ------------------
 3159|      0|    case CAIRO_STATUS_NEGATIVE_COUNT:
  ------------------
  |  Branch (3159:5): [True: 0, False: 442]
  ------------------
 3160|      0|    case CAIRO_STATUS_INVALID_CLUSTERS:
  ------------------
  |  Branch (3160:5): [True: 0, False: 442]
  ------------------
 3161|      0|    case CAIRO_STATUS_INVALID_SLANT:
  ------------------
  |  Branch (3161:5): [True: 0, False: 442]
  ------------------
 3162|      0|    case CAIRO_STATUS_INVALID_WEIGHT:
  ------------------
  |  Branch (3162:5): [True: 0, False: 442]
  ------------------
 3163|      0|    case CAIRO_STATUS_USER_FONT_NOT_IMPLEMENTED:
  ------------------
  |  Branch (3163:5): [True: 0, False: 442]
  ------------------
 3164|      0|    case CAIRO_STATUS_INVALID_MESH_CONSTRUCTION:
  ------------------
  |  Branch (3164:5): [True: 0, False: 442]
  ------------------
 3165|      0|    case CAIRO_STATUS_DEVICE_FINISHED:
  ------------------
  |  Branch (3165:5): [True: 0, False: 442]
  ------------------
 3166|      0|    case CAIRO_STATUS_JBIG2_GLOBAL_MISSING:
  ------------------
  |  Branch (3166:5): [True: 0, False: 442]
  ------------------
 3167|      0|    case CAIRO_STATUS_FREETYPE_ERROR:
  ------------------
  |  Branch (3167:5): [True: 0, False: 442]
  ------------------
 3168|      0|    case CAIRO_STATUS_WIN32_GDI_ERROR:
  ------------------
  |  Branch (3168:5): [True: 0, False: 442]
  ------------------
 3169|      0|    case CAIRO_INT_STATUS_DWRITE_ERROR:
  ------------------
  |  Branch (3169:5): [True: 0, False: 442]
  ------------------
 3170|      0|    case CAIRO_STATUS_TAG_ERROR:
  ------------------
  |  Branch (3170:5): [True: 0, False: 442]
  ------------------
 3171|      0|    case CAIRO_STATUS_SVG_FONT_ERROR:
  ------------------
  |  Branch (3171:5): [True: 0, False: 442]
  ------------------
 3172|      0|    default:
  ------------------
  |  Branch (3172:5): [True: 0, False: 442]
  ------------------
 3173|      0|	_cairo_error_throw (CAIRO_STATUS_NO_MEMORY);
  ------------------
  |  |  126|      0|#define _cairo_error_throw(status) do { \
  |  |  127|      0|    cairo_status_t status__ = _cairo_error (status); \
  |  |  128|      0|    (void) status__; \
  |  |  129|      0|} while (0)
  |  |  ------------------
  |  |  |  Branch (129:10): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3174|      0|	return (cairo_surface_t *) &_cairo_surface_nil;
 3175|    442|    }
 3176|    442|}
cairo-surface.c:_cairo_surface_allocate_unique_id:
  272|     71|{
  273|     71|    static cairo_atomic_int_t unique_id;
  274|       |
  275|       |#if CAIRO_NO_MUTEX
  276|       |    if (++unique_id == 0)
  277|       |	unique_id = 1;
  278|       |    return unique_id;
  279|       |#else
  280|     71|    int old, id;
  281|       |
  282|     71|    do {
  283|     71|	old = _cairo_atomic_uint_get (&unique_id);
  ------------------
  |  |  473|     71|#define _cairo_atomic_uint_get(x) _cairo_atomic_int_get(x)
  ------------------
  284|     71|	id = old + 1;
  285|     71|	if (id == 0)
  ------------------
  |  Branch (285:6): [True: 0, False: 71]
  ------------------
  286|      0|	    id = 1;
  287|     71|    } while (! _cairo_atomic_uint_cmpxchg (&unique_id, old, id));
  ------------------
  |  |  475|     71|    _cairo_atomic_int_cmpxchg((cairo_atomic_int_t *)x, oldv, newv)
  |  |  ------------------
  |  |  |  |   98|     71|  _cairo_atomic_int_cmpxchg_impl(x, oldv, newv)
  |  |  ------------------
  ------------------
  |  Branch (287:14): [True: 0, False: 71]
  ------------------
  288|       |
  289|     71|    return id;
  290|     71|#endif
  291|     71|}
cairo-surface.c:_cairo_surface_has_snapshots:
  316|    284|{
  317|    284|    return ! cairo_list_is_empty (&surface->snapshots);
  318|    284|}
cairo-surface.c:_cairo_surface_finish_snapshots:
 1027|     71|{
 1028|     71|    cairo_status_t status;
 1029|       |
 1030|       |    /* update the snapshots *before* we declare the surface as finished */
 1031|     71|    surface->_finishing = TRUE;
  ------------------
  |  |  106|     71|#define TRUE 1
  ------------------
 1032|     71|    status = _cairo_surface_flush (surface, 0);
 1033|     71|    (void) status;
 1034|     71|}
cairo-surface.c:_cairo_surface_finish:
 1038|     71|{
 1039|     71|    cairo_status_t status;
 1040|       |
 1041|       |    /* call finish even if in error mode */
 1042|     71|    if (surface->backend->finish) {
  ------------------
  |  Branch (1042:9): [True: 71, False: 0]
  ------------------
 1043|     71|	status = surface->backend->finish (surface);
 1044|     71|	if (unlikely (status))
  ------------------
  |  |  145|     71|#define unlikely(expr) (__builtin_expect (!!(expr), 0))
  |  |  ------------------
  |  |  |  Branch (145:24): [True: 0, False: 71]
  |  |  ------------------
  ------------------
 1045|      0|	    _cairo_surface_set_error (surface, status);
 1046|     71|    }
 1047|       |
 1048|     71|    surface->finished = TRUE;
  ------------------
  |  |  106|     71|#define TRUE 1
  ------------------
 1049|       |
 1050|     71|    assert (surface->snapshot_of == NULL);
  ------------------
  |  Branch (1050:5): [True: 0, False: 71]
  |  Branch (1050:5): [True: 71, False: 0]
  ------------------
 1051|     71|    assert (!_cairo_surface_has_snapshots (surface));
  ------------------
  |  Branch (1051:5): [True: 0, False: 71]
  |  Branch (1051:5): [True: 71, False: 0]
  ------------------
 1052|     71|}
cairo-surface.c:_cairo_mime_data_destroy:
 1226|     71|{
 1227|     71|    cairo_mime_data_t *mime_data = ptr;
 1228|       |
 1229|     71|    if (! _cairo_reference_count_dec_and_test (&mime_data->ref_count))
  ------------------
  |  |   49|     71|#define _cairo_reference_count_dec_and_test(RC) _cairo_atomic_int_dec_and_test (&(RC)->ref_count)
  |  |  ------------------
  |  |  |  |   85|     71|# define _cairo_atomic_int_dec_and_test(x) (atomic_fetch_sub_explicit(x, 1, memory_order_seq_cst) == 1)
  |  |  ------------------
  ------------------
  |  Branch (1229:9): [True: 0, False: 71]
  ------------------
 1230|      0|	return;
 1231|       |
 1232|     71|    if (mime_data->destroy && mime_data->closure)
  ------------------
  |  Branch (1232:9): [True: 71, False: 0]
  |  Branch (1232:31): [True: 71, False: 0]
  ------------------
 1233|     71|	mime_data->destroy (mime_data->closure);
 1234|       |
 1235|     71|    free (mime_data);
 1236|     71|}
cairo-surface.c:_cairo_surface_detach_snapshots:
  338|    142|{
  339|    142|    while (_cairo_surface_has_snapshots (surface)) {
  ------------------
  |  Branch (339:12): [True: 0, False: 142]
  ------------------
  340|       |	_cairo_surface_detach_snapshot (cairo_list_first_entry (&surface->snapshots,
  ------------------
  |  |   54|      0|	cairo_list_entry((ptr)->next, type, member)
  |  |  ------------------
  |  |  |  |   51|      0|	cairo_container_of(ptr, type, member)
  |  |  |  |  ------------------
  |  |  |  |  |  |  130|      0|#define cairo_container_of(ptr, type, member) ({ \
  |  |  |  |  |  |  131|      0|    const __typeof__ (((type *) 0)->member) *mptr__ = (ptr); \
  |  |  |  |  |  |  132|      0|    (type *) ((char *) mptr__ - offsetof (type, member)); \
  |  |  |  |  |  |  133|      0|})
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  341|      0|								cairo_surface_t,
  342|      0|								snapshot));
  343|      0|    }
  344|    142|}
cairo-surface.c:_cairo_surface_detach_mime_data:
  328|    142|{
  329|    142|    if (! _cairo_surface_has_mime_data (surface))
  ------------------
  |  Branch (329:9): [True: 71, False: 71]
  ------------------
  330|     71|	return;
  331|       |
  332|     71|    _cairo_user_data_array_fini (&surface->mime_data);
  333|     71|    _cairo_user_data_array_init (&surface->mime_data);
  334|     71|}
cairo-surface.c:_cairo_surface_has_mime_data:
  322|    142|{
  323|    142|    return surface->mime_data.num_elements != 0;
  324|    142|}
cairo-surface.c:_pattern_has_error:
 2129|     71|{
 2130|     71|    const cairo_surface_pattern_t *spattern;
 2131|       |
 2132|     71|    if (unlikely (pattern->status))
  ------------------
  |  |  145|     71|#define unlikely(expr) (__builtin_expect (!!(expr), 0))
  |  |  ------------------
  |  |  |  Branch (145:24): [True: 0, False: 71]
  |  |  ------------------
  ------------------
 2133|      0|	return pattern->status;
 2134|       |
 2135|     71|    if (pattern->type != CAIRO_PATTERN_TYPE_SURFACE)
  ------------------
  |  Branch (2135:9): [True: 71, False: 0]
  ------------------
 2136|     71|	return CAIRO_STATUS_SUCCESS;
 2137|       |
 2138|      0|    spattern = (const cairo_surface_pattern_t *) pattern;
 2139|      0|    if (unlikely (spattern->surface->status))
  ------------------
  |  |  145|      0|#define unlikely(expr) (__builtin_expect (!!(expr), 0))
  |  |  ------------------
  |  |  |  Branch (145:24): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2140|      0|	return spattern->surface->status;
 2141|       |
 2142|      0|    if (unlikely (spattern->surface->finished))
  ------------------
  |  |  145|      0|#define unlikely(expr) (__builtin_expect (!!(expr), 0))
  |  |  ------------------
  |  |  |  Branch (145:24): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2143|      0|	return _cairo_error (CAIRO_STATUS_SURFACE_FINISHED);
 2144|       |
 2145|      0|    return CAIRO_STATUS_SUCCESS;
 2146|      0|}
cairo-surface.c:nothing_to_do:
 2152|     71|{
 2153|     71|    if (_cairo_pattern_is_clear (source)) {
  ------------------
  |  Branch (2153:9): [True: 0, False: 71]
  ------------------
 2154|      0|	if (op == CAIRO_OPERATOR_OVER || op == CAIRO_OPERATOR_ADD)
  ------------------
  |  Branch (2154:6): [True: 0, False: 0]
  |  Branch (2154:35): [True: 0, False: 0]
  ------------------
 2155|      0|	    return TRUE;
  ------------------
  |  |  106|      0|#define TRUE 1
  ------------------
 2156|       |
 2157|      0|	if (op == CAIRO_OPERATOR_SOURCE)
  ------------------
  |  Branch (2157:6): [True: 0, False: 0]
  ------------------
 2158|      0|	    op = CAIRO_OPERATOR_CLEAR;
 2159|      0|    }
 2160|       |
 2161|     71|    if (op == CAIRO_OPERATOR_CLEAR && surface->is_clear)
  ------------------
  |  Branch (2161:9): [True: 0, False: 71]
  |  Branch (2161:39): [True: 0, False: 0]
  ------------------
 2162|      0|	return TRUE;
  ------------------
  |  |  106|      0|#define TRUE 1
  ------------------
 2163|       |
 2164|     71|    if (op == CAIRO_OPERATOR_ATOP && (surface->content & CAIRO_CONTENT_COLOR) ==0)
  ------------------
  |  Branch (2164:9): [True: 0, False: 71]
  |  Branch (2164:38): [True: 0, False: 0]
  ------------------
 2165|      0|	return TRUE;
  ------------------
  |  |  106|      0|#define TRUE 1
  ------------------
 2166|       |
 2167|     71|    return FALSE;
  ------------------
  |  |  102|     71|#define FALSE 0
  ------------------
 2168|     71|}

_cairo_traps_compositor_init:
 2343|      1|{
 2344|      1|    compositor->base.delegate = delegate;
 2345|       |
 2346|      1|    compositor->base.paint = _cairo_traps_compositor_paint;
 2347|      1|    compositor->base.mask = _cairo_traps_compositor_mask;
 2348|      1|    compositor->base.fill = _cairo_traps_compositor_fill;
 2349|      1|    compositor->base.stroke = _cairo_traps_compositor_stroke;
 2350|      1|    compositor->base.glyphs = _cairo_traps_compositor_glyphs;
 2351|      1|}

cairo_create:
  447|     71|{
  448|     71|    if (unlikely (target == NULL))
  ------------------
  |  |  145|     71|#define unlikely(expr) (__builtin_expect (!!(expr), 0))
  |  |  ------------------
  |  |  |  Branch (145:24): [True: 0, False: 71]
  |  |  ------------------
  ------------------
  449|      0|	return _cairo_create_in_error (_cairo_error (CAIRO_STATUS_NULL_POINTER));
  450|     71|    if (unlikely (target->status))
  ------------------
  |  |  145|     71|#define unlikely(expr) (__builtin_expect (!!(expr), 0))
  |  |  ------------------
  |  |  |  Branch (145:24): [True: 0, False: 71]
  |  |  ------------------
  ------------------
  451|      0|	return _cairo_create_in_error (target->status);
  452|     71|    if (unlikely (target->finished))
  ------------------
  |  |  145|     71|#define unlikely(expr) (__builtin_expect (!!(expr), 0))
  |  |  ------------------
  |  |  |  Branch (145:24): [True: 0, False: 71]
  |  |  ------------------
  ------------------
  453|      0|	return _cairo_create_in_error (_cairo_error (CAIRO_STATUS_SURFACE_FINISHED));
  454|       |
  455|     71|    if (target->backend->create_context == NULL)
  ------------------
  |  Branch (455:9): [True: 0, False: 71]
  ------------------
  456|      0|	return _cairo_create_in_error (_cairo_error (CAIRO_STATUS_WRITE_ERROR));
  457|       |
  458|     71|    return target->backend->create_context (target);
  459|       |
  460|     71|}
_cairo_init:
  465|     71|{
  466|     71|    CAIRO_REFERENCE_COUNT_INIT (&cr->ref_count, 1);
  ------------------
  |  |   51|     71|#define CAIRO_REFERENCE_COUNT_INIT(RC, VALUE) ((RC)->ref_count = (VALUE))
  ------------------
  467|     71|    cr->status = CAIRO_STATUS_SUCCESS;
  468|     71|    _cairo_user_data_array_init (&cr->user_data);
  469|       |
  470|     71|    cr->backend = backend;
  471|     71|}
_cairo_fini:
  503|     71|{
  504|     71|    _cairo_user_data_array_fini (&cr->user_data);
  505|     71|}
cairo_destroy:
  519|     71|{
  520|     71|    if (cr == NULL || CAIRO_REFERENCE_COUNT_IS_INVALID (&cr->ref_count))
  ------------------
  |  |   58|     71|#define CAIRO_REFERENCE_COUNT_IS_INVALID(RC) (CAIRO_REFERENCE_COUNT_GET_VALUE (RC) == CAIRO_REFERENCE_COUNT_INVALID_VALUE)
  |  |  ------------------
  |  |  |  |   53|     71|#define CAIRO_REFERENCE_COUNT_GET_VALUE(RC) _cairo_atomic_int_get (&(RC)->ref_count)
  |  |  ------------------
  |  |               #define CAIRO_REFERENCE_COUNT_IS_INVALID(RC) (CAIRO_REFERENCE_COUNT_GET_VALUE (RC) == CAIRO_REFERENCE_COUNT_INVALID_VALUE)
  |  |  ------------------
  |  |  |  |   55|     71|#define CAIRO_REFERENCE_COUNT_INVALID_VALUE ((int) -1)
  |  |  ------------------
  |  |  |  Branch (58:46): [True: 0, False: 71]
  |  |  ------------------
  ------------------
  |  Branch (520:9): [True: 0, False: 71]
  ------------------
  521|      0|	return;
  522|       |
  523|     71|    assert (CAIRO_REFERENCE_COUNT_HAS_REFERENCE (&cr->ref_count));
  ------------------
  |  Branch (523:5): [True: 0, False: 71]
  |  Branch (523:5): [True: 71, False: 0]
  ------------------
  524|       |
  525|     71|    if (! _cairo_reference_count_dec_and_test (&cr->ref_count))
  ------------------
  |  |   49|     71|#define _cairo_reference_count_dec_and_test(RC) _cairo_atomic_int_dec_and_test (&(RC)->ref_count)
  |  |  ------------------
  |  |  |  |   85|     71|# define _cairo_atomic_int_dec_and_test(x) (atomic_fetch_sub_explicit(x, 1, memory_order_seq_cst) == 1)
  |  |  ------------------
  ------------------
  |  Branch (525:9): [True: 0, False: 71]
  ------------------
  526|      0|	return;
  527|       |
  528|     71|    cr->backend->destroy (cr);
  529|     71|}
cairo_set_source:
 1005|     71|{
 1006|     71|    cairo_status_t status;
 1007|       |
 1008|     71|    if (unlikely (cr->status))
  ------------------
  |  |  145|     71|#define unlikely(expr) (__builtin_expect (!!(expr), 0))
  |  |  ------------------
  |  |  |  Branch (145:24): [True: 0, False: 71]
  |  |  ------------------
  ------------------
 1009|      0|	return;
 1010|       |
 1011|     71|    if (unlikely (source == NULL)) {
  ------------------
  |  |  145|     71|#define unlikely(expr) (__builtin_expect (!!(expr), 0))
  |  |  ------------------
  |  |  |  Branch (145:24): [True: 0, False: 71]
  |  |  ------------------
  ------------------
 1012|      0|	_cairo_set_error (cr, CAIRO_STATUS_NULL_POINTER);
 1013|      0|	return;
 1014|      0|    }
 1015|       |
 1016|     71|    if (unlikely (source->status)) {
  ------------------
  |  |  145|     71|#define unlikely(expr) (__builtin_expect (!!(expr), 0))
  |  |  ------------------
  |  |  |  Branch (145:24): [True: 0, False: 71]
  |  |  ------------------
  ------------------
 1017|      0|	_cairo_set_error (cr, source->status);
 1018|      0|	return;
 1019|      0|    }
 1020|       |
 1021|     71|    status = cr->backend->set_source (cr, source);
 1022|     71|    if (unlikely (status))
  ------------------
  |  |  145|     71|#define unlikely(expr) (__builtin_expect (!!(expr), 0))
  |  |  ------------------
  |  |  |  Branch (145:24): [True: 0, False: 71]
  |  |  ------------------
  ------------------
 1023|      0|	_cairo_set_error (cr, status);
 1024|     71|}
cairo_paint:
 2224|     71|{
 2225|     71|    cairo_status_t status;
 2226|       |
 2227|     71|    if (unlikely (cr->status))
  ------------------
  |  |  145|     71|#define unlikely(expr) (__builtin_expect (!!(expr), 0))
  |  |  ------------------
  |  |  |  Branch (145:24): [True: 0, False: 71]
  |  |  ------------------
  ------------------
 2228|      0|	return;
 2229|       |
 2230|     71|    status = cr->backend->paint (cr);
 2231|     71|    if (unlikely (status))
  ------------------
  |  |  145|     71|#define unlikely(expr) (__builtin_expect (!!(expr), 0))
  |  |  ------------------
  |  |  |  Branch (145:24): [True: 71, False: 0]
  |  |  ------------------
  ------------------
 2232|     71|	_cairo_set_error (cr, status);
 2233|     71|}
cairo.c:_cairo_set_error:
  398|     71|{
  399|       |    /* Don't overwrite an existing error. This preserves the first
  400|       |     * error, which is the most significant. */
  401|       |    _cairo_status_set_error (&cr->status, _cairo_error (status));
  ------------------
  |  |  477|     71|#define _cairo_status_set_error(status, err) do { \
  |  |  478|     71|    int ret__; \
  |  |  479|     71|    assert (err < CAIRO_STATUS_LAST_STATUS); \
  |  |  480|     71|    assert (sizeof(*status) == sizeof(cairo_atomic_int_t)); \
  |  |  481|     71|    /* hide compiler warnings about cairo_status_t != int (gcc treats its as \
  |  |  482|     71|     * an unsigned integer instead, and about ignoring the return value. */  \
  |  |  483|     71|    ret__ = _cairo_atomic_int_cmpxchg ((cairo_atomic_int_t *) status, CAIRO_STATUS_SUCCESS, err); \
  |  |  ------------------
  |  |  |  |   98|     71|  _cairo_atomic_int_cmpxchg_impl(x, oldv, newv)
  |  |  ------------------
  |  |  484|     71|    (void) ret__; \
  |  |  485|     71|} while (0)
  |  |  ------------------
  |  |  |  Branch (485:10): [Folded, False: 71]
  |  |  ------------------
  ------------------
  |  Branch (401:5): [True: 0, False: 71]
  |  Branch (401:5): [True: 71, False: 0]
  |  Branch (401:5): [True: 0, Folded]
  |  Branch (401:5): [True: 71, Folded]
  ------------------
  402|     71|}

cairo-pattern.c:_cairo_rectangle_contains_rectangle:
  324|     47|{
  325|     47|    return (a->x <= b->x &&
  ------------------
  |  Branch (325:13): [True: 47, False: 0]
  ------------------
  326|     47|	    a->x + a->width >= b->x + b->width &&
  ------------------
  |  Branch (326:6): [True: 47, False: 0]
  ------------------
  327|     47|	    a->y <= b->y &&
  ------------------
  |  Branch (327:6): [True: 47, False: 0]
  ------------------
  328|     47|	    a->y + a->height >= b->y + b->height);
  ------------------
  |  Branch (328:6): [True: 47, False: 0]
  ------------------
  329|     47|}
cairo-pattern.c:_cairo_matrix_is_identity:
 1806|     71|{
 1807|     71|    return (matrix->xx == 1.0 && matrix->yx == 0.0 &&
  ------------------
  |  Branch (1807:13): [True: 71, False: 0]
  |  Branch (1807:34): [True: 71, False: 0]
  ------------------
 1808|     71|	    matrix->xy == 0.0 && matrix->yy == 1.0 &&
  ------------------
  |  Branch (1808:6): [True: 71, False: 0]
  |  Branch (1808:27): [True: 71, False: 0]
  ------------------
 1809|     71|	    matrix->x0 == 0.0 && matrix->y0 == 0.0);
  ------------------
  |  Branch (1809:6): [True: 71, False: 0]
  |  Branch (1809:27): [True: 71, False: 0]
  ------------------
 1810|     71|}
cairo-pattern.c:_cairo_matrix_is_translation:
 1814|     71|{
 1815|     71|    return (matrix->xx == 1.0 && matrix->yx == 0.0 &&
  ------------------
  |  Branch (1815:13): [True: 71, False: 0]
  |  Branch (1815:34): [True: 71, False: 0]
  ------------------
 1816|     71|	    matrix->xy == 0.0 && matrix->yy == 1.0);
  ------------------
  |  Branch (1816:6): [True: 71, False: 0]
  |  Branch (1816:27): [True: 71, False: 0]
  ------------------
 1817|     71|}
cairo-pattern.c:_cairo_lround:
  772|    284|{
  773|    284|    return _cairo_round (r);
  774|    284|}
cairo-pattern.c:_cairo_round:
  762|    284|{
  763|    284|    return floor (r + .5);
  764|    284|}
cairo-surface.c:_cairo_matrix_is_identity:
 1806|     71|{
 1807|     71|    return (matrix->xx == 1.0 && matrix->yx == 0.0 &&
  ------------------
  |  Branch (1807:13): [True: 71, False: 0]
  |  Branch (1807:34): [True: 71, False: 0]
  ------------------
 1808|     71|	    matrix->xy == 0.0 && matrix->yy == 1.0 &&
  ------------------
  |  Branch (1808:6): [True: 71, False: 0]
  |  Branch (1808:27): [True: 71, False: 0]
  ------------------
 1809|     71|	    matrix->x0 == 0.0 && matrix->y0 == 0.0);
  ------------------
  |  Branch (1809:6): [True: 71, False: 0]
  |  Branch (1809:27): [True: 71, False: 0]
  ------------------
 1810|     71|}
cairo-gstate.c:_cairo_matrix_is_identity:
 1806|    142|{
 1807|    142|    return (matrix->xx == 1.0 && matrix->yx == 0.0 &&
  ------------------
  |  Branch (1807:13): [True: 142, False: 0]
  |  Branch (1807:34): [True: 142, False: 0]
  ------------------
 1808|    142|	    matrix->xy == 0.0 && matrix->yy == 1.0 &&
  ------------------
  |  Branch (1808:6): [True: 142, False: 0]
  |  Branch (1808:27): [True: 142, False: 0]
  ------------------
 1809|    142|	    matrix->x0 == 0.0 && matrix->y0 == 0.0);
  ------------------
  |  Branch (1809:6): [True: 142, False: 0]
  |  Branch (1809:27): [True: 142, False: 0]
  ------------------
 1810|    142|}
cairo-matrix.c:_cairo_matrix_is_translation:
 1814|     71|{
 1815|     71|    return (matrix->xx == 1.0 && matrix->yx == 0.0 &&
  ------------------
  |  Branch (1815:13): [True: 71, False: 0]
  |  Branch (1815:34): [True: 71, False: 0]
  ------------------
 1816|     71|	    matrix->xy == 0.0 && matrix->yy == 1.0);
  ------------------
  |  Branch (1816:6): [True: 71, False: 0]
  |  Branch (1816:27): [True: 71, False: 0]
  ------------------
 1817|     71|}

raster_fuzzer.c:fuzzer_get_tmpfile:
   29|    371|static char* fuzzer_get_tmpfile(const uint8_t* data, size_t size) {
   30|    371|    char* filename_buffer = strdup("/tmp/generate_temporary_file.XXXXXX");
   31|    371|    if (!filename_buffer) {
  ------------------
  |  Branch (31:9): [True: 0, False: 371]
  ------------------
   32|      0|        perror("Failed to allocate file name buffer.");
   33|      0|        abort();
   34|      0|    }
   35|    371|    const int file_descriptor = mkstemp(filename_buffer);
   36|    371|    if (file_descriptor < 0) {
  ------------------
  |  Branch (36:9): [True: 0, False: 371]
  ------------------
   37|      0|        perror("Failed to make temporary file.");
   38|      0|        abort();
   39|      0|    }
   40|    371|    FILE* file = fdopen(file_descriptor, "wb");
   41|    371|    if (!file) {
  ------------------
  |  Branch (41:9): [True: 0, False: 371]
  ------------------
   42|      0|        perror("Failed to open file descriptor.");
   43|      0|        close(file_descriptor);
   44|      0|        abort();
   45|      0|    }
   46|    371|    const size_t bytes_written = fwrite(data, sizeof(uint8_t), size, file);
   47|    371|    if (bytes_written < size) {
  ------------------
  |  Branch (47:9): [True: 0, False: 371]
  ------------------
   48|      0|        close(file_descriptor);
   49|      0|        fprintf(stderr, "Failed to write all bytes to file (%zu out of %zu)",
   50|      0|                bytes_written, size);
   51|      0|        abort();
   52|      0|    }
   53|    371|    fclose(file);
   54|    371|    return filename_buffer;
   55|    371|}
raster_fuzzer.c:fuzzer_release_tmpfile:
   57|    371|static void fuzzer_release_tmpfile(char* filename) {
   58|    371|    if (unlink(filename) != 0) {
  ------------------
  |  Branch (58:9): [True: 0, False: 371]
  ------------------
   59|      0|        perror("WARNING: Failed to delete temporary file.");
   60|      0|    }
   61|    371|    free(filename);
   62|    371|}

LLVMFuzzerTestOneInput:
   32|    371|int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
   33|    371|    cairo_t *cr;
   34|    371|    cairo_surface_t *surface;
   35|    371|    cairo_pattern_t *pattern;
   36|    371|    cairo_content_t content;
   37|    371|    cairo_status_t status;
   38|    371|    int w, h;
   39|       |
   40|    371|    char *tmpfile = fuzzer_get_tmpfile(data, size);
   41|    371|    surface = cairo_image_surface_create_from_png(tmpfile);
   42|    371|    status = cairo_surface_status (surface);
   43|    371|    if (status != CAIRO_STATUS_SUCCESS) {
  ------------------
  |  Branch (43:9): [True: 300, False: 71]
  ------------------
   44|    300|        fuzzer_release_tmpfile(tmpfile);
   45|    300|        return 0;
   46|    300|    }
   47|       |
   48|     71|    cr = cairo_create(surface);
   49|     71|    content = cairo_surface_get_content(surface);
   50|     71|    w = cairo_image_surface_get_width(surface);
   51|     71|    h = cairo_image_surface_get_height(surface);
   52|       |
   53|     71|    char *buf = (char *) calloc(size + 1, sizeof(char));
   54|     71|    memcpy(buf, data, size);
   55|     71|    buf[size] = '\0';
   56|       |
   57|     71|    pattern = cairo_pattern_create_raster_source(buf, content, w, h);
   58|     71|    cairo_raster_source_pattern_set_acquire (pattern, acquire, release);
   59|     71|    cairo_set_source(cr, pattern);
   60|     71|    cairo_paint(cr);
   61|       |
   62|     71|    cairo_destroy(cr);
   63|     71|    cairo_pattern_destroy(pattern);
   64|     71|    cairo_surface_destroy(surface);
   65|     71|    free(buf);
   66|     71|    fuzzer_release_tmpfile(tmpfile);
   67|     71|    return 0;
   68|    371|}
raster_fuzzer.c:acquire:
   22|     71|{
   23|     71|    return cairo_image_surface_create_from_png(closure);
   24|     71|}

