summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2012-11-28 09:57:29 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2012-11-28 09:57:29 +0000
commit153b11612f34294241429b53722839984f367f2e (patch)
treeaaad359248caff3b789cc8696520054aaaa71c3d
parentdfbf80a57d161707d105d1b5711c85890fe18a6d (diff)
script: Fix map-to-image/unmap stack manipulations
The idiom (and expectation) for surface operators is that it leaves the surface on the stack for the next operation. Also we need to hold onto a surface reference for objects put onto the stack, yet for the map-to-image return we did not own one. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--util/cairo-script/cairo-script-operators.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/util/cairo-script/cairo-script-operators.c b/util/cairo-script/cairo-script-operators.c
index 42f5296f9..4b7d4fc40 100644
--- a/util/cairo-script/cairo-script-operators.c
+++ b/util/cairo-script/cairo-script-operators.c
@@ -3690,8 +3690,8 @@ _map_to_image (csi_t *ctx)
}
obj.type = CSI_OBJECT_TYPE_SURFACE;
- obj.datum.surface = cairo_surface_map_to_image (surface, r);
- pop (2);
+ obj.datum.surface = cairo_surface_reference (cairo_surface_map_to_image (surface, r));
+ pop (1);
return push (&obj);
}
@@ -3712,7 +3712,7 @@ _unmap_image (csi_t *ctx)
cairo_surface_unmap_image (surface, image);
- pop (2);
+ pop (1);
return CSI_STATUS_SUCCESS;
}