diff options
author | M Joonas Pihlaja <jpihlaja@cc.helsinki.fi> | 2009-09-13 18:21:38 +0100 |
---|---|---|
committer | M Joonas Pihlaja <jpihlaja@cc.helsinki.fi> | 2009-09-13 20:33:33 +0300 |
commit | ba21f213560fa239a02ae28af4eb1d3a6b7254e5 (patch) | |
tree | 9c016d67af1bf0af51ebaef1349a799010066768 | |
parent | f5bcb2f36e7dba9cfba5d697e1401dcd00603812 (diff) |
[trace] Don't trace internal cairo calls on Solaris.
On various configurations of Solaris cairo-trace likes to trace
internal calls to the API from within cairo and cairo-trace itself. On
Linux the slim_hidden_proto stuff avoids this by name mangling and
symbol alias magic, but on Solaris that doesn't work so we're left
with either no hidden symbols at all or using normal ELF hidden symbol
attributes, but neither of those prevent internal calls to cairo from
being traced of course.
This commit provides a per-thread entry/exit trace counter for use
when we can't use name mangling to hide internal API calls. As a
side-effect it may hide actual client API calls from callback
functions called by cairo, but such use cases ought to be rare.
-rw-r--r-- | util/cairo-trace/trace.c | 465 |
1 files changed, 327 insertions, 138 deletions
diff --git a/util/cairo-trace/trace.c b/util/cairo-trace/trace.c index a3615e3c..a3b36976 100644 --- a/util/cairo-trace/trace.c +++ b/util/cairo-trace/trace.c @@ -179,13 +179,27 @@ static bool _line_info; static bool _mark_dirty; static const cairo_user_data_key_t destroy_key; static pthread_once_t once_control = PTHREAD_ONCE_INIT; +static pthread_key_t counter_key; static void _init_trace (void); -#define ENSURE_INIT_TRACE() pthread_once (&once_control, _init_trace); + +#define INIT_TRACE_ONCE() pthread_once (&once_control, _init_trace) + +#if __GNUC__ >= 3 && defined(__ELF__) && !defined(__sun) +# define _enter_trace() INIT_TRACE_ONCE () +# define _exit_trace() do { } while (0) +# define _should_trace() 1 +# define USE_ENTER_EXIT 0 +#else +static void _enter_trace (void); +static void _exit_trace (void); +static bool _should_trace (void); +# define USE_ENTER_EXIT 1 +#endif #if HAVE_BUILTIN_RETURN_ADDRESS && CAIRO_HAS_SYMBOL_LOOKUP #define _emit_line_info() do { \ - if (_line_info && _write_lock ()) { \ + if (_line_info && _write_lock ()) { \ void *addr = __builtin_return_address(0); \ char caller[1024]; \ _trace_printf ("%% %s() called by %s\n", __FUNCTION__, \ @@ -398,10 +412,43 @@ _object_create (Type *type, const void *ptr) return obj; } +#if USE_ENTER_EXIT +static int * +_get_counter (void) +{ + int *counter = pthread_getspecific (counter_key); + if (counter == NULL) { + counter = calloc(1, sizeof(int)); + pthread_setspecific (counter_key, counter); + } + return counter; +} + +static void +_enter_trace (void) +{ + INIT_TRACE_ONCE (); + _get_counter ()[0]++; +} + +static void +_exit_trace (void) +{ + _get_counter ()[0]--; +} + +static bool +_should_trace (void) +{ + return _get_counter ()[0] <= 1; +} +#endif /* USE_ENTER_EXIT */ + static void _init_trace (void) { pthread_mutex_init (&Types.mutex, NULL); + pthread_key_create (&counter_key, free); _type_create ("unclassed", NONE, ""); _type_create ("cairo_t", CONTEXT, "c"); @@ -434,6 +481,7 @@ _fini_trace (void) } } + pthread_key_delete (counter_key); pthread_mutex_destroy (&Types.mutex); } @@ -546,6 +594,8 @@ _trace_vprintf (const char *fmt, va_list ap) cairo_bool_t var_width; int ret_ignored; + assert (_should_trace ()); + f = fmt; p = buffer; while (*f != '\0') { @@ -778,6 +828,9 @@ _write_lock (void) if (_error) return false; + if (! _should_trace ()) + return false; + if (! _init_logfile ()) return false; @@ -1259,6 +1312,8 @@ _write_base85_data (struct _data_stream *stream, unsigned char five_tuple[5]; int ret; + assert (_should_trace ()); + while (length--) { stream->four_tuple[stream->base85_pending++] = *data++; if (stream->base85_pending == 4) { @@ -1342,6 +1397,8 @@ _write_base85_data_end (struct _data_stream *stream) unsigned char five_tuple[5]; int ret; + assert (_should_trace ()); + if (stream->base85_pending) { memset (stream->four_tuple + stream->base85_pending, 0, 4 - stream->base85_pending); @@ -1799,7 +1856,7 @@ cairo_create (cairo_surface_t *target) long surface_id; long context_id; - ENSURE_INIT_TRACE (); + _enter_trace (); ret = DLCALL (cairo_create, target); context_id = _create_context_id (ret); @@ -1822,34 +1879,38 @@ cairo_create (cairo_surface_t *target) _write_unlock (); } + _exit_trace (); return ret; } void cairo_save (cairo_t *cr) -{ - ENSURE_INIT_TRACE (); +{ + _enter_trace (); _emit_line_info (); _emit_cairo_op (cr, "save\n"); DLCALL (cairo_save, cr); + _exit_trace (); } void cairo_restore (cairo_t *cr) { - ENSURE_INIT_TRACE (); + _enter_trace (); _emit_line_info (); _emit_cairo_op (cr, "restore\n"); DLCALL (cairo_restore, cr); + _exit_trace (); } void cairo_push_group (cairo_t *cr) { - ENSURE_INIT_TRACE (); + _enter_trace (); _emit_line_info (); _emit_cairo_op (cr, "//COLOR_ALPHA push-group\n"); DLCALL (cairo_push_group, cr); + _exit_trace (); } static const char * @@ -1866,10 +1927,11 @@ _content_to_string (cairo_content_t content) void cairo_push_group_with_content (cairo_t *cr, cairo_content_t content) { - ENSURE_INIT_TRACE (); + _enter_trace (); _emit_line_info (); _emit_cairo_op (cr, "//%s push-group\n", _content_to_string (content)); DLCALL (cairo_push_group_with_content, cr, content); + _exit_trace (); } cairo_pattern_t * @@ -1877,7 +1939,7 @@ cairo_pop_group (cairo_t *cr) { cairo_pattern_t *ret; - ENSURE_INIT_TRACE (); + _enter_trace (); ret = DLCALL (cairo_pop_group, cr); @@ -1885,16 +1947,18 @@ cairo_pop_group (cairo_t *cr) _emit_cairo_op (cr, "pop-group %% p%ld\n", _create_pattern_id (ret)); _push_operand (PATTERN, ret); + _exit_trace (); return ret; } void cairo_pop_group_to_source (cairo_t *cr) { - ENSURE_INIT_TRACE (); + _enter_trace (); _emit_line_info (); _emit_cairo_op (cr, "pop-group set-source\n"); DLCALL (cairo_pop_group_to_source, cr); + _exit_trace (); } static const char * @@ -1939,29 +2003,32 @@ _operator_to_string (cairo_operator_t op) void cairo_set_operator (cairo_t *cr, cairo_operator_t op) { - ENSURE_INIT_TRACE (); + _enter_trace (); _emit_line_info (); _emit_cairo_op (cr, "//%s set-operator\n", _operator_to_string (op)); DLCALL (cairo_set_operator, cr, op); + _exit_trace (); } void cairo_set_source_rgb (cairo_t *cr, double red, double green, double blue) { - ENSURE_INIT_TRACE (); + _enter_trace (); _emit_line_info (); _emit_cairo_op (cr, "%g %g %g set-source-rgb\n", red, green, blue); DLCALL (cairo_set_source_rgb, cr, red, green, blue); + _exit_trace (); } void cairo_set_source_rgba (cairo_t *cr, double red, double green, double blue, double alpha) { - ENSURE_INIT_TRACE (); + _enter_trace (); _emit_line_info (); _emit_cairo_op (cr, "%g %g %g %g set-source-rgba\n", red, green, blue, alpha); DLCALL (cairo_set_source_rgba, cr, red, green, blue, alpha); + _exit_trace (); } static void @@ -2027,7 +2094,7 @@ _emit_source_image_rectangle (cairo_surface_t *surface, void cairo_set_source_surface (cairo_t *cr, cairo_surface_t *surface, double x, double y) { - ENSURE_INIT_TRACE (); + _enter_trace (); _emit_line_info (); if (cr != NULL && surface != NULL && _write_lock ()) { if (_is_current (SURFACE, surface, 0) && @@ -2058,12 +2125,13 @@ cairo_set_source_surface (cairo_t *cr, cairo_surface_t *surface, double x, doubl } DLCALL (cairo_set_source_surface, cr, surface, x, y); + _exit_trace (); } void cairo_set_source (cairo_t *cr, cairo_pattern_t *source) { - ENSURE_INIT_TRACE (); + _enter_trace (); _emit_line_info (); if (cr != NULL && source != NULL && _write_lock ()) { Object *obj = _get_object (PATTERN, source); @@ -2098,6 +2166,7 @@ cairo_set_source (cairo_t *cr, cairo_pattern_t *source) } DLCALL (cairo_set_source, cr, source); + _exit_trace (); } cairo_pattern_t * @@ -2105,7 +2174,7 @@ cairo_get_source (cairo_t *cr) { cairo_pattern_t *ret; - ENSURE_INIT_TRACE (); + _enter_trace (); ret = DLCALL (cairo_get_source, cr); @@ -2115,16 +2184,18 @@ cairo_get_source (cairo_t *cr) _get_object (PATTERN, ret)->defined = true; } + _exit_trace (); return ret; } void cairo_set_tolerance (cairo_t *cr, double tolerance) { - ENSURE_INIT_TRACE (); + _enter_trace (); _emit_line_info (); _emit_cairo_op (cr, "%g set-tolerance\n", tolerance); DLCALL (cairo_set_tolerance, cr, tolerance); + _exit_trace (); } static const char * @@ -2144,11 +2215,12 @@ _antialias_to_string (cairo_antialias_t antialias) void cairo_set_antialias (cairo_t *cr, cairo_antialias_t antialias) { - ENSURE_INIT_TRACE (); + _enter_trace (); _emit_line_info (); _emit_cairo_op (cr, "//%s set-antialias\n", _antialias_to_string (antialias)); DLCALL (cairo_set_antialias, cr, antialias); + _exit_trace (); } static const char * @@ -2166,20 +2238,22 @@ _fill_rule_to_string (cairo_fill_rule_t rule) void cairo_set_fill_rule (cairo_t *cr, cairo_fill_rule_t fill_rule) { - ENSURE_INIT_TRACE (); + _enter_trace (); _emit_line_info (); _emit_cairo_op (cr, "//%s set-fill-rule\n", _fill_rule_to_string (fill_rule)); DLCALL (cairo_set_fill_rule, cr, fill_rule); + _exit_trace (); } void cairo_set_line_width (cairo_t *cr, double width) { - ENSURE_INIT_TRACE (); + _enter_trace (); _emit_line_info (); _emit_cairo_op (cr, "%g set-line-width\n", width); DLCALL (cairo_set_line_width, cr, width); + _exit_trace (); } static const char * @@ -2198,10 +2272,11 @@ _line_cap_to_string (cairo_line_cap_t line_cap) void cairo_set_line_cap (cairo_t *cr, cairo_line_cap_t line_cap) { - ENSURE_INIT_TRACE (); + _enter_trace (); _emit_line_info (); _emit_cairo_op (cr, "//%s set-line-cap\n", _line_cap_to_string (line_cap)); DLCALL (cairo_set_line_cap, cr, line_cap); + _exit_trace (); } static const char * @@ -2220,17 +2295,18 @@ _line_join_to_string (cairo_line_join_t line_join) void cairo_set_line_join (cairo_t *cr, cairo_line_join_t line_join) { - ENSURE_INIT_TRACE (); + _enter_trace (); _emit_line_info (); _emit_cairo_op (cr, "//%s set-line-join\n", _line_join_to_string (line_join)); DLCALL (cairo_set_line_join, cr, line_join); + _exit_trace (); } void cairo_set_dash (cairo_t *cr, const double *dashes, int num_dashes, double offset) { - ENSURE_INIT_TRACE (); + _enter_trace (); _emit_line_info (); if (cr != NULL && _write_lock ()) { int n; @@ -2249,60 +2325,66 @@ cairo_set_dash (cairo_t *cr, const double *dashes, int num_dashes, double offset } DLCALL (cairo_set_dash, cr, dashes, num_dashes, offset); + _exit_trace (); } void cairo_set_miter_limit (cairo_t *cr, double limit) { - ENSURE_INIT_TRACE (); + _enter_trace (); _emit_line_info (); _emit_cairo_op (cr, "%g set-miter-limit\n", limit); DLCALL (cairo_set_miter_limit, cr, limit); + _exit_trace (); } void cairo_translate (cairo_t *cr, double tx, double ty) { - ENSURE_INIT_TRACE (); + _enter_trace (); _emit_line_info (); _emit_cairo_op (cr, "%g %g translate\n", tx, ty); DLCALL (cairo_translate, cr, tx, ty); + _exit_trace (); } void cairo_scale (cairo_t *cr, double sx, double sy) { - ENSURE_INIT_TRACE (); + _enter_trace (); _emit_line_info (); _emit_cairo_op (cr, "%g %g scale\n", sx, sy); DLCALL (cairo_scale, cr, sx, sy); + _exit_trace (); } void cairo_rotate (cairo_t *cr, double angle) { - ENSURE_INIT_TRACE (); + _enter_trace (); _emit_line_info (); _emit_cairo_op (cr, "%g rotate\n", angle); DLCALL (cairo_rotate, cr, angle); + _exit_trace (); } void cairo_transform (cairo_t *cr, const cairo_matrix_t *matrix) { - ENSURE_INIT_TRACE (); + _enter_trace (); _emit_line_info (); _emit_cairo_op (cr, "%g %g %g %g %g %g matrix transform\n", matrix->xx, matrix->yx, matrix->xy, matrix->yy, matrix->x0, matrix->y0); DLCALL (cairo_transform, cr, matrix); + _exit_trace (); } void cairo_set_matrix (cairo_t *cr, const cairo_matrix_t *matrix) { - ENSURE_INIT_TRACE (); + _enter_trace (); _emit_line_info (); if (_matrix_is_identity (matrix)) { _emit_cairo_op (cr, "identity set-matrix\n"); @@ -2313,6 +2395,7 @@ cairo_set_matrix (cairo_t *cr, const cairo_matrix_t *matrix) matrix->x0, matrix->y0); } DLCALL (cairo_set_matrix, cr, matrix); + _exit_trace (); } cairo_surface_t * @@ -2321,7 +2404,7 @@ cairo_get_target (cairo_t *cr) cairo_surface_t *ret; long surface_id; - ENSURE_INIT_TRACE (); + _enter_trace (); ret = DLCALL (cairo_get_target, cr); surface_id = _create_surface_id (ret); @@ -2331,6 +2414,7 @@ cairo_get_target (cairo_t *cr) _get_object (SURFACE, ret)->defined = true; } + _exit_trace (); return ret; } @@ -2340,7 +2424,7 @@ cairo_get_group_target (cairo_t *cr) cairo_surface_t *ret; long surface_id; - ENSURE_INIT_TRACE (); + _enter_trace (); ret = DLCALL (cairo_get_group_target, cr); surface_id = _create_surface_id (ret); @@ -2350,139 +2434,155 @@ cairo_get_group_target (cairo_t *cr) _get_object (SURFACE, ret)->defined = true; } + _exit_trace (); return ret; } void cairo_identity_matrix (cairo_t *cr) { - ENSURE_INIT_TRACE (); + _enter_trace (); _emit_line_info (); _emit_cairo_op (cr, "identity set-matrix\n"); DLCALL (cairo_identity_matrix, cr); + _exit_trace (); } void cairo_new_path (cairo_t *cr) { - ENSURE_INIT_TRACE (); + _enter_trace (); _emit_line_info (); _emit_cairo_op (cr, "n "); DLCALL (cairo_new_path, cr); + _exit_trace (); } void cairo_move_to (cairo_t *cr, double x, double y) { - ENSURE_INIT_TRACE (); + _enter_trace (); _emit_cairo_op (cr, "%g %g m ", x, y); DLCALL (cairo_move_to, cr, x, y); + _exit_trace (); } void cairo_new_sub_path (cairo_t *cr) { - ENSURE_INIT_TRACE (); + _enter_trace (); _emit_cairo_op (cr, "N "); DLCALL (cairo_new_sub_path, cr); + _exit_trace (); } void cairo_line_to (cairo_t *cr, double x, double y) { - ENSURE_INIT_TRACE (); + _enter_trace (); _emit_cairo_op (cr, "%g %g l ", x, y); DLCALL (cairo_line_to, cr, x, y); + _exit_trace (); } void cairo_curve_to (cairo_t *cr, double x1, double y1, double x2, double y2, double x3, double y3) { - ENSURE_INIT_TRACE (); + _enter_trace (); _emit_cairo_op (cr, "%g %g %g %g %g %g c ", x1, y1, x2, y2, x3, y3); DLCALL (cairo_curve_to, cr, x1, y1, x2, y2, x3, y3); + _exit_trace (); } void cairo_arc (cairo_t *cr, double xc, double yc, double radius, double angle1, double angle2) { - ENSURE_INIT_TRACE (); + _enter_trace (); _emit_cairo_op (cr, "%g %g %g %g %g arc\n", xc, yc, radius, angle1, angle2); DLCALL (cairo_arc, cr, xc, yc, radius, angle1, angle2); + _exit_trace (); } void cairo_arc_negative (cairo_t *cr, double xc, double yc, double radius, double angle1, double angle2) { - ENSURE_INIT_TRACE (); + _enter_trace (); _emit_cairo_op (cr, "%g %g %g %g %g arc-\n", xc, yc, radius, angle1, angle2); DLCALL (cairo_arc_negative, cr, xc, yc, radius, angle1, angle2); + _exit_trace (); } void cairo_rel_move_to (cairo_t *cr, double dx, double dy) { - ENSURE_INIT_TRACE (); + _enter_trace (); _emit_cairo_op (cr, "%g %g M ", dx, dy); DLCALL (cairo_rel_move_to, cr, dx, dy); + _exit_trace (); } void cairo_rel_line_to (cairo_t *cr, double dx, double dy) { - ENSURE_INIT_TRACE (); + _enter_trace (); _emit_cairo_op (cr, "%g %g L ", dx, dy); DLCALL (cairo_rel_line_to, cr, dx, dy); + _exit_trace (); } void cairo_rel_curve_to (cairo_t *cr, double dx1, double dy1, double dx2, double dy2, double dx3, double dy3) { - ENSURE_INIT_TRACE (); + _enter_trace (); _emit_cairo_op (cr, "%g %g %g %g %g %g C ", dx1, dy1, dx2, dy2, dx3, dy3); DLCALL (cairo_rel_curve_to, cr, dx1, dy1, dx2, dy2, dx3, dy3); + _exit_trace (); } void cairo_rectangle (cairo_t *cr, double x, double y, double width, double height) { - ENSURE_INIT_TRACE (); + _enter_trace (); _emit_cairo_op (cr, "%g %g %g %g rectangle\n", x, y, width, height); DLCALL (cairo_rectangle, cr, x, y, width, height); + _exit_trace (); } void cairo_close_path (cairo_t *cr) { - ENSURE_INIT_TRACE (); + _enter_trace (); _emit_cairo_op (cr, "h\n"); DLCALL (cairo_close_path, cr); + _exit_trace (); } void cairo_paint (cairo_t *cr) { - ENSURE_INIT_TRACE (); + _enter_trace (); _emit_line_info (); _emit_cairo_op (cr, "paint\n"); DLCALL (cairo_paint, cr); + _exit_trace (); } void cairo_paint_with_alpha (cairo_t *cr, double alpha) { - ENSURE_INIT_TRACE (); + _enter_trace (); _emit_line_info (); _emit_cairo_op (cr, "%g paint-with-alpha\n", alpha); DLCALL (cairo_paint_with_alpha, cr, alpha); + _exit_trace (); } void cairo_mask (cairo_t *cr, cairo_pattern_t *pattern) { - ENSURE_INIT_TRACE (); + _enter_trace (); _emit_line_info (); if (cr != NULL && pattern != NULL && _write_lock ()) { Object *obj = _get_object (PATTERN, pattern); @@ -2516,12 +2616,13 @@ cairo_mask (cairo_t *cr, cairo_pattern_t *pattern) _write_unlock (); } DLCALL (cairo_mask, cr, pattern); + _exit_trace (); } void cairo_mask_surface (cairo_t *cr, cairo_surface_t *surface, double x, double y) { - ENSURE_INIT_TRACE (); + _enter_trace (); _emit_line_info (); if (cr != NULL && surface != NULL && _write_lock ()) { if (_is_current (SURFACE, surface, 0) && @@ -2549,87 +2650,97 @@ cairo_mask_surface (cairo_t *cr, cairo_surface_t *surface, double x, double y) } DLCALL (cairo_mask_surface, cr, surface, x, y); + _exit_trace (); } void cairo_stroke (cairo_t *cr) { - ENSURE_INIT_TRACE (); + _enter_trace (); _emit_line_info (); _emit_cairo_op (cr, "stroke\n"); DLCALL (cairo_stroke, cr); + _exit_trace (); } void cairo_stroke_preserve (cairo_t *cr) { - ENSURE_INIT_TRACE (); + _enter_trace (); _emit_line_info (); _emit_cairo_op (cr, "stroke+\n"); DLCALL (cairo_stroke_preserve, cr); + _exit_trace (); } void cairo_fill (cairo_t *cr) { - ENSURE_INIT_TRACE (); + _enter_trace (); _emit_line_info (); _emit_cairo_op (cr, "fill\n"); DLCALL (cairo_fill, cr); + _exit_trace (); } void cairo_fill_preserve (cairo_t *cr) { - ENSURE_INIT_TRACE (); + _enter_trace (); _emit_line_info (); _emit_cairo_op (cr, "fill+\n"); DLCALL (cairo_fill_preserve, cr); + _exit_trace (); } void cairo_copy_page (cairo_t *cr) { - ENSURE_INIT_TRACE (); + _enter_trace (); _emit_line_info (); _emit_cairo_op (cr, "copy-page\n"); DLCALL (cairo_copy_page, cr); + _exit_trace (); } void cairo_show_page (cairo_t *cr) { - ENSURE_INIT_TRACE (); + _enter_trace (); _emit_line_info (); _emit_cairo_op (cr, "show-page\n"); DLCALL (cairo_show_page, cr); + _exit_trace (); } void cairo_clip (cairo_t *cr) { - ENSURE_INIT_TRACE (); + _enter_trace (); _emit_line_info (); _emit_cairo_op (cr, "clip\n"); DLCALL (cairo_clip, cr); + _exit_trace (); } void cairo_clip_preserve (cairo_t *cr) { - ENSURE_INIT_TRACE (); + _enter_trace (); _emit_line_info (); _emit_cairo_op (cr, "clip+\n"); DLCALL (cairo_clip_preserve, cr); + _exit_trace (); } void cairo_reset_clip (cairo_t *cr) { - ENSURE_INIT_TRACE (); + _enter_trace (); _emit_line_info (); _emit_cairo_op (cr, "reset-clip\n"); DLCALL (cairo_reset_clip, cr); + _exit_trace (); } @@ -2661,7 +2772,7 @@ _weight_to_string (cairo_font_weight_t font_weight) void cairo_select_font_face (cairo_t *cr, const char *family, cairo_font_slant_t slant, cairo_font_weight_t weight) { - ENSURE_INIT_TRACE (); + _enter_trace (); _emit_line_info (); if (cr != NULL && _write_lock ()) { _emit_context (cr); @@ -2672,6 +2783,7 @@ cairo_select_font_face (cairo_t *cr, const char *family, cairo_font_slant_t slan _write_unlock (); } DLCALL (cairo_select_font_face, cr, family, slant, weight); + _exit_trace (); } cairo_font_face_t * @@ -2680,7 +2792,7 @@ cairo_get_font_face (cairo_t *cr) cairo_font_face_t *ret; long font_face_id; - ENSURE_INIT_TRACE (); + _enter_trace (); ret = DLCALL (cairo_get_font_face, cr); font_face_id = _create_font_face_id (ret); @@ -2688,13 +2800,14 @@ cairo_get_font_face (cairo_t *cr) _emit_cairo_op (cr, "/font-face get %% f%ld\n", font_face_id); _push_operand (FONT_FACE, ret); + _exit_trace (); return ret; } void cairo_set_font_face (cairo_t *cr, cairo_font_face_t *font_face) { - ENSURE_INIT_TRACE (); + _enter_trace (); _emit_line_info (); if (cr != NULL && font_face != NULL && _write_lock ()) { if (_is_current (FONT_FACE, font_face, 0) && @@ -2720,27 +2833,30 @@ cairo_set_font_face (cairo_t *cr, cairo_font_face_t *font_face) } DLCALL (cairo_set_font_face, cr, font_face); + _exit_trace (); } void cairo_set_font_size (cairo_t *cr, double size) { - ENSURE_INIT_TRACE (); + _enter_trace (); _emit_line_info (); _emit_cairo_op (cr, "%g set-font-size\n", size); DLCALL (cairo_set_font_size, cr, size); + _exit_trace (); } void cairo_set_font_matrix (cairo_t *cr, const cairo_matrix_t *matrix) { - ENSURE_INIT_TRACE (); + _enter_trace (); _emit_line_info (); _emit_cairo_op (cr, "%g %g %g %g %g %g matrix set-font-matrix\n", matrix->xx, matrix->yx, matrix->xy, matrix->yy, matrix->x0, matrix->y0); DLCALL (cairo_set_font_matrix, cr, matrix); + _exit_trace (); } static const char * @@ -2794,8 +2910,6 @@ _emit_font_options (const cairo_font_options_t *options) cairo_hint_style_t hint_style; cairo_hint_metrics_t hint_metrics; - ENSURE_INIT_TRACE (); - _trace_printf ("<<"); antialias = DLCALL (cairo_font_options_get_antialias, options); @@ -2828,7 +2942,7 @@ _emit_font_options (const cairo_font_options_t *options) void cairo_set_font_options (cairo_t *cr, const cairo_font_options_t *options) { - ENSURE_INIT_TRACE (); + _enter_trace (); _emit_line_info (); if (cr != NULL && options != NULL && _write_lock ()) { _emit_context (cr); @@ -2838,6 +2952,7 @@ cairo_set_font_options (cairo_t *cr, const cairo_font_options_t *options) } DLCALL (cairo_set_font_options, cr, options); + _exit_trace (); } cairo_scaled_font_t * @@ -2845,7 +2960,7 @@ cairo_get_scaled_font (cairo_t *cr) { cairo_scaled_font_t *ret; - ENSURE_INIT_TRACE (); + _enter_trace (); ret = DLCALL (cairo_get_scaled_font, cr); @@ -2855,13 +2970,14 @@ cairo_get_scaled_font (cairo_t *cr) _get_object (SCALED_FONT, ret)->defined = true; } + _exit_trace (); return ret; } void cairo_set_scaled_font (cairo_t *cr, const cairo_scaled_font_t *scaled_font) { - ENSURE_INIT_TRACE (); + _enter_trace (); _emit_line_info (); if (cr != NULL && scaled_font != NULL) { if (_pop_operands_to (SCALED_FONT, scaled_font)) { @@ -2890,6 +3006,7 @@ cairo_set_scaled_font (cairo_t *cr, const cairo_scaled_font_t *scaled_font) } } DLCALL (cairo_set_scaled_font, cr, scaled_font); + _exit_trace (); } static void @@ -2917,7 +3034,7 @@ cairo_scaled_font_create (cairo_font_face_t *font_face, cairo_scaled_font_t *ret; long scaled_font_id; - ENSURE_INIT_TRACE (); + _enter_trace (); ret = DLCALL (cairo_scaled_font_create, font_face, font_matrix, ctm, options); scaled_font_id = _create_scaled_font_id (ret); @@ -2956,13 +3073,14 @@ cairo_scaled_font_create (cairo_font_face_t *font_face, _write_unlock (); } + _exit_trace (); return ret; } void cairo_show_text (cairo_t *cr, const char *utf8) { - ENSURE_INIT_TRACE (); + _enter_trace (); _emit_line_info (); if (cr != NULL && _write_lock ()) { _emit_context (cr); @@ -2971,6 +3089,7 @@ cairo_show_text (cairo_t *cr, const char *utf8) _write_unlock (); } DLCALL (cairo_show_text, cr, utf8); + _exit_trace (); } static void @@ -3066,7 +3185,7 @@ _emit_glyphs (cairo_scaled_font_t *font, void cairo_show_glyphs (cairo_t *cr, const cairo_glyph_t *glyphs, int num_glyphs) { - ENSURE_INIT_TRACE (); + _enter_trace (); _emit_line_info (); if (cr != NULL && glyphs != NULL && _write_lock ()) { cairo_scaled_font_t *font; @@ -3080,6 +3199,7 @@ cairo_show_glyphs (cairo_t *cr, const cairo_glyph_t *glyphs, int num_glyphs) } DLCALL (cairo_show_glyphs, cr, glyphs, num_glyphs); + _exit_trace (); } static const char * @@ -3104,7 +3224,7 @@ cairo_show_text_glyphs (cairo_t *cr, { cairo_scaled_font_t *font; - ENSURE_INIT_TRACE (); + _enter_trace (); font = DLCALL (cairo_get_scaled_font, cr); @@ -3134,12 +3254,13 @@ cairo_show_text_glyphs (cairo_t *cr, glyphs, num_glyphs, clusters, num_clusters, backward); + _exit_trace (); } void cairo_text_path (cairo_t *cr, const char *utf8) { - ENSURE_INIT_TRACE (); + _enter_trace (); _emit_line_info (); if (cr != NULL && _write_lock ()) { _emit_context (cr); @@ -3148,6 +3269,7 @@ cairo_text_path (cairo_t *cr, const char *utf8) _write_unlock (); } DLCALL (cairo_text_path, cr, utf8); + _exit_trace (); } void @@ -3155,7 +3277,7 @@ cairo_glyph_path (cairo_t *cr, const cairo_glyph_t *glyphs, int num_glyphs) { cairo_scaled_font_t *font; - ENSURE_INIT_TRACE (); + _enter_trace (); font = DLCALL (cairo_get_scaled_font, cr); @@ -3169,6 +3291,7 @@ cairo_glyph_path (cairo_t *cr, const cairo_glyph_t *glyphs, int num_glyphs) } DLCALL (cairo_glyph_path, cr, glyphs, num_glyphs); + _exit_trace (); } void @@ -3178,11 +3301,12 @@ cairo_append_path (cairo_t *cr, const cairo_path_t *path) int i; cairo_path_data_t *p; - ENSURE_INIT_TRACE (); + _enter_trace (); _emit_line_info (); if (cr == NULL || path == NULL) { DLCALL (cairo_append_path, cr, path); + _exit_trace (); return; } @@ -3212,6 +3336,7 @@ cairo_append_path (cairo_t *cr, const cairo_path_t *path) break; } } + _exit_trace (); } cairo_surface_t * @@ -3221,7 +3346,7 @@ cairo_image_surface_create (cairo_format_t format, int width, int height) long surface_id; const char *format_str; - ENSURE_INIT_TRACE (); + _enter_trace (); ret = DLCALL (cairo_image_surface_create, format, width, height); @@ -3243,6 +3368,7 @@ cairo_image_surface_create (cairo_format_t format, int width, int height) _write_unlock (); } + _exit_trace (); return ret; } @@ -3252,7 +3378,7 @@ cairo_image_surface_create_for_data (unsigned char *data, cairo_format_t format, cairo_surface_t *ret; long surface_id; - ENSURE_INIT_TRACE (); + _enter_trace (); ret = DLCALL (cairo_image_surface_create_for_data, data, format, width, height, stride); surface_id = _create_surface_id (ret); @@ -3292,6 +3418,7 @@ cairo_image_surface_create_for_data (unsigned char *data, cairo_format_t format, _write_unlock (); } + _exit_trace (); return ret; } @@ -3303,7 +3430,7 @@ cairo_surface_create_similar (cairo_surface_t *other, cairo_surface_t *ret; long surface_id; - ENSURE_INIT_TRACE (); + _enter_trace (); ret = DLCALL (cairo_surface_create_similar, other, content, width, height); surface_id = _create_surface_id (ret); @@ -3329,6 +3456,7 @@ cairo_surface_create_similar (cairo_surface_t *other, _write_unlock (); } + _exit_trace (); return ret; } @@ -3352,23 +3480,25 @@ _emit_surface_op (cairo_surface_t *surface, const char *fmt, ...) void cairo_surface_finish (cairo_surface_t *surface) { - ENSURE_INIT_TRACE (); + _enter_trace (); _emit_line_info (); DLCALL (cairo_surface_finish, surface); + _exit_trace (); } void cairo_surface_flush (cairo_surface_t *surface) { - ENSURE_INIT_TRACE (); + _enter_trace (); _emit_line_info (); DLCALL (cairo_surface_flush, surface); + _exit_trace (); } void cairo_surface_mark_dirty (cairo_surface_t *surface) { - ENSURE_INIT_TRACE (); + _enter_trace (); _emit_line_info (); if (surface != NULL && _write_lock ()) { if (_mark_dirty) { @@ -3381,13 +3511,14 @@ cairo_surface_mark_dirty (cairo_surface_t *surface) } DLCALL (cairo_surface_mark_dirty, surface); + _exit_trace (); } void cairo_surface_mark_dirty_rectangle (cairo_surface_t *surface, int x, int y, int width, int height) { - ENSURE_INIT_TRACE (); + _enter_trace (); _emit_line_info (); if (surface != NULL && _write_lock ()) { if (_mark_dirty) { @@ -3402,44 +3533,49 @@ cairo_surface_mark_dirty_rectangle (cairo_surface_t *surface, } DLCALL (cairo_surface_mark_dirty_rectangle, surface, x, y, width, height); + _exit_trace (); } void cairo_surface_set_device_offset (cairo_surface_t *surface, double x_offset, double y_offset) { - ENSURE_INIT_TRACE (); + _enter_trace (); _emit_line_info (); _emit_surface_op (surface, "%g %g set-device-offset\n", x_offset, y_offset); DLCALL (cairo_surface_set_device_offset, surface, x_offset, y_offset); + _exit_trace (); } void cairo_surface_set_fallback_resolution (cairo_surface_t *surface, double x_pixels_per_inch, double y_pixels_per_inch) { - ENSURE_INIT_TRACE (); + _enter_trace (); _emit_line_info (); _emit_surface_op (surface, "%g %g set-fallback-resolution\n", x_pixels_per_inch, y_pixels_per_inch); DLCALL (cairo_surface_set_fallback_resolution, surface, x_pixels_per_inch, y_pixels_per_inch); + _exit_trace (); } void cairo_surface_copy_page (cairo_surface_t *surface) { - ENSURE_INIT_TRACE (); + _enter_trace (); _emit_line_info (); _emit_surface_op (surface, "copy-page\n"); DLCALL (cairo_surface_copy_page, surface); + _exit_trace (); } void cairo_surface_show_page (cairo_surface_t *surface) { - ENSURE_INIT_TRACE (); + _enter_trace (); _emit_line_info (); _emit_surface_op (surface, "show-page\n"); DLCALL (cairo_surface_show_page, surface); + _exit_trace (); } cairo_status_t @@ -3450,7 +3586,8 @@ cairo_surface_set_mime_data (cairo_surface_t *surface, cairo_destroy_func_t destroy, void *closure) { - ENSURE_INIT_TRACE (); + cairo_status_t ret; + _enter_trace (); _emit_line_info (); if (surface != NULL && _write_lock ()) { _emit_surface (surface); @@ -3462,19 +3599,22 @@ cairo_surface_set_mime_data (cairo_surface_t *surface, _write_unlock (); } - return DLCALL (cairo_surface_set_mime_data, - surface, - mime_type, - data, length, - destroy, - closure); + ret = DLCALL (cairo_surface_set_mime_data, + surface, + mime_type, + data, length, + destroy, + closure); + _exit_trace (); + return ret; } #if CAIRO_HAS_PNG_FUNCTIONS cairo_status_t cairo_surface_write_to_png (cairo_surface_t *surface, const char *filename) { - ENSURE_INIT_TRACE (); + cairo_status_t ret; + _enter_trace (); _emit_line_info (); if (surface != NULL && _write_lock ()) { _trace_printf ("%% s%ld ", _get_surface_id (surface)); @@ -3482,7 +3622,9 @@ cairo_surface_write_to_png (cairo_surface_t *surface, const char *filename) _trace_printf (" write-to-png\n"); _write_unlock (); } - return DLCALL (cairo_surface_write_to_png, surface, filename); + ret = DLCALL (cairo_surface_write_to_png, surface, filename); + _exit_trace (); + return ret; } cairo_status_t @@ -3490,7 +3632,8 @@ cairo_surface_write_to_png_stream (cairo_surface_t *surface, cairo_write_func_t write_func, void *data) { - ENSURE_INIT_TRACE (); + cairo_status_t ret; + _enter_trace (); _emit_line_info (); if (surface != NULL && _write_lock ()) { char symbol[1024]; @@ -3504,8 +3647,10 @@ cairo_surface_write_to_png_stream (cairo_surface_t *surface, _trace_printf (" write-to-png-stream\n"); _write_unlock (); } - return DLCALL (cairo_surface_write_to_png_stream, - surface, write_func, data); + ret = DLCALL (cairo_surface_write_to_png_stream, + surface, write_func, data); + _exit_trace (); + return ret; } #endif @@ -3532,7 +3677,7 @@ cairo_pattern_create_rgb (double red, double green, double blue) cairo_pattern_t *ret; long pattern_id; - ENSURE_INIT_TRACE (); + _enter_trace (); ret = DLCALL (cairo_pattern_create_rgb, red, green, blue); pattern_id = _create_pattern_id (ret); @@ -3545,6 +3690,7 @@ cairo_pattern_create_rgb (double red, double green, double blue) _write_unlock (); } + _exit_trace (); return ret; } @@ -3554,7 +3700,7 @@ cairo_pattern_create_rgba (double red, double green, double blue, double alpha) cairo_pattern_t *ret; long pattern_id; - ENSURE_INIT_TRACE (); + _enter_trace (); ret = DLCALL (cairo_pattern_create_rgba, red, green, blue, alpha); pattern_id = _create_pattern_id (ret); @@ -3567,6 +3713,7 @@ cairo_pattern_create_rgba (double red, double green, double blue, double alpha) _write_unlock (); } + _exit_trace (); return ret; } @@ -3577,7 +3724,7 @@ cairo_pattern_create_for_surface (cairo_surface_t *surface) long pattern_id; long surface_id; - ENSURE_INIT_TRACE (); + _enter_trace (); ret = DLCALL (cairo_pattern_create_for_surface, surface); pattern_id = _create_pattern_id (ret); @@ -3600,6 +3747,7 @@ cairo_pattern_create_for_surface (cairo_surface_t *surface) _write_unlock (); } + _exit_trace (); return ret; } @@ -3609,7 +3757,7 @@ cairo_pattern_create_linear (double x0, double y0, double x1, double y1) cairo_pattern_t *ret; long pattern_id; - ENSURE_INIT_TRACE (); + _enter_trace (); ret = DLCALL (cairo_pattern_create_linear, x0, y0, x1, y1); pattern_id = _create_pattern_id (ret); @@ -3622,6 +3770,7 @@ cairo_pattern_create_linear (double x0, double y0, double x1, double y1) _write_unlock (); } + _exit_trace (); return ret; } @@ -3631,7 +3780,7 @@ cairo_pattern_create_radial (double cx0, double cy0, double radius0, double cx1, cairo_pattern_t *ret; long pattern_id; - ENSURE_INIT_TRACE (); + _enter_trace (); ret = DLCALL (cairo_pattern_create_radial, cx0, cy0, radius0, @@ -3647,35 +3796,38 @@ cairo_pattern_create_radial (double cx0, double cy0, double radius0, double cx1, _write_unlock (); } + _exit_trace (); return ret; } void cairo_pattern_add_color_stop_rgb (cairo_pattern_t *pattern, double offset, double red, double green, double blue) { - ENSURE_INIT_TRACE (); + _enter_trace (); _emit_line_info (); _emit_pattern_op (pattern, "%g %g %g %g 1 add-color-stop\n", offset, red, green, blue); DLCALL (cairo_pattern_add_color_stop_rgb, pattern, offset, red, green, blue); + _exit_trace (); } void cairo_pattern_add_color_stop_rgba (cairo_pattern_t *pattern, double offset, double red, double green, double blue, double alpha) { - ENSURE_INIT_TRACE (); + _enter_trace (); _emit_line_info (); _emit_pattern_op (pattern, "%g %g %g %g %g add-color-stop\n", offset, red, green, blue, alpha); DLCALL (cairo_pattern_add_color_stop_rgba, pattern, offset, red, green, blue, alpha); + _exit_trace (); } void cairo_pattern_set_matrix (cairo_pattern_t *pattern, const cairo_matrix_t *matrix) { - ENSURE_INIT_TRACE (); + _enter_trace (); _emit_line_info (); if (_matrix_is_identity (matrix)) { _emit_pattern_op (pattern, "identity set-matrix\n"); @@ -3687,6 +3839,7 @@ cairo_pattern_set_matrix (cairo_pattern_t *pattern, const cairo_matrix_t *matrix matrix->x0, matrix->y0); } DLCALL (cairo_pattern_set_matrix, pattern, matrix); + _exit_trace (); } static const char * @@ -3708,10 +3861,11 @@ _filter_to_string (cairo_filter_t filter) void cairo_pattern_set_filter (cairo_pattern_t *pattern, cairo_filter_t filter) { - ENSURE_INIT_TRACE (); + _enter_trace (); _emit_line_info (); _emit_pattern_op (pattern, "//%s set-filter\n", _filter_to_string (filter)); DLCALL (cairo_pattern_set_filter, pattern, filter); + _exit_trace (); } static const char * @@ -3731,10 +3885,11 @@ _extend_to_string (cairo_extend_t extend) void cairo_pattern_set_extend (cairo_pattern_t *pattern, cairo_extend_t extend) { - ENSURE_INIT_TRACE (); + _enter_trace (); _emit_line_info (); _emit_pattern_op (pattern, "//%s set-extend\n", _extend_to_string (extend)); DLCALL (cairo_pattern_set_extend, pattern, extend); + _exit_trace (); } #if CAIRO_HAS_FT_FONT @@ -3745,7 +3900,7 @@ cairo_ft_font_face_create_for_pattern (FcPattern *pattern) cairo_font_face_t *ret; long font_face_id; - ENSURE_INIT_TRACE (); + _enter_trace (); ret = DLCALL (cairo_ft_font_face_create_for_pattern, pattern); font_face_id = _create_font_face_id (ret); @@ -3773,6 +3928,7 @@ cairo_ft_font_face_create_for_pattern (FcPattern *pattern) free (parsed); } + _exit_trace (); return ret; } #endif /* CAIRO_HAS_FC_FONT*/ @@ -3799,18 +3955,22 @@ cairo_ft_font_face_create_for_ft_face (FT_Face face, int load_flags) FtFaceData *data; long font_face_id; - ENSURE_INIT_TRACE (); + _enter_trace (); ret = DLCALL (cairo_ft_font_face_create_for_ft_face, face, load_flags); font_face_id = _create_font_face_id (ret); - if (face == NULL) + if (face == NULL) { + _exit_trace (); return ret; + } obj = _get_object (NONE, face); data = obj->data; - if (data == NULL) + if (data == NULL) { + _exit_trace (); return ret; + } _emit_line_info (); if (_write_lock ()) { @@ -3826,6 +3986,7 @@ cairo_ft_font_face_create_for_ft_face (FT_Face face, int load_flags) _write_unlock (); } + _exit_trace (); return ret; } @@ -3865,7 +4026,7 @@ FT_New_Face (FT_Library library, const char *pathname, FT_Long index, FT_Face *f { FT_Error ret; - ENSURE_INIT_TRACE (); + _enter_trace (); ret = DLCALL (FT_New_Face, library, pathname, index, face); if (ret == 0) { @@ -3879,6 +4040,7 @@ FT_New_Face (FT_Library library, const char *pathname, FT_Long index, FT_Face *f obj->destroy = _ft_face_data_destroy; } + _exit_trace (); return ret; } @@ -3887,7 +4049,7 @@ FT_New_Memory_Face (FT_Library library, const FT_Byte *mem, FT_Long size, FT_Lon { FT_Error ret; - ENSURE_INIT_TRACE (); + _enter_trace (); ret = DLCALL (FT_New_Memory_Face, library, mem, size, index, face); if (ret == 0) { @@ -3901,6 +4063,7 @@ FT_New_Memory_Face (FT_Library library, const FT_Byte *mem, FT_Long size, FT_Lon obj->destroy = _ft_face_data_destroy; } + _exit_trace (); return ret; } @@ -3917,7 +4080,7 @@ FT_Open_Face (FT_Library library, const FT_Open_Args *args, FT_Long index, FT_Fa { FT_Error ret; - ENSURE_INIT_TRACE (); + _enter_trace (); ret = DLCALL (FT_Open_Face, library, args, index, face); if (args->flags & FT_OPEN_MEMORY) @@ -3931,6 +4094,7 @@ FT_Open_Face (FT_Library library, const FT_Open_Args *args, FT_Long index, FT_Fa fprintf (stderr, "FT_Open_Face (path=%s, %ld) = %p\n", args->pathname, index, *face); + _exit_trace (); return ret; } #endif @@ -3938,11 +4102,14 @@ FT_Open_Face (FT_Library library, const FT_Open_Args *args, FT_Long index, FT_Fa FT_Error FT_Done_Face (FT_Face face) { - ENSURE_INIT_TRACE (); + FT_Error ret; + _enter_trace (); _object_destroy (_get_object (NONE, face)); - return DLCALL (FT_Done_Face, face); + ret = DLCALL (FT_Done_Face, face); + _exit_trace (); + return ret; } #endif @@ -3973,7 +4140,7 @@ cairo_ps_surface_create (const char *filename, double width_in_points, double he cairo_surface_t *ret; long surface_id; - ENSURE_INIT_TRACE (); + _enter_trace (); ret = DLCALL (cairo_ps_surface_create, filename, width_in_points, height_in_points); surface_id = _create_surface_id (ret); @@ -3996,6 +4163,7 @@ cairo_ps_surface_create (const char *filename, double width_in_points, double he _write_unlock (); } + _exit_trace (); return ret; } @@ -4005,7 +4173,7 @@ cairo_ps_surface_create_for_stream (cairo_write_func_t write_func, void *closure cairo_surface_t *ret; long surface_id; - ENSURE_INIT_TRACE (); + _enter_trace (); ret = DLCALL (cairo_ps_surface_create_for_stream, write_func, closure, width_in_points, height_in_points); surface_id = _create_surface_id (ret); @@ -4025,15 +4193,17 @@ cairo_ps_surface_create_for_stream (cairo_write_func_t write_func, void *closure _write_unlock (); } + _exit_trace (); return ret; } void cairo_ps_surface_set_size (cairo_surface_t *surface, double width_in_points, double height_in_points) { - ENSURE_INIT_TRACE (); + _enter_trace (); _emit_line_info (); DLCALL (cairo_ps_surface_set_size, surface, width_in_points, height_in_points); + _exit_trace (); } #endif @@ -4047,7 +4217,7 @@ cairo_pdf_surface_create (const char *filename, double width_in_points, double h cairo_surface_t *ret; long surface_id; - ENSURE_INIT_TRACE (); + _enter_trace (); ret = DLCALL (cairo_pdf_surface_create, filename, width_in_points, height_in_points); surface_id = _create_surface_id (ret); @@ -4070,6 +4240,7 @@ cairo_pdf_surface_create (const char *filename, double width_in_points, double h _write_unlock (); } + _exit_trace (); return ret; } @@ -4079,7 +4250,7 @@ cairo_pdf_surface_create_for_stream (cairo_write_func_t write_func, void *closur cairo_surface_t *ret; long surface_id; - ENSURE_INIT_TRACE (); + _enter_trace (); ret = DLCALL (cairo_pdf_surface_create_for_stream, write_func, closure, width_in_points, height_in_points); surface_id = _create_surface_id (ret); @@ -4098,15 +4269,17 @@ cairo_pdf_surface_create_for_stream (cairo_write_func_t write_func, void *closur _push_operand (SURFACE, ret); _write_unlock (); } + _exit_trace (); return ret; } void cairo_pdf_surface_set_size (cairo_surface_t *surface, double width_in_points, double height_in_points) { - ENSURE_INIT_TRACE (); + _enter_trace (); _emit_line_info (); DLCALL (cairo_pdf_surface_set_size, surface, width_in_points, height_in_points); + _exit_trace (); } #endif @@ -4119,7 +4292,7 @@ cairo_svg_surface_create (const char *filename, double width, double height) cairo_surface_t *ret; long surface_id; - ENSURE_INIT_TRACE (); + _enter_trace (); ret = DLCALL (cairo_svg_surface_create, filename, width, height); surface_id = _create_surface_id (ret); @@ -4142,6 +4315,7 @@ cairo_svg_surface_create (const char *filename, double width, double height) _write_unlock (); } + _exit_trace (); return ret; } @@ -4151,7 +4325,7 @@ cairo_svg_surface_create_for_stream (cairo_write_func_t write_func, void *closur cairo_surface_t *ret; long surface_id; - ENSURE_INIT_TRACE (); + _enter_trace (); ret = DLCALL (cairo_svg_surface_create_for_stream, write_func, closure, width, height); surface_id = _create_surface_id (ret); @@ -4171,6 +4345,7 @@ cairo_svg_surface_create_for_stream (cairo_write_func_t write_func, void *closur _write_unlock (); } + _exit_trace (); return ret; } @@ -4183,7 +4358,7 @@ cairo_image_surface_create_from_png (const char *filename) cairo_surface_t *ret; long surface_id; - ENSURE_INIT_TRACE (); + _enter_trace (); ret = DLCALL (cairo_image_surface_create_from_png, filename); @@ -4204,6 +4379,7 @@ cairo_image_surface_create_from_png (const char *filename) _write_unlock (); } + _exit_trace (); return ret; } @@ -4213,7 +4389,7 @@ cairo_image_surface_create_from_png_stream (cairo_read_func_t read_func, void *c cairo_surface_t *ret; long surface_id; - ENSURE_INIT_TRACE (); + _enter_trace (); ret = DLCALL (cairo_image_surface_create_from_png_stream, read_func, closure); surface_id = _create_surface_id (ret); @@ -4229,6 +4405,7 @@ cairo_image_surface_create_from_png_stream (cairo_read_func_t read_func, void *c _write_unlock (); } + _exit_trace (); return ret; } #endif @@ -4251,7 +4428,7 @@ cairo_xlib_surface_create (Display *dpy, cairo_surface_t *ret; long surface_id; - ENSURE_INIT_TRACE (); + _enter_trace (); ret = DLCALL (cairo_xlib_surface_create, dpy, drawable, visual, width, height); @@ -4278,6 +4455,7 @@ cairo_xlib_surface_create (Display *dpy, _write_unlock (); } + _exit_trace (); return ret; } @@ -4290,7 +4468,7 @@ cairo_xlib_surface_create_for_bitmap (Display *dpy, cairo_surface_t *ret; long surface_id; - ENSURE_INIT_TRACE (); + _enter_trace (); ret = DLCALL (cairo_xlib_surface_create_for_bitmap, dpy, bitmap, screen, width, height); @@ -4318,6 +4496,7 @@ cairo_xlib_surface_create_for_bitmap (Display *dpy, _write_unlock (); } + _exit_trace (); return ret; } @@ -4333,7 +4512,7 @@ cairo_xlib_surface_create_with_xrender_format (Display *dpy, cairo_surface_t *ret; long surface_id; - ENSURE_INIT_TRACE (); + _enter_trace (); ret = DLCALL (cairo_xlib_surface_create_with_xrender_format, dpy, drawable, screen, format, width, height); @@ -4362,6 +4541,7 @@ cairo_xlib_surface_create_with_xrender_format (Display *dpy, _write_unlock (); } + _exit_trace (); return ret; } #endif @@ -4378,7 +4558,7 @@ cairo_script_surface_create (cairo_script_context_t *ctx, cairo_surface_t *ret; long surface_id; - ENSURE_INIT_TRACE (); + _enter_trace (); ret = DLCALL (cairo_script_surface_create, ctx, content, width, height); surface_id = _create_surface_id (ret); @@ -4400,6 +4580,7 @@ cairo_script_surface_create (cairo_script_context_t *ctx, _write_unlock (); } + _exit_trace (); return ret; } @@ -4410,7 +4591,7 @@ cairo_script_surface_create_for_target (cairo_script_context_t *ctx, cairo_surface_t *ret; long surface_id; - ENSURE_INIT_TRACE (); + _enter_trace (); ret = DLCALL (cairo_script_surface_create_for_target, ctx, target); surface_id = _create_surface_id (ret); @@ -4426,6 +4607,7 @@ cairo_script_surface_create_for_target (cairo_script_context_t *ctx, _write_unlock (); } + _exit_trace (); return ret; } #endif @@ -4440,7 +4622,7 @@ _cairo_test_fallback_surface_create (cairo_content_t content, cairo_surface_t *ret; long surface_id; - ENSURE_INIT_TRACE (); + _enter_trace (); ret = DLCALL (_cairo_test_fallback_surface_create, content, width, height); surface_id = _create_surface_id (ret); @@ -4462,6 +4644,7 @@ _cairo_test_fallback_surface_create (cairo_content_t content, _write_unlock (); } + _exit_trace (); return ret; } @@ -4472,7 +4655,7 @@ _cairo_test_paginated_surface_create (cairo_surface_t *surface) cairo_surface_t *ret; long surface_id; - ENSURE_INIT_TRACE (); + _enter_trace (); ret = DLCALL (_cairo_test_paginated_surface_create, surface); surface_id = _create_surface_id (ret); @@ -4490,6 +4673,7 @@ _cairo_test_paginated_surface_create (cairo_surface_t *surface) _write_unlock (); } + _exit_trace (); return ret; } @@ -4501,7 +4685,7 @@ _cairo_test_null_surface_create (cairo_content_t content) cairo_surface_t *ret; long surface_id; - ENSURE_INIT_TRACE (); + _enter_trace (); ret = DLCALL (_cairo_test_null_surface_create, content); surface_id = _create_surface_id (ret); @@ -4519,6 +4703,7 @@ _cairo_test_null_surface_create (cairo_content_t content) _write_unlock (); } + _exit_trace (); return ret; } #endif @@ -4530,7 +4715,7 @@ cairo_meta_surface_create (cairo_content_t content, cairo_surface_t *ret; long surface_id; - ENSURE_INIT_TRACE (); + _enter_trace (); ret = DLCALL (cairo_meta_surface_create, content, extents); surface_id = _create_surface_id (ret); @@ -4561,6 +4746,7 @@ cairo_meta_surface_create (cairo_content_t content, _write_unlock (); } + _exit_trace (); return ret; } @@ -4569,7 +4755,7 @@ cairo_meta_surface_replay (cairo_surface_t *meta, cairo_surface_t *target) { cairo_status_t ret; - ENSURE_INIT_TRACE (); + _enter_trace (); ret = DLCALL (cairo_meta_surface_replay, meta, target); @@ -4582,6 +4768,7 @@ cairo_meta_surface_replay (cairo_surface_t *meta, cairo_surface_t *target) _consume_operand (); } + _exit_trace (); return ret; } @@ -4595,7 +4782,7 @@ cairo_vg_surface_create (cairo_vg_context_t *context, cairo_surface_t *ret; long surface_id; - ENSURE_INIT_TRACE (); + _enter_trace (); ret = DLCALL (cairo_vg_surface_create, context, content, width, height); surface_id = _create_surface_id (ret); @@ -4617,6 +4804,7 @@ cairo_vg_surface_create (cairo_vg_context_t *context, _write_unlock (); } + _exit_trace (); return ret; } @@ -4629,7 +4817,7 @@ cairo_vg_surface_create_for_image (cairo_vg_context_t *context, cairo_surface_t *ret; long surface_id; - ENSURE_INIT_TRACE (); + _enter_trace (); ret = DLCALL (cairo_vg_surface_create_for_image, context, image, format, width, height); @@ -4655,6 +4843,7 @@ cairo_vg_surface_create_for_image (cairo_vg_context_t *context, _write_unlock (); } + _exit_trace (); return ret; } #endif |