michael@0: diff --git a/gfx/cairo/cairo/src/cairo-win32-surface.c b/gfx/cairo/cairo/src/cairo-win32-surface.c michael@0: --- a/gfx/cairo/cairo/src/cairo-win32-surface.c michael@0: +++ b/gfx/cairo/cairo/src/cairo-win32-surface.c michael@0: @@ -1114,17 +1114,17 @@ static cairo_int_status_t michael@0: cairo_win32_surface_t *dst = abstract_dst; michael@0: cairo_win32_surface_t *src; michael@0: cairo_surface_pattern_t *src_surface_pattern; michael@0: int alpha; michael@0: double scalex, scaley; michael@0: cairo_fixed_t x0_fixed, y0_fixed; michael@0: cairo_int_status_t status; michael@0: michael@0: - cairo_bool_t needs_alpha, needs_scale, needs_repeat; michael@0: + cairo_bool_t needs_alpha, needs_scale, needs_repeat, needs_pad; michael@0: cairo_image_surface_t *src_image = NULL; michael@0: michael@0: cairo_format_t src_format; michael@0: cairo_rectangle_int_t src_extents; michael@0: michael@0: cairo_rectangle_int_t src_r = { src_x, src_y, width, height }; michael@0: cairo_rectangle_int_t dst_r = { dst_x, dst_y, width, height }; michael@0: michael@0: @@ -1145,17 +1145,18 @@ static cairo_int_status_t michael@0: { michael@0: goto UNSUPPORTED; michael@0: } michael@0: michael@0: if (pattern->type != CAIRO_PATTERN_TYPE_SURFACE) michael@0: goto UNSUPPORTED; michael@0: michael@0: if (pattern->extend != CAIRO_EXTEND_NONE && michael@0: - pattern->extend != CAIRO_EXTEND_REPEAT) michael@0: + pattern->extend != CAIRO_EXTEND_REPEAT && michael@0: + pattern->extend != CAIRO_EXTEND_PAD) michael@0: goto UNSUPPORTED; michael@0: michael@0: if (mask_pattern) { michael@0: /* FIXME: When we fully support RENDER style 4-channel michael@0: * masks we need to check r/g/b != 1.0. michael@0: */ michael@0: if (mask_pattern->type != CAIRO_PATTERN_TYPE_SOLID) michael@0: return CAIRO_INT_STATUS_UNSUPPORTED; michael@0: @@ -1252,16 +1253,17 @@ static cairo_int_status_t michael@0: michael@0: /* If the src rectangle doesn't wholly lie within the src extents, michael@0: * fudge things. We really need to do fixup on the unpainted michael@0: * region -- e.g. the SOURCE operator is broken for areas outside michael@0: * of the extents, because it won't clear that area to transparent michael@0: * black. michael@0: */ michael@0: michael@0: + needs_pad = FALSE; michael@0: if (pattern->extend != CAIRO_EXTEND_REPEAT) { michael@0: needs_repeat = FALSE; michael@0: michael@0: /* If the src rect and the extents of the source image don't overlap at all, michael@0: * we can't do anything useful here. michael@0: */ michael@0: if (src_r.x > src_extents.width || src_r.y > src_extents.height || michael@0: (src_r.x + src_r.width) < 0 || (src_r.y + src_r.height) < 0) michael@0: @@ -1273,40 +1275,48 @@ static cairo_int_status_t michael@0: michael@0: if (src_r.x < 0) { michael@0: src_r.width += src_r.x; michael@0: michael@0: dst_r.width += src_r.x; michael@0: dst_r.x -= src_r.x; michael@0: michael@0: src_r.x = 0; michael@0: + needs_pad = TRUE; michael@0: } michael@0: michael@0: if (src_r.y < 0) { michael@0: src_r.height += src_r.y; michael@0: michael@0: dst_r.height += src_r.y; michael@0: dst_r.y -= src_r.y; michael@0: michael@0: src_r.y = 0; michael@0: + needs_pad = TRUE; michael@0: } michael@0: michael@0: if (src_r.x + src_r.width > src_extents.width) { michael@0: src_r.width = src_extents.width - src_r.x; michael@0: dst_r.width = src_r.width; michael@0: + needs_pad = TRUE; michael@0: } michael@0: michael@0: if (src_r.y + src_r.height > src_extents.height) { michael@0: src_r.height = src_extents.height - src_r.y; michael@0: dst_r.height = src_r.height; michael@0: + needs_pad = TRUE; michael@0: } michael@0: } else { michael@0: needs_repeat = TRUE; michael@0: } michael@0: michael@0: + if (pattern->extend == CAIRO_EXTEND_PAD && needs_pad) { michael@0: + goto UNSUPPORTED; michael@0: + } michael@0: + michael@0: /* michael@0: * Operations that we can do: michael@0: * michael@0: * AlphaBlend uses the following formula for alpha when not use the per-pixel alpha (AlphaFormat = 0) michael@0: * Dst.Alpha = Src.Alpha * (SCA/255.0) + Dst.Alpha * (1.0 - (SCA/255.0)) michael@0: * This turns into Dst.Alpha = Src.Alpha when SCA = 255. michael@0: * (http://msdn.microsoft.com/en-us/library/aa921335.aspx) michael@0: *