summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2011-09-27 14:55:57 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2011-09-27 14:56:55 +0100
commitadd9a4092b69ba359917407e0e7f584c5dbfdc81 (patch)
treed63f9c2670683a3cdce7a3734d9d0399eedc13d6
parentb8ae60f619d030dab48995fc6cb540b7935eb5cf (diff)
trace: Emit an stack operation to create a pattern from an undefined surface
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--util/cairo-trace/trace.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/util/cairo-trace/trace.c b/util/cairo-trace/trace.c
index 65f8fbac..74759583 100644
--- a/util/cairo-trace/trace.c
+++ b/util/cairo-trace/trace.c
@@ -2164,6 +2164,8 @@ cairo_set_source_surface (cairo_t *cr, cairo_surface_t *surface, double x, doubl
_enter_trace ();
_emit_line_info ();
if (cr != NULL && surface != NULL && _write_lock ()) {
+ Object *obj = _get_object (SURFACE, surface);
+
if (_is_current (SURFACE, surface, 0) &&
_is_current (CONTEXT, cr, 1))
{
@@ -2175,12 +2177,16 @@ cairo_set_source_surface (cairo_t *cr, cairo_surface_t *surface, double x, doubl
_trace_printf ("exch ");
_exch_operands ();
_consume_operand ();
+ } else if (obj->defined) {
+ _emit_context (cr);
+ _trace_printf ("s%ld ", obj->token);
} else {
_emit_context (cr);
- _trace_printf ("s%ld ", _get_surface_id (surface));
+ _trace_printf ("%d index ",
+ current_stack_depth - obj->operand - 1);
}
- if (_get_object (SURFACE, surface)->foreign)
+ if (obj->foreign)
_emit_source_image (surface);
_trace_printf ("pattern");
@@ -2703,6 +2709,7 @@ cairo_mask_surface (cairo_t *cr, cairo_surface_t *surface, double x, double y)
_enter_trace ();
_emit_line_info ();
if (cr != NULL && surface != NULL && _write_lock ()) {
+ Object *obj = _get_object (SURFACE, surface);
if (_is_current (SURFACE, surface, 0) &&
_is_current (CONTEXT, cr, 1))
{
@@ -2714,9 +2721,13 @@ cairo_mask_surface (cairo_t *cr, cairo_surface_t *surface, double x, double y)
_trace_printf ("exch ");
_exch_operands ();
_consume_operand ();
+ } else if (obj->defined){
+ _emit_context (cr);
+ _trace_printf ("s%ld ", obj->token);
} else {
_emit_context (cr);
- _trace_printf ("s%ld ", _get_surface_id (surface));
+ _trace_printf ("%d index ",
+ current_stack_depth - obj->operand - 1);
}
_trace_printf ("pattern");