[PS/PDF/SVG] Rename internal symbols to have _cairo_*_surface prefix

This commit is contained in:
Behdad Esfahbod 2007-03-07 15:54:20 -05:00
parent 2cc1c73705
commit 88632575bf
3 changed files with 131 additions and 131 deletions

View file

@ -657,7 +657,7 @@ compress_dup (const void *data, unsigned long data_size,
* no SMask object will be emitted and *id_ret will be set to 0.
*/
static cairo_status_t
emit_smask (cairo_pdf_surface_t *surface,
_cairo_pdf_surface_emit_smask (cairo_pdf_surface_t *surface,
cairo_image_surface_t *image,
cairo_pdf_resource_t *stream_ret)
{
@ -728,7 +728,7 @@ emit_smask (cairo_pdf_surface_t *surface,
/* Emit image data into the given surface, providing a resource that
* can be used to reference the data in image_ret. */
static cairo_status_t
emit_image (cairo_pdf_surface_t *surface,
_cairo_pdf_surface_emit_image (cairo_pdf_surface_t *surface,
cairo_image_surface_t *image,
cairo_pdf_resource_t *image_ret)
{
@ -747,7 +747,7 @@ emit_image (cairo_pdf_surface_t *surface,
/* These are the only image formats we currently support, (which
* makes things a lot simpler here). This is enforced through
* _analyze_operation which only accept source surfaces of
* _cairo_pdf_surface_analyze_operation which only accept source surfaces of
* CONTENT_COLOR or CONTENT_COLOR_ALPHA.
*/
assert (image->format == CAIRO_FORMAT_RGB24 || image->format == CAIRO_FORMAT_ARGB32);
@ -797,7 +797,7 @@ emit_image (cairo_pdf_surface_t *surface,
need_smask = FALSE;
if (image->format == CAIRO_FORMAT_ARGB32) {
status = emit_smask (surface, image, &smask);
status = _cairo_pdf_surface_emit_smask (surface, image, &smask);
if (status)
goto CLEANUP_COMPRESSED;
@ -841,7 +841,7 @@ emit_image (cairo_pdf_surface_t *surface,
}
static cairo_status_t
emit_solid_pattern (cairo_pdf_surface_t *surface,
_cairo_pdf_surface_emit_solid_pattern (cairo_pdf_surface_t *surface,
cairo_solid_pattern_t *pattern)
{
cairo_pdf_resource_t alpha;
@ -866,7 +866,7 @@ emit_solid_pattern (cairo_pdf_surface_t *surface,
}
static cairo_status_t
emit_surface_pattern (cairo_pdf_surface_t *surface,
_cairo_pdf_surface_emit_surface_pattern (cairo_pdf_surface_t *surface,
cairo_surface_pattern_t *pattern)
{
cairo_pdf_resource_t stream;
@ -896,7 +896,7 @@ emit_surface_pattern (cairo_pdf_surface_t *surface,
if (status)
goto BAIL2;
status = emit_image (surface, image, &image_resource);
status = _cairo_pdf_surface_emit_image (surface, image, &image_resource);
if (status)
goto BAIL;
@ -1036,7 +1036,7 @@ typedef struct _cairo_pdf_color_stop {
} cairo_pdf_color_stop_t;
static cairo_pdf_resource_t
emit_linear_colorgradient (cairo_pdf_surface_t *surface,
_cairo_pdf_surface_emit_linear_colorgradient (cairo_pdf_surface_t *surface,
cairo_pdf_color_stop_t *stop1,
cairo_pdf_color_stop_t *stop2)
{
@ -1065,7 +1065,7 @@ emit_linear_colorgradient (cairo_pdf_surface_t *surface,
}
static cairo_pdf_resource_t
emit_stitched_colorgradient (cairo_pdf_surface_t *surface,
_cairo_pdf_surface_emit_stitched_colorgradient (cairo_pdf_surface_t *surface,
unsigned int n_stops,
cairo_pdf_color_stop_t stops[])
{
@ -1074,7 +1074,7 @@ emit_stitched_colorgradient (cairo_pdf_surface_t *surface,
/* emit linear gradients between pairs of subsequent stops... */
for (i = 0; i < n_stops-1; i++) {
stops[i].gradient = emit_linear_colorgradient (surface,
stops[i].gradient = _cairo_pdf_surface_emit_linear_colorgradient (surface,
&stops[i],
&stops[i+1]);
}
@ -1127,7 +1127,7 @@ emit_stitched_colorgradient (cairo_pdf_surface_t *surface,
#define COLOR_STOP_EPSILON 1e-6
static cairo_pdf_resource_t
emit_pattern_stops (cairo_pdf_surface_t *surface, cairo_gradient_pattern_t *pattern)
_cairo_pdf_surface_emit_pattern_stops (cairo_pdf_surface_t *surface, cairo_gradient_pattern_t *pattern)
{
cairo_pdf_resource_t function;
cairo_pdf_color_stop_t *allstops, *stops;
@ -1170,11 +1170,11 @@ emit_pattern_stops (cairo_pdf_surface_t *surface, cairo_gradient_pattern_t *patt
if (n_stops == 2) {
/* no need for stitched function */
function = emit_linear_colorgradient (surface, &stops[0], &stops[1]);
function = _cairo_pdf_surface_emit_linear_colorgradient (surface, &stops[0], &stops[1]);
} else {
/* multiple stops: stitch. XXX possible optimization: regulary spaced
* stops do not require stitching. XXX */
function = emit_stitched_colorgradient (surface,
function = _cairo_pdf_surface_emit_stitched_colorgradient (surface,
n_stops,
stops);
}
@ -1185,7 +1185,7 @@ emit_pattern_stops (cairo_pdf_surface_t *surface, cairo_gradient_pattern_t *patt
}
static cairo_status_t
emit_linear_pattern (cairo_pdf_surface_t *surface, cairo_linear_pattern_t *pattern)
_cairo_pdf_surface_emit_linear_pattern (cairo_pdf_surface_t *surface, cairo_linear_pattern_t *pattern)
{
cairo_pdf_resource_t function, pattern_resource, alpha;
double x0, y0, x1, y1;
@ -1193,7 +1193,7 @@ emit_linear_pattern (cairo_pdf_surface_t *surface, cairo_linear_pattern_t *patte
_cairo_pdf_surface_pause_content_stream (surface);
function = emit_pattern_stops (surface, &pattern->base);
function = _cairo_pdf_surface_emit_pattern_stops (surface, &pattern->base);
if (function.id == 0)
return CAIRO_STATUS_NO_MEMORY;
@ -1248,7 +1248,7 @@ emit_linear_pattern (cairo_pdf_surface_t *surface, cairo_linear_pattern_t *patte
}
static cairo_status_t
emit_radial_pattern (cairo_pdf_surface_t *surface, cairo_radial_pattern_t *pattern)
_cairo_pdf_surface_emit_radial_pattern (cairo_pdf_surface_t *surface, cairo_radial_pattern_t *pattern)
{
cairo_pdf_resource_t function, pattern_resource, alpha;
double x0, y0, x1, y1, r0, r1;
@ -1256,7 +1256,7 @@ emit_radial_pattern (cairo_pdf_surface_t *surface, cairo_radial_pattern_t *patte
_cairo_pdf_surface_pause_content_stream (surface);
function = emit_pattern_stops (surface, &pattern->base);
function = _cairo_pdf_surface_emit_pattern_stops (surface, &pattern->base);
if (function.id == 0)
return CAIRO_STATUS_NO_MEMORY;
@ -1324,20 +1324,20 @@ emit_radial_pattern (cairo_pdf_surface_t *surface, cairo_radial_pattern_t *patte
}
static cairo_status_t
emit_pattern (cairo_pdf_surface_t *surface, cairo_pattern_t *pattern)
_cairo_pdf_surface_emit_pattern (cairo_pdf_surface_t *surface, cairo_pattern_t *pattern)
{
switch (pattern->type) {
case CAIRO_PATTERN_TYPE_SOLID:
return emit_solid_pattern (surface, (cairo_solid_pattern_t *) pattern);
return _cairo_pdf_surface_emit_solid_pattern (surface, (cairo_solid_pattern_t *) pattern);
case CAIRO_PATTERN_TYPE_SURFACE:
return emit_surface_pattern (surface, (cairo_surface_pattern_t *) pattern);
return _cairo_pdf_surface_emit_surface_pattern (surface, (cairo_surface_pattern_t *) pattern);
case CAIRO_PATTERN_TYPE_LINEAR:
return emit_linear_pattern (surface, (cairo_linear_pattern_t *) pattern);
return _cairo_pdf_surface_emit_linear_pattern (surface, (cairo_linear_pattern_t *) pattern);
case CAIRO_PATTERN_TYPE_RADIAL:
return emit_radial_pattern (surface, (cairo_radial_pattern_t *) pattern);
return _cairo_pdf_surface_emit_radial_pattern (surface, (cairo_radial_pattern_t *) pattern);
}
@ -2615,7 +2615,7 @@ _cairo_pdf_test_force_fallbacks (void)
}
static cairo_int_status_t
_operation_supported (cairo_pdf_surface_t *surface,
__cairo_pdf_surface_operation_supported (cairo_pdf_surface_t *surface,
cairo_operator_t op,
cairo_pattern_t *pattern)
{
@ -2634,11 +2634,11 @@ _operation_supported (cairo_pdf_surface_t *surface,
}
static cairo_int_status_t
_analyze_operation (cairo_pdf_surface_t *surface,
_cairo_pdf_surface_analyze_operation (cairo_pdf_surface_t *surface,
cairo_operator_t op,
cairo_pattern_t *pattern)
{
if (_operation_supported (surface, op, pattern))
if (__cairo_pdf_surface_operation_supported (surface, op, pattern))
return CAIRO_STATUS_SUCCESS;
else
return CAIRO_INT_STATUS_UNSUPPORTED;
@ -2653,7 +2653,7 @@ _cairo_pdf_surface_paint (void *abstract_surface,
cairo_status_t status;
if (surface->paginated_mode == CAIRO_PAGINATED_MODE_ANALYZE)
return _analyze_operation (surface, op, source);
return _cairo_pdf_surface_analyze_operation (surface, op, source);
/* XXX: It would be nice to be able to assert this condition
* here. But, we actually allow one 'cheat' that is used when
@ -2662,10 +2662,10 @@ _cairo_pdf_surface_paint (void *abstract_surface,
* possible only because there is nothing between the fallback
* images and the paper, nor is anything painted above. */
/*
assert (_operation_supported (op, source));
assert (__cairo_pdf_surface_operation_supported (op, source));
*/
status = emit_pattern (surface, source);
status = _cairo_pdf_surface_emit_pattern (surface, source);
if (status)
return status;
@ -2774,11 +2774,11 @@ _cairo_pdf_surface_stroke (void *abstract_surface,
cairo_status_t status;
if (surface->paginated_mode == CAIRO_PAGINATED_MODE_ANALYZE)
return _analyze_operation (surface, op, source);
return _cairo_pdf_surface_analyze_operation (surface, op, source);
assert (_operation_supported (surface, op, source));
assert (__cairo_pdf_surface_operation_supported (surface, op, source));
status = emit_pattern (surface, source);
status = _cairo_pdf_surface_emit_pattern (surface, source);
if (status)
return status;
@ -2823,11 +2823,11 @@ _cairo_pdf_surface_fill (void *abstract_surface,
pdf_path_info_t info;
if (surface->paginated_mode == CAIRO_PAGINATED_MODE_ANALYZE)
return _analyze_operation (surface, op, source);
return _cairo_pdf_surface_analyze_operation (surface, op, source);
assert (_operation_supported (surface, op, source));
assert (__cairo_pdf_surface_operation_supported (surface, op, source));
status = emit_pattern (surface, source);
status = _cairo_pdf_surface_emit_pattern (surface, source);
if (status)
return status;
@ -2876,11 +2876,11 @@ _cairo_pdf_surface_show_glyphs (void *abstract_surface,
int i;
if (surface->paginated_mode == CAIRO_PAGINATED_MODE_ANALYZE)
return _analyze_operation (surface, op, source);
return _cairo_pdf_surface_analyze_operation (surface, op, source);
assert (_operation_supported (surface, op, source));
assert (__cairo_pdf_surface_operation_supported (surface, op, source));
status = emit_pattern (surface, source);
status = _cairo_pdf_surface_emit_pattern (surface, source);
if (status)
return status;

View file

@ -1404,7 +1404,7 @@ _cairo_ps_test_force_fallbacks (void)
}
static cairo_int_status_t
operation_supported (cairo_ps_surface_t *surface,
_cairo_ps_surface_operation_supported (cairo_ps_surface_t *surface,
cairo_operator_t op,
const cairo_pattern_t *pattern)
{
@ -1424,11 +1424,11 @@ operation_supported (cairo_ps_surface_t *surface,
}
static cairo_int_status_t
_analyze_operation (cairo_ps_surface_t *surface,
_cairo_ps_surface_analyze_operation (cairo_ps_surface_t *surface,
cairo_operator_t op,
const cairo_pattern_t *pattern)
{
if (operation_supported (surface, op, pattern))
if (_cairo_ps_surface_operation_supported (surface, op, pattern))
return CAIRO_STATUS_SUCCESS;
else
return CAIRO_INT_STATUS_UNSUPPORTED;
@ -1558,7 +1558,7 @@ _string_array_stream_create (cairo_output_stream_t *output)
* surface we can render natively in PS. */
static cairo_status_t
emit_image (cairo_ps_surface_t *surface,
_cairo_ps_surface_emit_image (cairo_ps_surface_t *surface,
cairo_image_surface_t *image,
const char *name)
{
@ -1690,7 +1690,7 @@ emit_image (cairo_ps_surface_t *surface,
}
static void
emit_solid_pattern (cairo_ps_surface_t *surface,
_cairo_ps_surface_emit_solid_pattern (cairo_ps_surface_t *surface,
cairo_solid_pattern_t *pattern)
{
if (color_is_gray (&pattern->color))
@ -1706,7 +1706,7 @@ emit_solid_pattern (cairo_ps_surface_t *surface,
}
static void
emit_surface_pattern (cairo_ps_surface_t *surface,
_cairo_ps_surface_emit_surface_pattern (cairo_ps_surface_t *surface,
cairo_surface_pattern_t *pattern)
{
double bbox_width, bbox_height;
@ -1733,7 +1733,7 @@ emit_surface_pattern (cairo_ps_surface_t *surface,
&image_extra);
assert (status == CAIRO_STATUS_SUCCESS);
emit_image (surface, image, "MyPattern");
_cairo_ps_surface_emit_image (surface, image, "MyPattern");
bbox_width = image->width;
bbox_height = image->height;
@ -1808,21 +1808,21 @@ emit_surface_pattern (cairo_ps_surface_t *surface,
}
static void
emit_linear_pattern (cairo_ps_surface_t *surface,
_cairo_ps_surface_emit_linear_pattern (cairo_ps_surface_t *surface,
cairo_linear_pattern_t *pattern)
{
/* XXX: NYI */
}
static void
emit_radial_pattern (cairo_ps_surface_t *surface,
_cairo_ps_surface_emit_radial_pattern (cairo_ps_surface_t *surface,
cairo_radial_pattern_t *pattern)
{
/* XXX: NYI */
}
static void
emit_pattern (cairo_ps_surface_t *surface, cairo_pattern_t *pattern)
_cairo_ps_surface_emit_pattern (cairo_ps_surface_t *surface, cairo_pattern_t *pattern)
{
/* FIXME: We should keep track of what pattern is currently set in
* the postscript file and only emit code if we're setting a
@ -1830,19 +1830,19 @@ emit_pattern (cairo_ps_surface_t *surface, cairo_pattern_t *pattern)
switch (pattern->type) {
case CAIRO_PATTERN_TYPE_SOLID:
emit_solid_pattern (surface, (cairo_solid_pattern_t *) pattern);
_cairo_ps_surface_emit_solid_pattern (surface, (cairo_solid_pattern_t *) pattern);
break;
case CAIRO_PATTERN_TYPE_SURFACE:
emit_surface_pattern (surface, (cairo_surface_pattern_t *) pattern);
_cairo_ps_surface_emit_surface_pattern (surface, (cairo_surface_pattern_t *) pattern);
break;
case CAIRO_PATTERN_TYPE_LINEAR:
emit_linear_pattern (surface, (cairo_linear_pattern_t *) pattern);
_cairo_ps_surface_emit_linear_pattern (surface, (cairo_linear_pattern_t *) pattern);
break;
case CAIRO_PATTERN_TYPE_RADIAL:
emit_radial_pattern (surface, (cairo_radial_pattern_t *) pattern);
_cairo_ps_surface_emit_radial_pattern (surface, (cairo_radial_pattern_t *) pattern);
break;
}
}
@ -1932,7 +1932,7 @@ _cairo_ps_surface_paint (void *abstract_surface,
cairo_rectangle_int16_t extents, pattern_extents;
if (surface->paginated_mode == CAIRO_PAGINATED_MODE_ANALYZE)
return _analyze_operation (surface, op, source);
return _cairo_ps_surface_analyze_operation (surface, op, source);
/* XXX: It would be nice to be able to assert this condition
* here. But, we actually allow one 'cheat' that is used when
@ -1941,7 +1941,7 @@ _cairo_ps_surface_paint (void *abstract_surface,
* possible only because there is nothing between the fallback
* images and the paper, nor is anything painted above. */
/*
assert (_operation_supported (op, source));
assert (__cairo_ps_surface_operation_supported (op, source));
*/
_cairo_output_stream_printf (stream,
@ -1951,7 +1951,7 @@ _cairo_ps_surface_paint (void *abstract_surface,
_cairo_pattern_get_extents (source, &pattern_extents);
_cairo_rectangle_intersect (&extents, &pattern_extents);
emit_pattern (surface, source);
_cairo_ps_surface_emit_pattern (surface, source);
_cairo_output_stream_printf (stream, "%d %d M\n",
extents.x, extents.y);
@ -2019,9 +2019,9 @@ _cairo_ps_surface_stroke (void *abstract_surface,
double dash_offset = style->dash_offset;
if (surface->paginated_mode == CAIRO_PAGINATED_MODE_ANALYZE)
return _analyze_operation (surface, op, source);
return _cairo_ps_surface_analyze_operation (surface, op, source);
assert (operation_supported (surface, op, source));
assert (_cairo_ps_surface_operation_supported (surface, op, source));
_cairo_output_stream_printf (stream,
@ -2090,7 +2090,7 @@ _cairo_ps_surface_stroke (void *abstract_surface,
}
}
emit_pattern (surface, source);
_cairo_ps_surface_emit_pattern (surface, source);
_cairo_output_stream_printf (stream,
"gsave\n");
@ -2150,14 +2150,14 @@ _cairo_ps_surface_fill (void *abstract_surface,
const char *ps_operator;
if (surface->paginated_mode == CAIRO_PAGINATED_MODE_ANALYZE)
return _analyze_operation (surface, op, source);
return _cairo_ps_surface_analyze_operation (surface, op, source);
assert (operation_supported (surface, op, source));
assert (_cairo_ps_surface_operation_supported (surface, op, source));
_cairo_output_stream_printf (stream,
"%% _cairo_ps_surface_fill\n");
emit_pattern (surface, source);
_cairo_ps_surface_emit_pattern (surface, source);
/* We're filling not stroking, so we pass CAIRO_LINE_CAP_ROUND. */
status = _cairo_ps_surface_emit_path (surface, stream, path,
@ -2208,9 +2208,9 @@ _cairo_ps_surface_show_glyphs (void *abstract_surface,
cairo_output_stream_t *word_wrap;
if (surface->paginated_mode == CAIRO_PAGINATED_MODE_ANALYZE)
return _analyze_operation (surface, op, source);
return _cairo_ps_surface_analyze_operation (surface, op, source);
assert (operation_supported (surface, op, source));
assert (_cairo_ps_surface_operation_supported (surface, op, source));
_cairo_output_stream_printf (stream,
"%% _cairo_ps_surface_show_glyphs\n");
@ -2220,7 +2220,7 @@ _cairo_ps_surface_show_glyphs (void *abstract_surface,
num_glyphs_unsigned = num_glyphs;
emit_pattern (surface, source);
_cairo_ps_surface_emit_pattern (surface, source);
glyph_ids = malloc (num_glyphs_unsigned*sizeof (cairo_ps_glyph_id_t));
if (glyph_ids == NULL)
return CAIRO_STATUS_NO_MEMORY;

View file

@ -477,7 +477,7 @@ _cairo_svg_surface_show_page (void *abstract_surface)
}
static void
emit_transform (cairo_output_stream_t *output,
_cairo_svg_surface_emit_transform (cairo_output_stream_t *output,
char const *attribute_str,
char const *trailer,
cairo_matrix_t *matrix)
@ -565,7 +565,7 @@ _cairo_svg_path_close_path (void *closure)
}
static cairo_status_t
emit_path (cairo_output_stream_t *output,
_cairo_svg_surface_emit_path (cairo_output_stream_t *output,
cairo_path_fixed_t *path,
cairo_matrix_t *ctm_inverse)
{
@ -608,7 +608,7 @@ _cairo_svg_document_emit_outline_glyph_data (cairo_svg_document_t *document,
_cairo_output_stream_printf (document->xml_node_glyphs,
"<path style=\"stroke: none;\" ");
status = emit_path (document->xml_node_glyphs, scaled_glyph->path, NULL);
status = _cairo_svg_surface_emit_path (document->xml_node_glyphs, scaled_glyph->path, NULL);
_cairo_output_stream_printf (document->xml_node_glyphs,
"/>\n");
@ -644,7 +644,7 @@ _cairo_svg_document_emit_bitmap_glyph_data (cairo_svg_document_t *document,
}
_cairo_output_stream_printf (document->xml_node_glyphs, "<g");
emit_transform (document->xml_node_glyphs, " transform", ">/n", &image->base.device_transform);
_cairo_svg_surface_emit_transform (document->xml_node_glyphs, " transform", ">/n", &image->base.device_transform);
for (y = 0, row = image->data, rows = image->height; rows; row += image->stride, rows--, y++) {
for (x = 0, byte = row, cols = (image->width + 7) / 8; cols; byte++, cols--) {
@ -737,7 +737,7 @@ _cairo_svg_test_force_fallbacks (void)
}
static cairo_int_status_t
_operation_supported (cairo_svg_surface_t *surface,
__cairo_svg_surface_operation_supported (cairo_svg_surface_t *surface,
cairo_operator_t op,
const cairo_pattern_t *pattern)
{
@ -754,11 +754,11 @@ _operation_supported (cairo_svg_surface_t *surface,
}
static cairo_int_status_t
_analyze_operation (cairo_svg_surface_t *surface,
_cairo_svg_surface_analyze_operation (cairo_svg_surface_t *surface,
cairo_operator_t op,
const cairo_pattern_t *pattern)
{
if (_operation_supported (surface, op, pattern))
if (__cairo_svg_surface_operation_supported (surface, op, pattern))
return CAIRO_STATUS_SUCCESS;
else
return CAIRO_INT_STATUS_UNSUPPORTED;
@ -801,7 +801,7 @@ _cairo_svg_surface_finish (void *abstract_surface)
}
static void
emit_alpha_filter (cairo_svg_document_t *document)
_cairo_svg_surface_emit_alpha_filter (cairo_svg_document_t *document)
{
if (document->alpha_filter)
return;
@ -916,7 +916,7 @@ _cairo_surface_base64_encode (cairo_surface_t *surface,
}
static cairo_status_t
emit_composite_image_pattern (cairo_output_stream_t *output,
_cairo_svg_surface_emit_composite_image_pattern (cairo_output_stream_t *output,
cairo_svg_surface_t *svg_surface,
cairo_surface_pattern_t *pattern,
int pattern_id,
@ -950,7 +950,7 @@ emit_composite_image_pattern (cairo_output_stream_t *output,
"width=\"%d\" height=\"%d\"",
pattern_id,
extents.width, extents.height);
emit_transform (output, " patternTransform", ">\n", &p2u);
_cairo_svg_surface_emit_transform (output, " patternTransform", ">\n", &p2u);
}
_cairo_output_stream_printf (output,
@ -958,7 +958,7 @@ emit_composite_image_pattern (cairo_output_stream_t *output,
extents.width, extents.height);
if (pattern_id == invalid_pattern_id)
emit_transform (output, " transform", "", &p2u);
_cairo_svg_surface_emit_transform (output, " transform", "", &p2u);
if (extra_attributes)
_cairo_output_stream_printf (output, " %s", extra_attributes);
@ -979,7 +979,7 @@ emit_composite_image_pattern (cairo_output_stream_t *output,
}
static int
emit_meta_surface (cairo_svg_document_t *document,
_cairo_svg_surface_emit_meta_surface (cairo_svg_document_t *document,
cairo_meta_surface_t *surface)
{
cairo_surface_t *paginated_surface;
@ -1021,7 +1021,7 @@ emit_meta_surface (cairo_svg_document_t *document,
_cairo_array_append (&document->meta_snapshots, &new_snapshot);
if (meta->content == CAIRO_CONTENT_ALPHA) {
emit_alpha_filter (document);
_cairo_svg_surface_emit_alpha_filter (document);
_cairo_output_stream_printf (document->xml_node_defs,
"<g id=\"surface%d\" "
"clip-path=\"url(#clip%d)\" "
@ -1066,7 +1066,7 @@ emit_meta_surface (cairo_svg_document_t *document,
}
static cairo_status_t
emit_composite_meta_pattern (cairo_output_stream_t *output,
_cairo_svg_surface_emit_composite_meta_pattern (cairo_output_stream_t *output,
cairo_svg_surface_t *surface,
cairo_surface_pattern_t *pattern,
int pattern_id,
@ -1079,7 +1079,7 @@ emit_composite_meta_pattern (cairo_output_stream_t *output,
meta_surface = (cairo_meta_surface_t *) pattern->surface;
id = emit_meta_surface (document, meta_surface);
id = _cairo_svg_surface_emit_meta_surface (document, meta_surface);
p2u = pattern->base.matrix;
cairo_matrix_invert (&p2u);
@ -1092,7 +1092,7 @@ emit_composite_meta_pattern (cairo_output_stream_t *output,
pattern_id,
meta_surface->width_pixels,
meta_surface->height_pixels);
emit_transform (output, " patternTransform", ">\n", &p2u);
_cairo_svg_surface_emit_transform (output, " patternTransform", ">\n", &p2u);
}
_cairo_output_stream_printf (output,
@ -1100,7 +1100,7 @@ emit_composite_meta_pattern (cairo_output_stream_t *output,
id);
if (pattern_id == invalid_pattern_id)
emit_transform (output, " transform", "", &p2u);
_cairo_svg_surface_emit_transform (output, " transform", "", &p2u);
if (extra_attributes)
_cairo_output_stream_printf (output, " %s", extra_attributes);
@ -1114,7 +1114,7 @@ emit_composite_meta_pattern (cairo_output_stream_t *output,
}
static cairo_status_t
emit_composite_pattern (cairo_output_stream_t *output,
_cairo_svg_surface_emit_composite_pattern (cairo_output_stream_t *output,
cairo_svg_surface_t *surface,
cairo_surface_pattern_t *pattern,
int pattern_id,
@ -1122,16 +1122,16 @@ emit_composite_pattern (cairo_output_stream_t *output,
{
if (_cairo_surface_is_meta (pattern->surface)) {
return emit_composite_meta_pattern (output, surface, pattern,
return _cairo_svg_surface_emit_composite_meta_pattern (output, surface, pattern,
pattern_id, extra_attributes);
}
return emit_composite_image_pattern (output, surface, pattern,
return _cairo_svg_surface_emit_composite_image_pattern (output, surface, pattern,
pattern_id, extra_attributes);
}
static void
emit_operator (cairo_output_stream_t *output,
_cairo_svg_surface_emit_operator (cairo_output_stream_t *output,
cairo_svg_surface_t *surface,
cairo_operator_t op)
{
@ -1153,7 +1153,7 @@ emit_operator (cairo_output_stream_t *output,
}
static void
emit_solid_pattern (cairo_svg_surface_t *surface,
_cairo_svg_surface_emit_solid_pattern (cairo_svg_surface_t *surface,
cairo_solid_pattern_t *pattern,
cairo_output_stream_t *style,
cairo_bool_t is_stroke)
@ -1169,7 +1169,7 @@ emit_solid_pattern (cairo_svg_surface_t *surface,
}
static void
emit_surface_pattern (cairo_svg_surface_t *surface,
_cairo_svg_surface_emit_surface_pattern (cairo_svg_surface_t *surface,
cairo_surface_pattern_t *pattern,
cairo_output_stream_t *style,
cairo_bool_t is_stroke)
@ -1178,7 +1178,7 @@ emit_surface_pattern (cairo_svg_surface_t *surface,
int pattern_id;
pattern_id = document->pattern_id++;
emit_composite_pattern (document->xml_node_defs, surface, pattern,
_cairo_svg_surface_emit_composite_pattern (document->xml_node_defs, surface, pattern,
pattern_id, NULL);
_cairo_output_stream_printf (style,
@ -1188,7 +1188,7 @@ emit_surface_pattern (cairo_svg_surface_t *surface,
}
static void
emit_pattern_stops (cairo_output_stream_t *output,
_cairo_svg_surface_emit_pattern_stops (cairo_output_stream_t *output,
cairo_gradient_pattern_t const *pattern,
double start_offset,
cairo_bool_t reverse_stops,
@ -1350,7 +1350,7 @@ emit_pattern_stops (cairo_output_stream_t *output,
}
static void
emit_pattern_extend (cairo_output_stream_t *output,
_cairo_svg_surface_emit_pattern_extend (cairo_output_stream_t *output,
cairo_pattern_t *pattern)
{
switch (pattern->extend) {
@ -1367,7 +1367,7 @@ emit_pattern_extend (cairo_output_stream_t *output,
}
static void
emit_linear_pattern (cairo_svg_surface_t *surface,
_cairo_svg_surface_emit_linear_pattern (cairo_svg_surface_t *surface,
cairo_linear_pattern_t *pattern,
cairo_output_stream_t *style,
cairo_bool_t is_stroke)
@ -1388,12 +1388,12 @@ emit_linear_pattern (cairo_svg_surface_t *surface,
document->linear_pattern_id,
x0, y0, x1, y1);
emit_pattern_extend (document->xml_node_defs, &pattern->base.base),
_cairo_svg_surface_emit_pattern_extend (document->xml_node_defs, &pattern->base.base),
p2u = pattern->base.base.matrix;
cairo_matrix_invert (&p2u);
emit_transform (document->xml_node_defs, "gradientTransform", ">\n", &p2u);
_cairo_svg_surface_emit_transform (document->xml_node_defs, "gradientTransform", ">\n", &p2u);
emit_pattern_stops (document->xml_node_defs ,&pattern->base, 0.0, FALSE, FALSE);
_cairo_svg_surface_emit_pattern_stops (document->xml_node_defs ,&pattern->base, 0.0, FALSE, FALSE);
_cairo_output_stream_printf (document->xml_node_defs,
"</linearGradient>\n");
@ -1407,7 +1407,7 @@ emit_linear_pattern (cairo_svg_surface_t *surface,
}
static void
emit_radial_pattern (cairo_svg_surface_t *surface,
_cairo_svg_surface_emit_radial_pattern (cairo_svg_surface_t *surface,
cairo_radial_pattern_t *pattern,
cairo_output_stream_t *style,
cairo_bool_t is_stroke)
@ -1452,7 +1452,7 @@ emit_radial_pattern (cairo_svg_surface_t *surface,
x1, y1,
x1, y1, r1);
emit_transform (document->xml_node_defs, "gradientTransform", ">\n", &p2u);
_cairo_svg_surface_emit_transform (document->xml_node_defs, "gradientTransform", ">\n", &p2u);
if (extend == CAIRO_EXTEND_NONE ||
pattern->base.n_stops < 1)
@ -1535,8 +1535,8 @@ emit_radial_pattern (cairo_svg_surface_t *surface,
if (emulate_reflect)
_cairo_output_stream_printf (document->xml_node_defs, "spreadMethod=\"repeat\" ");
else
emit_pattern_extend (document->xml_node_defs, &pattern->base.base);
emit_transform (document->xml_node_defs, "gradientTransform", ">\n", &p2u);
_cairo_svg_surface_emit_pattern_extend (document->xml_node_defs, &pattern->base.base);
_cairo_svg_surface_emit_transform (document->xml_node_defs, "gradientTransform", ">\n", &p2u);
/* To support cairo's EXTEND_NONE, (for which SVG has no similar
* notion), we add transparent color stops on either end of the
@ -1553,7 +1553,7 @@ emit_radial_pattern (cairo_svg_surface_t *surface,
"stop-opacity: 0;\"/>\n",
r0 / r1);
}
emit_pattern_stops (document->xml_node_defs, &pattern->base, offset,
_cairo_svg_surface_emit_pattern_stops (document->xml_node_defs, &pattern->base, offset,
reverse_stops, emulate_reflect);
if (pattern->base.base.extend == CAIRO_EXTEND_NONE)
_cairo_output_stream_printf (document->xml_node_defs,
@ -1574,24 +1574,24 @@ emit_radial_pattern (cairo_svg_surface_t *surface,
}
static void
emit_pattern (cairo_svg_surface_t *surface, cairo_pattern_t *pattern,
_cairo_svg_surface_emit_pattern (cairo_svg_surface_t *surface, cairo_pattern_t *pattern,
cairo_output_stream_t *output, cairo_bool_t is_stroke)
{
switch (pattern->type) {
case CAIRO_PATTERN_TYPE_SOLID:
emit_solid_pattern (surface, (cairo_solid_pattern_t *) pattern, output, is_stroke);
_cairo_svg_surface_emit_solid_pattern (surface, (cairo_solid_pattern_t *) pattern, output, is_stroke);
break;
case CAIRO_PATTERN_TYPE_SURFACE:
emit_surface_pattern (surface, (cairo_surface_pattern_t *) pattern, output, is_stroke);
_cairo_svg_surface_emit_surface_pattern (surface, (cairo_surface_pattern_t *) pattern, output, is_stroke);
break;
case CAIRO_PATTERN_TYPE_LINEAR:
emit_linear_pattern (surface, (cairo_linear_pattern_t *) pattern, output, is_stroke);
_cairo_svg_surface_emit_linear_pattern (surface, (cairo_linear_pattern_t *) pattern, output, is_stroke);
break;
case CAIRO_PATTERN_TYPE_RADIAL:
emit_radial_pattern (surface, (cairo_radial_pattern_t *) pattern, output, is_stroke);
_cairo_svg_surface_emit_radial_pattern (surface, (cairo_radial_pattern_t *) pattern, output, is_stroke);
break;
}
}
@ -1609,20 +1609,20 @@ _cairo_svg_surface_fill (void *abstract_surface,
cairo_status_t status;
if (surface->paginated_mode == CAIRO_PAGINATED_MODE_ANALYZE)
return _analyze_operation (surface, op, source);
return _cairo_svg_surface_analyze_operation (surface, op, source);
assert (_operation_supported (surface, op, source));
assert (__cairo_svg_surface_operation_supported (surface, op, source));
_cairo_output_stream_printf (surface->xml_node,
"<path style=\"stroke: none; "
"fill-rule: %s; ",
fill_rule == CAIRO_FILL_RULE_EVEN_ODD ?
"evenodd" : "nonzero");
emit_operator (surface->xml_node, surface, op);
emit_pattern (surface, source, surface->xml_node, FALSE);
_cairo_svg_surface_emit_operator (surface->xml_node, surface, op);
_cairo_svg_surface_emit_pattern (surface, source, surface->xml_node, FALSE);
_cairo_output_stream_printf (surface->xml_node, "\" ");
status = emit_path (surface->xml_node, path, NULL);
status = _cairo_svg_surface_emit_path (surface->xml_node, path, NULL);
_cairo_output_stream_printf (surface->xml_node, "/>\n");
@ -1649,7 +1649,7 @@ _cairo_svg_surface_get_extents (void *abstract_surface,
}
static cairo_status_t
emit_paint (cairo_output_stream_t *output,
_cairo_svg_surface_emit_paint (cairo_output_stream_t *output,
cairo_svg_surface_t *surface,
cairo_operator_t op,
cairo_pattern_t *source,
@ -1657,7 +1657,7 @@ emit_paint (cairo_output_stream_t *output,
{
if (source->type == CAIRO_PATTERN_TYPE_SURFACE &&
source->extend == CAIRO_EXTEND_NONE)
return emit_composite_pattern (output,
return _cairo_svg_surface_emit_composite_pattern (output,
surface,
(cairo_surface_pattern_t *) source,
invalid_pattern_id,
@ -1668,8 +1668,8 @@ emit_paint (cairo_output_stream_t *output,
"width=\"%f\" height=\"%f\" "
"style=\"",
surface->width, surface->height);
emit_operator (output, surface, op);
emit_pattern (surface, source, output, FALSE);
_cairo_svg_surface_emit_operator (output, surface, op);
_cairo_svg_surface_emit_pattern (surface, source, output, FALSE);
_cairo_output_stream_printf (output, " stroke: none;\"");
if (extra_attributes)
@ -1689,7 +1689,7 @@ _cairo_svg_surface_paint (void *abstract_surface,
cairo_svg_surface_t *surface = abstract_surface;
if (surface->paginated_mode == CAIRO_PAGINATED_MODE_ANALYZE)
return _analyze_operation (surface, op, source);
return _cairo_svg_surface_analyze_operation (surface, op, source);
/* XXX: It would be nice to be able to assert this condition
* here. But, we actually allow one 'cheat' that is used when
@ -1698,7 +1698,7 @@ _cairo_svg_surface_paint (void *abstract_surface,
* possible only because there is nothing between the fallback
* images and the paper, nor is anything painted above. */
/*
assert (_operation_supported (surface, op, source));
assert (__cairo_svg_surface_operation_supported (surface, op, source));
*/
/* Emulation of clear and source operators, when no clipping region
@ -1729,7 +1729,7 @@ _cairo_svg_surface_paint (void *abstract_surface,
}
}
emit_paint (surface->xml_node, surface, op, source, NULL);
_cairo_svg_surface_emit_paint (surface->xml_node, surface, op, source, NULL);
return CAIRO_STATUS_SUCCESS;
}
@ -1746,13 +1746,13 @@ _cairo_svg_surface_mask (void *abstract_surface,
char buffer[64];
if (surface->paginated_mode == CAIRO_PAGINATED_MODE_ANALYZE)
return _analyze_operation (surface, op, source);
return _cairo_svg_surface_analyze_operation (surface, op, source);
assert (_operation_supported (surface, op, source));
assert (__cairo_svg_surface_operation_supported (surface, op, source));
emit_alpha_filter (document);
_cairo_svg_surface_emit_alpha_filter (document);
/* emit_paint() will output a pattern definition to
/* _cairo_svg_surface_emit_paint() will output a pattern definition to
* document->xml_node_defs so we need to write the mask element to
* a temporary stream and then copy that to xml_node_defs. */
mask_stream = _cairo_memory_stream_create ();
@ -1760,7 +1760,7 @@ _cairo_svg_surface_mask (void *abstract_surface,
"<mask id=\"mask%d\">\n"
" <g filter=\"url(#alpha)\">\n",
document->mask_id);
emit_paint (mask_stream, surface, op, mask, NULL);
_cairo_svg_surface_emit_paint (mask_stream, surface, op, mask, NULL);
_cairo_output_stream_printf (mask_stream,
" </g>\n"
"</mask>\n");
@ -1769,7 +1769,7 @@ _cairo_svg_surface_mask (void *abstract_surface,
snprintf (buffer, sizeof buffer, "mask=\"url(#mask%d);\"",
document->mask_id);
emit_paint (surface->xml_node, surface, op, source, buffer);
_cairo_svg_surface_emit_paint (surface->xml_node, surface, op, source, buffer);
document->mask_id++;
@ -1793,9 +1793,9 @@ _cairo_svg_surface_stroke (void *abstract_dst,
unsigned int i;
if (surface->paginated_mode == CAIRO_PAGINATED_MODE_ANALYZE)
return _analyze_operation (surface, op, source);
return _cairo_svg_surface_analyze_operation (surface, op, source);
assert (_operation_supported (surface, op, source));
assert (__cairo_svg_surface_operation_supported (surface, op, source));
switch (stroke_style->line_cap) {
case CAIRO_LINE_CAP_BUTT:
@ -1834,8 +1834,8 @@ _cairo_svg_surface_stroke (void *abstract_dst,
line_cap,
line_join);
emit_pattern (surface, source, surface->xml_node, TRUE);
emit_operator (surface->xml_node, surface, op);
_cairo_svg_surface_emit_pattern (surface, source, surface->xml_node, TRUE);
_cairo_svg_surface_emit_operator (surface->xml_node, surface, op);
if (stroke_style->num_dashes > 0) {
_cairo_output_stream_printf (surface->xml_node, "stroke-dasharray: ");
@ -1858,9 +1858,9 @@ _cairo_svg_surface_stroke (void *abstract_dst,
"stroke-miterlimit: %f;\" ",
stroke_style->miter_limit);
status = emit_path (surface->xml_node, path, ctm_inverse);
status = _cairo_svg_surface_emit_path (surface->xml_node, path, ctm_inverse);
emit_transform (surface->xml_node, " transform", "/>\n", ctm);
_cairo_svg_surface_emit_transform (surface->xml_node, " transform", "/>\n", ctm);
return status;
}
@ -1881,9 +1881,9 @@ _cairo_svg_surface_show_glyphs (void *abstract_surface,
int i;
if (surface->paginated_mode == CAIRO_PAGINATED_MODE_ANALYZE)
return _analyze_operation (surface, op, pattern);
return _cairo_svg_surface_analyze_operation (surface, op, pattern);
assert (_operation_supported (surface, op, pattern));
assert (__cairo_svg_surface_operation_supported (surface, op, pattern));
if (num_glyphs <= 0)
return CAIRO_STATUS_SUCCESS;
@ -1895,7 +1895,7 @@ _cairo_svg_surface_show_glyphs (void *abstract_surface,
goto FALLBACK;
_cairo_output_stream_printf (surface->xml_node, "<g style=\"");
emit_pattern (surface, pattern, surface->xml_node, FALSE);
_cairo_svg_surface_emit_pattern (surface, pattern, surface->xml_node, FALSE);
_cairo_output_stream_printf (surface->xml_node, "\">\n");
for (i = 0; i < num_glyphs; i++) {
@ -1960,7 +1960,7 @@ _cairo_svg_surface_intersect_clip_path (void *dst,
"<clipPath id=\"clip%d\">\n"
" <path ",
document->clip_id);
status = emit_path (document->xml_node_defs, path, NULL);
status = _cairo_svg_surface_emit_path (document->xml_node_defs, path, NULL);
_cairo_output_stream_printf (document->xml_node_defs,
"/>\n"
"</clipPath>\n");