[PATCH] gl: Set correct operation extents.

Chuanbo Weng <[email protected]>
Newsgroups gmane.comp.lib.cairo
Message-ID <[email protected]>
The dst_x and dst_y should be considered when setting clip extents,
because they are not always be zero. (for example, in clip-operator.c)
---
 src/cairo-gl-glyphs.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/src/cairo-gl-glyphs.c b/src/cairo-gl-glyphs.c
index e6267c0..0139bd1 100644
--- a/src/cairo-gl-glyphs.c
+++ b/src/cairo-gl-glyphs.c
@@ -372,6 +372,7 @@ render_glyphs_via_mask (cairo_gl_surface_t *dst,
     if (likely (status == CAIRO_STATUS_SUCCESS)) {
 	cairo_surface_pattern_t mask_pattern;
 	cairo_surface_pattern_t source_pattern;
+	cairo_rectangle_int_t clip_extents;
 
 	mask->is_clear = FALSE;
 	_cairo_pattern_init_for_surface (&mask_pattern, mask);
@@ -387,7 +388,11 @@ render_glyphs_via_mask (cairo_gl_surface_t *dst,
 		                     dst_x-info->extents.x, dst_y-info->extents.y);
 
 	clip = _cairo_clip_copy (clip);
-	clip = _cairo_clip_intersect_rectangle (clip, &info->extents);
+	clip_extents.x = info->extents.x - dst_x;
+	clip_extents.y = info->extents.y - dst_y;
+	clip_extents.width = info->extents.width;
+	clip_extents.height = info->extents.height;
+	clip = _cairo_clip_intersect_rectangle (clip, &clip_extents);
 
 	status = _cairo_surface_mask (&dst->base, op,
 		                      &source_pattern.base,
-- 
1.7.5.4

-- 
cairo mailing list
[email protected]
http://lists.cairographics.org/mailman/listinfo/cairo
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.