From 8abd21bd3afc143501f66fdcdc0c6c4139df490b Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Tue, 23 Dec 2008 15:09:15 +0000 Subject: [PATCH] [script] Call the context creation hook Hook in the creation hook so applications can record or even modify the contexts used in replay. --- util/cairo-script/cairo-script-operators.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/util/cairo-script/cairo-script-operators.c b/util/cairo-script/cairo-script-operators.c index 6b328a98d..d2bdb4c84 100644 --- a/util/cairo-script/cairo-script-operators.c +++ b/util/cairo-script/cairo-script-operators.c @@ -956,6 +956,7 @@ _context (csi_t *ctx) csi_status_t status; cairo_surface_t *surface; cairo_t *cr; + csi_context_create_func_t hook; csi_proxy_t *proxy; check (1); @@ -964,7 +965,11 @@ _context (csi_t *ctx) if (_csi_unlikely (status)) return status; - cr = cairo_create (surface); + hook = ctx->hooks.context_create; + if (hook != NULL) + cr = hook (ctx->hooks.closure, surface); + else + cr = cairo_create (surface); proxy = _csi_proxy_create (ctx, cr, NULL, ctx->hooks.context_destroy,