mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-08 13:48:02 +02:00
perf: Do backend synchronization in cairo_perf_timer_start as well as cairo_perf_timer_stop
This commit is contained in:
parent
5412343a77
commit
8af5e14fd8
2 changed files with 18 additions and 14 deletions
|
|
@ -121,15 +121,6 @@ typedef struct _cairo_perf_timer
|
|||
|
||||
static cairo_perf_timer_t timer;
|
||||
|
||||
void
|
||||
cairo_perf_timer_start (void) {
|
||||
#ifdef OIL_STAMP
|
||||
timer.start = OIL_STAMP ();
|
||||
#else
|
||||
gettimeofday (&timer.tv_start, NULL);
|
||||
#endif
|
||||
}
|
||||
|
||||
static cairo_perf_timer_finalize_t cairo_perf_timer_finalize = NULL;
|
||||
static void *cairo_perf_timer_finalize_closure = NULL;
|
||||
void
|
||||
|
|
@ -140,6 +131,17 @@ cairo_perf_timer_set_finalize (cairo_perf_timer_finalize_t finalize,
|
|||
cairo_perf_timer_finalize_closure = closure;
|
||||
}
|
||||
|
||||
void
|
||||
cairo_perf_timer_start (void) {
|
||||
if (cairo_perf_timer_finalize)
|
||||
cairo_perf_timer_finalize (cairo_perf_timer_finalize_closure);
|
||||
#ifdef OIL_STAMP
|
||||
timer.start = OIL_STAMP ();
|
||||
#else
|
||||
gettimeofday (&timer.tv_start, NULL);
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
cairo_perf_timer_stop (void) {
|
||||
if (cairo_perf_timer_finalize)
|
||||
|
|
|
|||
|
|
@ -42,11 +42,6 @@ typedef struct _cairo_perf_timer
|
|||
|
||||
static cairo_perf_timer_t timer;
|
||||
|
||||
void
|
||||
cairo_perf_timer_start (void) {
|
||||
QueryPerformanceCounter(&timer.start);
|
||||
}
|
||||
|
||||
static cairo_perf_timer_finalize_t cairo_perf_timer_finalize = NULL;
|
||||
static void *cairo_perf_timer_finalize_closure = NULL;
|
||||
void
|
||||
|
|
@ -57,6 +52,13 @@ cairo_perf_timer_set_finalize (cairo_perf_timer_finalize_t finalize,
|
|||
cairo_perf_timer_finalize_closure = closure;
|
||||
}
|
||||
|
||||
void
|
||||
cairo_perf_timer_start (void) {
|
||||
if (cairo_perf_timer_finalize)
|
||||
cairo_perf_timer_finalize (cairo_perf_timer_finalize_closure);
|
||||
QueryPerformanceCounter(&timer.start);
|
||||
}
|
||||
|
||||
void
|
||||
cairo_perf_timer_stop (void) {
|
||||
if (cairo_perf_timer_finalize)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue