michael@0: diff --git a/gfx/cairo/cairo/src/cairo-image-surface.c b/gfx/cairo/cairo/src/cairo-image-surface.c michael@0: --- a/gfx/cairo/cairo/src/cairo-image-surface.c michael@0: +++ b/gfx/cairo/cairo/src/cairo-image-surface.c michael@0: @@ -2885,16 +2885,18 @@ static cairo_status_t michael@0: cairo_bool_t need_clip_mask = FALSE; michael@0: cairo_status_t status; michael@0: struct _cairo_boxes_chunk *chunk; michael@0: uint32_t pixel; michael@0: int i; michael@0: michael@0: if (clip != NULL) { michael@0: status = _cairo_clip_get_region (clip, &clip_region); michael@0: + if (unlikely (status == CAIRO_INT_STATUS_NOTHING_TO_DO)) michael@0: + return CAIRO_STATUS_SUCCESS; michael@0: need_clip_mask = status == CAIRO_INT_STATUS_UNSUPPORTED; michael@0: if (need_clip_mask && michael@0: (op == CAIRO_OPERATOR_SOURCE || ! extents->is_bounded)) michael@0: { michael@0: return CAIRO_INT_STATUS_UNSUPPORTED; michael@0: } michael@0: michael@0: if (clip_region != NULL && cairo_region_num_rectangles (clip_region) == 1) michael@0: @@ -3200,30 +3202,20 @@ static cairo_status_t michael@0: return _clip_and_composite (dst, op, src, michael@0: _composite_traps, &info, michael@0: extents, clip); michael@0: } michael@0: michael@0: static cairo_clip_path_t * michael@0: _clip_get_single_path (cairo_clip_t *clip) michael@0: { michael@0: - cairo_clip_path_t *iter = clip->path; michael@0: - cairo_clip_path_t *path = NULL; michael@0: - michael@0: - do { michael@0: - if ((iter->flags & CAIRO_CLIP_PATH_IS_BOX) == 0) { michael@0: - if (path != NULL) michael@0: - return FALSE; michael@0: - michael@0: - path = iter; michael@0: - } michael@0: - iter = iter->prev; michael@0: - } while (iter != NULL); michael@0: - michael@0: - return path; michael@0: + if (clip->path->prev == NULL) michael@0: + return clip->path; michael@0: + michael@0: + return NULL; michael@0: } michael@0: michael@0: /* high level image interface */ michael@0: michael@0: static cairo_int_status_t michael@0: _cairo_image_surface_paint (void *abstract_surface, michael@0: cairo_operator_t op, michael@0: const cairo_pattern_t *source,