summaryrefslogtreecommitdiff
path: root/src/cairo-surface-observer.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/cairo-surface-observer.c')
-rw-r--r--[-rwxr-xr-x]src/cairo-surface-observer.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/cairo-surface-observer.c b/src/cairo-surface-observer.c
index 8bbd6109c..ee65b72d1 100755..100644
--- a/src/cairo-surface-observer.c
+++ b/src/cairo-surface-observer.c
@@ -653,7 +653,7 @@ add_record (cairo_observation_t *log,
}
static void
-sync (cairo_surface_t *target, int x, int y)
+_cairo_surface_sync (cairo_surface_t *target, int x, int y)
{
cairo_rectangle_int_t extents;
@@ -751,7 +751,7 @@ _cairo_surface_observer_paint (void *abstract_surface,
if (unlikely (status))
return status;
- sync (surface->target, x, y);
+ _cairo_surface_sync (surface->target, x, y);
t = _cairo_time_get_delta (t);
add_record_paint (&surface->log, surface->target, op, source, clip, t);
@@ -837,7 +837,7 @@ _cairo_surface_observer_mask (void *abstract_surface,
if (unlikely (status))
return status;
- sync (surface->target, x, y);
+ _cairo_surface_sync (surface->target, x, y);
t = _cairo_time_get_delta (t);
add_record_mask (&surface->log,
@@ -944,7 +944,7 @@ _cairo_surface_observer_fill (void *abstract_surface,
if (unlikely (status))
return status;
- sync (surface->target, x, y);
+ _cairo_surface_sync (surface->target, x, y);
t = _cairo_time_get_delta (t);
add_record_fill (&surface->log,
@@ -1063,7 +1063,7 @@ _cairo_surface_observer_stroke (void *abstract_surface,
if (unlikely (status))
return status;
- sync (surface->target, x, y);
+ _cairo_surface_sync (surface->target, x, y);
t = _cairo_time_get_delta (t);
add_record_stroke (&surface->log,
@@ -1183,7 +1183,7 @@ _cairo_surface_observer_glyphs (void *abstract_surface,
if (unlikely (status))
return status;
- sync (surface->target, x, y);
+ _cairo_surface_sync (surface->target, x, y);
t = _cairo_time_get_delta (t);
add_record_glyphs (&surface->log,
@@ -1368,11 +1368,16 @@ static const cairo_surface_backend_t _cairo_surface_observer_backend = {
/**
* cairo_surface_create_observer:
* @target: an existing surface for which the observer will watch
+ * @mode: sets the mode of operation (normal vs. record)
*
* Create a new surface that exists solely to watch another is doing. In
* the process it will log operations and times, which are fast, which are
* slow, which are frequent, etc.
*
+ * The @mode parameter can be set to either CAIRO_SURFACE_OBSERVER_NORMAL
+ * or CAIRO_SURFACE_OBSERVER_RECORD_OPERATIONS, to control whether or not
+ * the internal observer should record operations.
+ *
* Return value: a pointer to the newly allocated surface. The caller
* owns the surface and should call cairo_surface_destroy() when done
* with it.