[cairo-commit] util/cairo-trace

Chris Wilson ickle at kemper.freedesktop.org
Thu Mar 15 05:00:41 PDT 2012


 util/cairo-trace/trace.c |   22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

New commits:
commit f5b5fad66e9c545f332a5f5cf8bd86c7d77caa93
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Thu Mar 15 11:58:51 2012 +0000

    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 <chris at chris-wilson.co.uk>

diff --git a/util/cairo-trace/trace.c b/util/cairo-trace/trace.c
index ebcb293..0b574a1 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 ();
 }


More information about the cairo-commit mailing list