gfx/cairo/win32-composite-src-mod.patch

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/gfx/cairo/win32-composite-src-mod.patch	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,44 @@
     1.4 +diff --git a/gfx/cairo/cairo/src/cairo-win32-surface.c b/gfx/cairo/cairo/src/cairo-win32-surface.c
     1.5 +--- a/gfx/cairo/cairo/src/cairo-win32-surface.c
     1.6 ++++ b/gfx/cairo/cairo/src/cairo-win32-surface.c
     1.7 +@@ -928,16 +928,19 @@ _cairo_win32_surface_composite_inner (ca
     1.8 +   	return _composite_alpha_blend (dst, src, alpha,
     1.9 + 				       src_r.x, src_r.y, src_r.width, src_r.height,
    1.10 + 				       dst_r.x, dst_r.y, dst_r.width, dst_r.height);
    1.11 +     }
    1.12 + 
    1.13 +     return CAIRO_STATUS_SUCCESS;
    1.14 + }
    1.15 + 
    1.16 ++/* from pixman-private.h */
    1.17 ++#define MOD(a,b) ((a) < 0 ? ((b) - ((-(a) - 1) % (b))) - 1 : (a) % (b))
    1.18 ++
    1.19 + static cairo_int_status_t
    1.20 + _cairo_win32_surface_composite (cairo_operator_t	op,
    1.21 + 				cairo_pattern_t       	*pattern,
    1.22 + 				cairo_pattern_t		*mask_pattern,
    1.23 + 				void			*abstract_dst,
    1.24 + 				int			src_x,
    1.25 + 				int			src_y,
    1.26 + 				int			mask_x,
    1.27 +@@ -1209,18 +1212,18 @@ _cairo_win32_surface_composite (cairo_op
    1.28 +     /* If we need to repeat, we turn the repeated blit into
    1.29 +      * a bunch of piece-by-piece blits.
    1.30 +      */
    1.31 +     if (needs_repeat) {
    1.32 + 	cairo_rectangle_int_t piece_src_r, piece_dst_r;
    1.33 + 	uint32_t rendered_width = 0, rendered_height = 0;
    1.34 + 	uint32_t to_render_height, to_render_width;
    1.35 + 	int32_t piece_x, piece_y;
    1.36 +-	int32_t src_start_x = src_r.x % src_extents.width;
    1.37 +-	int32_t src_start_y = src_r.y % src_extents.height;
    1.38 ++	int32_t src_start_x = MOD(src_r.x, src_extents.width);
    1.39 ++	int32_t src_start_y = MOD(src_r.y, src_extents.height);
    1.40 + 
    1.41 + 	if (needs_scale)
    1.42 + 	    goto UNSUPPORTED;
    1.43 + 
    1.44 + 	/* If both the src and dest have an image, we may as well fall
    1.45 + 	 * back, because it will be faster than our separate blits.
    1.46 + 	 * Our blit code will be fastest when the src is a DDB and the
    1.47 + 	 * destination is a DDB.

mercurial