summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSøren Sandmann Pedersen <ssp@redhat.com>2012-09-29 18:18:31 -0400
committerSøren Sandmann Pedersen <ssp@redhat.com>2012-09-29 18:18:31 -0400
commit3b9991f6dca9877cd4110184cd050adefa6ddb70 (patch)
treea02b9351727e7cea5a5270f7d6ddefc66bbf4916
parent6b793c25b62b5eed449c19302aa87d39c66a9dd1 (diff)
misc
-rw-r--r--src/cairo-pixman-surface.c47
1 files changed, 27 insertions, 20 deletions
diff --git a/src/cairo-pixman-surface.c b/src/cairo-pixman-surface.c
index 1222ffe4..82d90a89 100644
--- a/src/cairo-pixman-surface.c
+++ b/src/cairo-pixman-surface.c
@@ -244,14 +244,14 @@ create_image_surface (cairo_pixman_surface_t *psurface)
return image;
}
-static cairo_surface_t *
+static cairo_image_surface_t *
cairo_pixman_surface_map_to_image (void *abstract_other,
const cairo_rectangle_int_t *extents)
{
cairo_pixman_surface_t *surface = abstract_other;
/* FIXME: if we need to copy, we should only copy extents */
- return create_image_surface (surface);
+ return (cairo_image_surface_t *)create_image_surface (surface);
}
static cairo_int_status_t
@@ -367,9 +367,6 @@ set_properties (pixman_image_t *image, cairo_pattern_t *pattern)
case CAIRO_FILTER_FAST:
filter = PIXMAN_FILTER_FAST;
break;
- case CAIRO_FILTER_GOOD:
- filter = PIXMAN_FILTER_GOOD;
- break;
case CAIRO_FILTER_BEST:
filter = PIXMAN_FILTER_BEST;
break;
@@ -380,6 +377,9 @@ set_properties (pixman_image_t *image, cairo_pattern_t *pattern)
filter = PIXMAN_FILTER_BILINEAR;
break;
case CAIRO_FILTER_GAUSSIAN:
+ case CAIRO_FILTER_GOOD:
+ default:
+ filter = PIXMAN_FILTER_GOOD;
break;
}
@@ -388,6 +388,7 @@ set_properties (pixman_image_t *image, cairo_pattern_t *pattern)
/* Repeat mode */
switch (pattern->extend)
{
+ default:
case CAIRO_EXTEND_NONE:
repeat = PIXMAN_REPEAT_NONE;
break;
@@ -605,11 +606,6 @@ project_line_x_onto_16_16 (const cairo_line_t *line,
p1.x + m * _cairo_fixed_to_double (bottom - line->p1.y));
}
-static void
-ptrap_from_cairo_trap (pixman_trapezoid_t *ptrap, cairo_trapezoid_t *trap)
-{
-}
-
static pixman_trapezoid_t *
traps_to_pixman_trapezoids (const cairo_traps_t *traps)
{
@@ -673,7 +669,7 @@ create_clip_image (const cairo_clip_t *clip, pixman_image_t **clip_image)
{
cairo_int_status_t status;
pixman_trapezoid_t *traps;
- pixman_image_t *white_img;
+ pixman_image_t *white_img = NULL;
cairo_clip_path_t *clip_path;
int i;
@@ -721,7 +717,8 @@ create_clip_image (const cairo_clip_t *clip, pixman_image_t **clip_image)
pixman_add_trapezoids (*clip_image, 0, 0, clip->num_boxes, traps);
/* Then intersect with all the paths */
- if (!(white_img = pixman_image_create_solid_fill ((pixman_color_t *)&white)))
+ if (!(white_img = pixman_image_create_solid_fill (
+ (pixman_color_t *)&white)))
{
status = CAIRO_INT_STATUS_NO_MEMORY;
goto out;
@@ -731,30 +728,40 @@ create_clip_image (const cairo_clip_t *clip, pixman_image_t **clip_image)
{
cairo_polygon_t polygon;
cairo_traps_t traps;
- pixman_trapezoid_t *ptraps;
+ pixman_trapezoid_t *ptraps = NULL;
_cairo_polygon_init (&polygon, NULL, 0);
_cairo_traps_init (&traps);
- _cairo_path_fixed_fill_to_polygon (
+ status = _cairo_path_fixed_fill_to_polygon (
&clip_path->path, clip_path->tolerance, &polygon);
+ if (status != CAIRO_INT_STATUS_SUCCESS)
+ goto exit_loop;
+
status = _cairo_bentley_ottmann_tessellate_polygon (
&traps, &polygon, clip_path->fill_rule);
+ if (status != CAIRO_INT_STATUS_SUCCESS)
+ goto exit_loop;
+
if (!(ptraps = traps_to_pixman_trapezoids (&traps)))
- status = CAIRO_INT_STATUS_NO_MEMORY;
-
- if (status == CAIRO_INT_STATUS_SUCCESS)
{
- pixman_composite_trapezoids (
- PIXMAN_OP_IN, white_img, *clip_image, PIXMAN_a8, 0, 0, 0, 0,
- traps.num_traps, ptraps);
+ status = CAIRO_INT_STATUS_NO_MEMORY;
+ goto exit_loop;
}
+
+ pixman_composite_trapezoids (
+ PIXMAN_OP_IN, white_img, *clip_image, PIXMAN_a8, 0, 0, 0, 0,
+ traps.num_traps, ptraps);
+ exit_loop:
free (ptraps);
_cairo_polygon_fini (&polygon);
_cairo_traps_fini (&traps);
+
+ if (status != CAIRO_INT_STATUS_SUCCESS)
+ break;
}
out: