From f5b5fad66e9c545f332a5f5cf8bd86c7d77caa93 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Thu, 15 Mar 2012 11:58:51 +0000 Subject: [PATCH] trace: Add breadcrumb for cairo_image_surface_get_data() Just emit a marker for when cairo_image_surface_get_data() is called on a surface so that we have a breadcrumb for when the pixels are first exported. (Though note that pointer may be kept around and used much later.) Signed-off-by: Chris Wilson --- util/cairo-trace/trace.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/util/cairo-trace/trace.c b/util/cairo-trace/trace.c index ebcb29322..0b574a194 100644 --- a/util/cairo-trace/trace.c +++ b/util/cairo-trace/trace.c @@ -3510,6 +3510,24 @@ cairo_image_surface_create_for_data (unsigned char *data, cairo_format_t format, return ret; } +unsigned char * +cairo_image_surface_get_data (cairo_surface_t *surface) +{ + unsigned char *ptr; + + /* Just leave some breadcrumbs */ + _enter_trace (); + _emit_line_info (); + if (surface != NULL && _write_lock ()) { + _trace_printf ("%% s%ld get-data\n", _get_surface_id (surface)); + _write_unlock (); + } + ptr = DLCALL (cairo_image_surface_get_data, surface); + _exit_trace (); + + return ptr; +} + cairo_pattern_t * cairo_pattern_create_raster_source (void *data, cairo_content_t content, int width, int height) { @@ -3746,6 +3764,10 @@ cairo_surface_flush (cairo_surface_t *surface) { _enter_trace (); _emit_line_info (); + if (surface != NULL && _write_lock ()) { + _trace_printf ("%% s%ld flush\n", _get_surface_id (surface)); + _write_unlock (); + } DLCALL (cairo_surface_flush, surface); _exit_trace (); }