[PATCH] gl/msaa: Fix scissor bounds

Martin Robinson <[email protected]>
Newsgroups gmane.comp.lib.cairo
Message-ID <[email protected]>
Scissor bounds should depend on both the height and y coordinate
of the bounding box. Also remove _cairo_gl_y_flip() since we were
the last caller.
---
 src/cairo-gl-msaa-compositor.c |    5 +++--
 src/cairo-gl-private.h         |    9 ---------
 2 files changed, 3 insertions(+), 11 deletions(-)

diff --git a/src/cairo-gl-msaa-compositor.c b/src/cairo-gl-msaa-compositor.c
index 2210da6..316dfc8 100644
--- a/src/cairo-gl-msaa-compositor.c
+++ b/src/cairo-gl-msaa-compositor.c
@@ -251,8 +251,9 @@ static void
 _scissor_to_rectangle (cairo_gl_surface_t *surface,
 		       const cairo_rectangle_int_t *r)
 {
-    int y = _cairo_gl_y_flip (surface, r->y);
-
+    int y = r->y;
+    if (_cairo_gl_surface_is_texture (surface) == FALSE)
+	y = surface->height - (r->y + r->height);
     glScissor (r->x, y, r->width, r->height);
     glEnable (GL_SCISSOR_TEST);
 }
diff --git a/src/cairo-gl-private.h b/src/cairo-gl-private.h
index cd7c8ae..19c7c1f 100644
--- a/src/cairo-gl-private.h
+++ b/src/cairo-gl-private.h
@@ -542,15 +542,6 @@ _cairo_gl_surface_show_glyphs (void			*abstract_dst,
 			       const cairo_clip_t	*clip,
 			       int			*remaining_glyphs);

-static inline int
-_cairo_gl_y_flip (cairo_gl_surface_t *surface, int y)
-{
-    if (surface->fb)
-	return y;
-    else
-	return (surface->height - 1) - y;
-}
-
 cairo_private cairo_status_t
 _cairo_gl_context_init_shaders (cairo_gl_context_t *ctx);

-- 
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.