[cairo] [PATCH 38/39] [OpenVG] updated cairo-openvg to latest internal API changes
tardyp at gmail.com
tardyp at gmail.com
Fri Jul 10 10:02:40 PDT 2009
From: Pierre Tardy <tardyp at gmail.com>
Still one const compiler warning kept, because probably the cairo_set_source
should take source as const.
---
src/cairo-openvg-surface.c | 78 +++++++++++++++++++++++++-------------------
1 files changed, 44 insertions(+), 34 deletions(-)
diff --git a/src/cairo-openvg-surface.c b/src/cairo-openvg-surface.c
index 197a537..fe18225 100644
--- a/src/cairo-openvg-surface.c
+++ b/src/cairo-openvg-surface.c
@@ -74,12 +74,13 @@ _cairo_openvg_surface_create_similar (void *asurface,
int width,
int height)
{
- return _cairo_meta_surface_create (content, width, height);
+ return cairo_meta_surface_create (content, width, height);
}
static cairo_status_t
_cairo_openvg_surface_clone_similar (void *abstract_surface,
cairo_surface_t *src,
+ cairo_content_t content,
int src_x,
int src_y,
int width,
@@ -147,7 +148,8 @@ _cairo_openvg_surface_intersect_clip_path (void *asurface,
path,
fill_rule,
tolerance,
- antialias);
+ antialias,
+ NULL);
cairo_restore (cr);
if (status == CAIRO_STATUS_SUCCESS)
{
@@ -193,7 +195,7 @@ typedef struct _openvg_stroke {
static cairo_status_t
_cairo_path_to_openvg_path_move_to (void *closure,
- cairo_point_t *point)
+ const cairo_point_t *point)
{
openvg_stroke_t *stroke = closure;
double x = _cairo_fixed_to_double (point->x);
@@ -218,7 +220,7 @@ _cairo_path_to_openvg_path_move_to (void *closure,
static cairo_status_t
_cairo_path_to_openvg_path_line_to (void *closure,
- cairo_point_t *point)
+ const cairo_point_t *point)
{
openvg_stroke_t *stroke = closure;
double x = _cairo_fixed_to_double (point->x);
@@ -243,9 +245,9 @@ _cairo_path_to_openvg_path_line_to (void *closure,
static cairo_status_t
_cairo_path_to_openvg_path_curve_to (void *closure,
- cairo_point_t *p0,
- cairo_point_t *p1,
- cairo_point_t *p2)
+ const cairo_point_t *p0,
+ const cairo_point_t *p1,
+ const cairo_point_t *p2)
{
openvg_stroke_t *stroke = closure;
double x0 = _cairo_fixed_to_double (p0->x);
@@ -632,7 +634,7 @@ USED_CACHE:
static cairo_status_t
setup_source (cairo_openvg_surface_t *vgsurface,
- cairo_pattern_t *source)
+ const cairo_pattern_t *source)
{
/* this will bomb if one of the prior paint ops have failed to
* clean up after itself
@@ -669,7 +671,7 @@ setup_source (cairo_openvg_surface_t *vgsurface,
static cairo_status_t
teardown_source (cairo_openvg_surface_t *vgsurface,
- cairo_pattern_t *source)
+ const cairo_pattern_t *source)
{
if (vgsurface->source_image)
{
@@ -683,13 +685,14 @@ teardown_source (cairo_openvg_surface_t *vgsurface,
static cairo_int_status_t
_cairo_openvg_surface_stroke (void *asurface,
cairo_operator_t op,
- cairo_pattern_t *source,
+ const cairo_pattern_t*source,
cairo_path_fixed_t *path,
cairo_stroke_style_t *style,
cairo_matrix_t *ctm,
cairo_matrix_t *ctm_inverse,
double tolerance,
- cairo_antialias_t antialias)
+ cairo_antialias_t antialias,
+ cairo_rectangle_int_t *extents)
{
cairo_openvg_surface_t *vgsurface = asurface;
cairo_status_t rv = CAIRO_STATUS_SUCCESS;
@@ -736,13 +739,14 @@ BAIL:
}
static cairo_int_status_t
-_cairo_openvg_surface_fill (void *asurface,
- cairo_operator_t op,
- cairo_pattern_t *source,
- cairo_path_fixed_t *path,
- cairo_fill_rule_t fill_rule,
- double tolerance,
- cairo_antialias_t antialias)
+_cairo_openvg_surface_fill (void *asurface,
+ cairo_operator_t op,
+ const cairo_pattern_t *source,
+ cairo_path_fixed_t *path,
+ cairo_fill_rule_t fill_rule,
+ double tolerance,
+ cairo_antialias_t antialias,
+ cairo_rectangle_int_t *extents)
{
cairo_openvg_surface_t *vgsurface = asurface;
cairo_status_t rv = CAIRO_STATUS_SUCCESS;
@@ -778,7 +782,8 @@ BAIL:
static cairo_int_status_t
_cairo_openvg_surface_paint (void *asurface,
cairo_operator_t op,
- cairo_pattern_t *source)
+ const cairo_pattern_t *source,
+ cairo_rectangle_int_t *extents)
{
cairo_openvg_surface_t *vgsurface = asurface;
cairo_status_t rv = CAIRO_STATUS_SUCCESS;
@@ -799,7 +804,7 @@ _cairo_openvg_surface_paint (void *asurface,
cairo_surface_pattern_t *spat = (cairo_surface_pattern_t *)source;
if (_cairo_surface_is_meta (spat->surface))
{
- return _cairo_meta_surface_replay (spat->surface, asurface);
+ return cairo_meta_surface_replay (spat->surface, asurface);
}
}
@@ -831,10 +836,11 @@ BAIL:
}
static cairo_int_status_t
-_cairo_openvg_surface_mask (void *asurface,
- cairo_operator_t op,
- cairo_pattern_t *source,
- cairo_pattern_t *mask)
+_cairo_openvg_surface_mask (void *asurface,
+ cairo_operator_t op,
+ const cairo_pattern_t *source,
+ const cairo_pattern_t *mask,
+ cairo_rectangle_int_t *extents)
{
cairo_status_t status = CAIRO_STATUS_SUCCESS;
cairo_openvg_surface_t *vgsurface = asurface;
@@ -853,7 +859,7 @@ _cairo_openvg_surface_mask (void *asurface,
assert (vgsurface->opacity_level < MAX_OPACITIES);
/* upload source as image */
- status = _cairo_openvg_surface_paint (asurface, op, source);
+ status = _cairo_openvg_surface_paint (asurface, op, source, extents);
vgsurface->opacity_level--;
vgsurface->alpha = vgsurface->opacity[vgsurface->opacity_level];
@@ -887,7 +893,7 @@ _cairo_openvg_surface_mask (void *asurface,
cairo_surface_destroy (image);
/* upload source as image */
- status = _cairo_openvg_surface_paint (asurface, op, source);
+ status = _cairo_openvg_surface_paint (asurface, op, source, extents);
/* reset path,. */
@@ -902,13 +908,14 @@ _cairo_openvg_surface_mask (void *asurface,
static cairo_int_status_t
-_cairo_openvg_surface_show_glyphs (void *asurface,
- cairo_operator_t op,
- cairo_pattern_t *source,
- cairo_glyph_t *glyphs,
- int num_glyphs,
- cairo_scaled_font_t *scaled_font,
- int *remaining_glyphs)
+_cairo_openvg_surface_show_glyphs (void *asurface,
+ cairo_operator_t op,
+ const cairo_pattern_t *source,
+ cairo_glyph_t *glyphs,
+ int num_glyphs,
+ cairo_scaled_font_t *scaled_font,
+ int *remaining_glyphs,
+ cairo_rectangle_int_t *extents)
{
cairo_status_t status = CAIRO_STATUS_SUCCESS;
cairo_path_fixed_t path;
@@ -926,7 +933,7 @@ _cairo_openvg_surface_show_glyphs (void *asurface,
return status;
}
- status = _cairo_openvg_surface_fill (asurface, op, source, &path, CAIRO_FILL_RULE_WINDING, 0.0, CAIRO_ANTIALIAS_SUBPIXEL);
+ status = _cairo_openvg_surface_fill (asurface, op, source, &path, CAIRO_FILL_RULE_WINDING, 0.0, CAIRO_ANTIALIAS_SUBPIXEL, extents);
_cairo_path_fixed_fini (&path);
return status;
}
@@ -937,6 +944,7 @@ _cairo_openvg_surface_finish (void *abstract_surface)
cairo_openvg_surface_t *vgsurface = (cairo_openvg_surface_t*) abstract_surface;
if (vgsurface->source_paint != VG_INVALID_HANDLE)
vgDestroyPaint (vgsurface->source_paint);
+ return CAIRO_STATUS_SUCCESS;
}
static const struct _cairo_surface_backend
@@ -952,6 +960,8 @@ cairo_openvg_surface_backend = {
NULL, /* composite */
NULL, /* fill_rectangles */
NULL, /* composite_trapezoids */
+ NULL, /* create_span_renderer */
+ NULL, /* check_span_renderer */
NULL, /* copy_page */
NULL, /* show_page */
NULL, /* set_clip_region */
--
1.6.0.4
More information about the cairo
mailing list