Coverage Report

Created: 2025-07-07 10:01

/work/workdir/UnpackedTarball/cairo/src/cairo-time-private.h
Line
Count
Source (jump to first uncovered line)
1
/* cairo - a vector graphics library with display and print output
2
 *
3
 * Copyright (C) 2011 Andrea Canciani
4
 *
5
 * Permission to use, copy, modify, distribute, and sell this software
6
 * and its documentation for any purpose is hereby granted without
7
 * fee, provided that the above copyright notice appear in all copies
8
 * and that both that copyright notice and this permission notice
9
 * appear in supporting documentation, and that the name of the
10
 * copyright holders not be used in advertising or publicity
11
 * pertaining to distribution of the software without specific,
12
 * written prior permission. The copyright holders make no
13
 * representations about the suitability of this software for any
14
 * purpose.  It is provided "as is" without express or implied
15
 * warranty.
16
 *
17
 * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
18
 * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
19
 * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
20
 * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
21
 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
22
 * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
23
 * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
24
 * SOFTWARE.
25
 *
26
 * Authors: Andrea Canciani <ranma42@gmail.com>
27
 *
28
 */
29
30
#ifndef CAIRO_TIME_PRIVATE_H
31
#define CAIRO_TIME_PRIVATE_H
32
33
#include "cairo-compiler-private.h"
34
#include "cairo-wideint-private.h"
35
36
/* Make the base type signed for easier arithmetic */
37
typedef cairo_int64_t cairo_time_t;
38
39
#define _cairo_time_add _cairo_int64_add
40
#define _cairo_time_sub _cairo_int64_sub
41
#define _cairo_time_gt  _cairo_int64_gt
42
#define _cairo_time_lt  _cairo_int64_lt
43
44
#define _cairo_time_to_double   _cairo_int64_to_double
45
#define _cairo_time_from_double _cairo_double_to_int64
46
47
cairo_private int
48
_cairo_time_cmp (const void *a,
49
     const void *b);
50
51
cairo_private double
52
_cairo_time_to_s (cairo_time_t t);
53
54
cairo_private cairo_time_t
55
_cairo_time_from_s (double t);
56
57
cairo_private cairo_time_t
58
_cairo_time_get (void);
59
60
static cairo_always_inline cairo_time_t
61
_cairo_time_get_delta (cairo_time_t t)
62
0
{
63
0
    cairo_time_t now;
64
0
65
0
    now = _cairo_time_get ();
66
0
67
0
    return _cairo_time_sub (now, t);
68
0
}
Unexecuted instantiation: cairo-image-source.c:_cairo_time_get_delta
Unexecuted instantiation: cairo-mask-compositor.c:_cairo_time_get_delta
Unexecuted instantiation: cairo-spans-compositor.c:_cairo_time_get_delta
Unexecuted instantiation: cairo-traps-compositor.c:_cairo_time_get_delta
69
70
static cairo_always_inline double
71
_cairo_time_to_ns (cairo_time_t t)
72
0
{
73
0
    return 1.e9 * _cairo_time_to_s (t);
74
0
}
Unexecuted instantiation: cairo-image-source.c:_cairo_time_to_ns
Unexecuted instantiation: cairo-mask-compositor.c:_cairo_time_to_ns
Unexecuted instantiation: cairo-spans-compositor.c:_cairo_time_to_ns
Unexecuted instantiation: cairo-traps-compositor.c:_cairo_time_to_ns
75
76
static cairo_always_inline cairo_time_t
77
_cairo_time_max (cairo_time_t a, cairo_time_t b)
78
0
{
79
0
    if (_cairo_int64_gt (a, b))
80
0
  return a;
81
0
    else
82
0
  return b;
83
0
}
Unexecuted instantiation: cairo-image-source.c:_cairo_time_max
Unexecuted instantiation: cairo-mask-compositor.c:_cairo_time_max
Unexecuted instantiation: cairo-spans-compositor.c:_cairo_time_max
Unexecuted instantiation: cairo-traps-compositor.c:_cairo_time_max
84
85
static cairo_always_inline cairo_time_t
86
_cairo_time_min (cairo_time_t a, cairo_time_t b)
87
0
{
88
0
    if (_cairo_int64_lt (a, b))
89
0
  return a;
90
0
    else
91
0
  return b;
92
0
}
Unexecuted instantiation: cairo-image-source.c:_cairo_time_min
Unexecuted instantiation: cairo-mask-compositor.c:_cairo_time_min
Unexecuted instantiation: cairo-spans-compositor.c:_cairo_time_min
Unexecuted instantiation: cairo-traps-compositor.c:_cairo_time_min
93
94
#endif