[cairo-commit] util/cairo-script
Chris Wilson
ickle at kemper.freedesktop.org
Wed Nov 28 02:05:19 PST 2012
util/cairo-script/cairo-script-operators.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
New commits:
commit 153b11612f34294241429b53722839984f367f2e
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date: Wed Nov 28 09:57:29 2012 +0000
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 at chris-wilson.co.uk>
diff --git a/util/cairo-script/cairo-script-operators.c b/util/cairo-script/cairo-script-operators.c
index 42f5296..4b7d4fc 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;
}
More information about the cairo-commit
mailing list