diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2009-07-15 16:37:25 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2009-07-17 11:50:02 +0100 |
commit | 52fa8760aeef38abbab0484a6978adaf4f100f90 (patch) | |
tree | 916eda04b5bc1bc81d8c716e5b79bcc4bea9f294 /util | |
parent | 34d5b862bce3e9273391eb5d2c384394cca94d2d (diff) |
Add OpenVG backend.
Based on the work by Øyvind Kolås and Pierre Tardy -- many thanks to
Pierre for pushing this backend for inclusion as well as testing and
reviewing my initial patch. And many more thanks to pippin for writing the
backend in the first place!
Hacked and chopped by myself into a suitable basis for a backend. Quite a
few issues remain open, but would seem to be ready for testing on suitable
hardware.
Diffstat (limited to 'util')
-rw-r--r-- | util/cairo-trace/trace.c | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/util/cairo-trace/trace.c b/util/cairo-trace/trace.c index 26e0d02b..3af1fffd 100644 --- a/util/cairo-trace/trace.c +++ b/util/cairo-trace/trace.c @@ -4357,3 +4357,73 @@ cairo_meta_surface_replay (cairo_surface_t *meta, cairo_surface_t *target) return ret; } + +#if CAIRO_HAS_VG_SURFACE +#include <cairo-vg.h> +cairo_surface_t * +cairo_vg_surface_create (cairo_vg_context_t *context, + cairo_content_t content, + int width, int height) +{ + cairo_surface_t *ret; + long surface_id; + + ret = DLCALL (cairo_vg_surface_create, context, content, width, height); + surface_id = _create_surface_id (ret); + + _emit_line_info (); + if (_write_lock ()) { + _trace_printf ("dict\n" + " /type /vg set\n" + " /content //%s set\n" + " /width %d set\n" + " /height %d set\n" + " surface dup /s%ld exch def\n", + _content_to_string (content), + width, height, + surface_id); + _surface_object_set_size (ret, width, height); + _get_object (SURFACE, ret)->defined = true; + _push_operand (SURFACE, ret); + _write_unlock (); + } + + return ret; +} + +cairo_surface_t * +cairo_vg_surface_create_for_image (cairo_vg_context_t *context, + VGImage image, + VGImageFormat format, + int width, int height) +{ + cairo_surface_t *ret; + long surface_id; + + ret = DLCALL (cairo_vg_surface_create_for_image, + context, image, format, width, height); + surface_id = _create_surface_id (ret); + + _emit_line_info (); + if (_write_lock ()) { + cairo_content_t content; + + content = DLCALL (cairo_surface_get_content, ret); + _trace_printf ("dict\n" + " /type /vg set\n" + " /content //%s set\n" + " /width %d set\n" + " /height %d set\n" + " surface dup /s%ld exch def\n", + _content_to_string (content), + width, height, + surface_id); + _surface_object_set_size (ret, width, height); + _get_object (SURFACE, ret)->defined = true; + _push_operand (SURFACE, ret); + _write_unlock (); + } + + return ret; +} +#endif |