summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Robinson <mrobinson@webkit.org>2011-10-13 15:52:57 -0700
committerChris Wilson <chris@chris-wilson.co.uk>2011-11-23 20:49:30 +0000
commit33c59030b566ef647c007858b81af6317a8d8740 (patch)
treefa71fc64a0bc8a48b1026dc2765261800e810d60
parentc94c3eede088fed36866c934a2637ea49e687a1c (diff)
gl: Fix offset for non-texture surface patterns
Instead of drawing only a portion of the image into the intermediate texture, draw the entire image and adjust the translation matrix to compensate.
-rw-r--r--src/cairo-gl-operand.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/cairo-gl-operand.c b/src/cairo-gl-operand.c
index a7e187ea..c544532c 100644
--- a/src/cairo-gl-operand.c
+++ b/src/cairo-gl-operand.c
@@ -156,7 +156,7 @@ _cairo_gl_pattern_texture_setup (cairo_gl_operand_t *operand,
if (src->surface->backend->type == CAIRO_SURFACE_TYPE_IMAGE) {
status = _cairo_gl_surface_draw_image (surface,
(cairo_image_surface_t *)src->surface,
- src_x, src_y,
+ 0, 0,
width, height,
0, 0);
@@ -166,9 +166,8 @@ _cairo_gl_pattern_texture_setup (cairo_gl_operand_t *operand,
cairo_surface_t *image;
image = cairo_surface_map_to_image (&surface->base, NULL);
- status = _cairo_surface_offset_paint (image, src_x, src_y,
- CAIRO_OPERATOR_SOURCE, _src,
- NULL);
+ status = _cairo_surface_paint (image, CAIRO_OPERATOR_SOURCE,
+ _src, NULL);
cairo_surface_unmap_image (&surface->base, image);
attributes->extend = CAIRO_EXTEND_NONE;
@@ -185,7 +184,7 @@ _cairo_gl_pattern_texture_setup (cairo_gl_operand_t *operand,
* (unnormalized src -> unnormalized src) to
* (unnormalized dst -> unnormalized src)
*/
- cairo_matrix_init_translate (&m, -dst_x, -dst_y);
+ cairo_matrix_init_translate (&m, src_x - dst_x, src_y - dst_y);
cairo_matrix_multiply (&attributes->matrix, &m, &src->base.matrix);
/* Translate the matrix from