[cairo-commit] src/cairo-gl-composite.c

Martin Robinson mrobinson at kemper.freedesktop.org
Tue Jan 29 13:24:26 PST 2013


 src/cairo-gl-composite.c |   24 +++++++++++-------------
 1 file changed, 11 insertions(+), 13 deletions(-)

New commits:
commit 89092b97b50a7740058d0f72f94dfc6defe15ed6
Author: Henry Song <henry.song at samsung.com>
Date:   Tue Jan 29 13:21:00 2013 -0800

    gl/msaa: Don't emit alpha when emitting vertices
    
    The color attribute is disabled when not in spans mode, so the emitted
    alpha is simply overwritten by the next vertex. Additionally, this can
    potentially cause the alpha to be written past the end of the buffer.

diff --git a/src/cairo-gl-composite.c b/src/cairo-gl-composite.c
index de45028..d8166b8 100644
--- a/src/cairo-gl-composite.c
+++ b/src/cairo-gl-composite.c
@@ -904,13 +904,11 @@ _cairo_gl_composite_emit_alpha_vertex (cairo_gl_context_t *ctx,
 
 static void
 _cairo_gl_composite_emit_point (cairo_gl_context_t	*ctx,
-				const cairo_point_t	*point,
-				uint8_t alpha)
+				const cairo_point_t	*point)
 {
-    _cairo_gl_composite_emit_alpha_vertex (ctx,
-					   _cairo_fixed_to_double (point->x),
-					   _cairo_fixed_to_double (point->y),
-					   alpha);
+    _cairo_gl_composite_emit_vertex (ctx,
+				     _cairo_fixed_to_double (point->x),
+				     _cairo_fixed_to_double (point->y));
 }
 
 static void
@@ -1194,14 +1192,14 @@ _cairo_gl_composite_emit_quad_as_tristrip (cairo_gl_context_t	*ctx,
     _cairo_gl_composite_prepare_buffer (ctx, 4,
 					CAIRO_GL_PRIMITIVE_TYPE_TRISTRIPS);
 
-    _cairo_gl_composite_emit_point (ctx, &quad[0], 0);
-    _cairo_gl_composite_emit_point (ctx, &quad[1], 0);
+    _cairo_gl_composite_emit_point (ctx, &quad[0]);
+    _cairo_gl_composite_emit_point (ctx, &quad[1]);
 
     /* Cairo stores quad vertices in counter-clockwise order, but we need to
        emit them from top to bottom in the triangle strip, so we need to reverse
        the order of the last two vertices. */
-    _cairo_gl_composite_emit_point (ctx, &quad[3], 0);
-    _cairo_gl_composite_emit_point (ctx, &quad[2], 0);
+    _cairo_gl_composite_emit_point (ctx, &quad[3]);
+    _cairo_gl_composite_emit_point (ctx, &quad[2]);
 
     return _cairo_gl_composite_append_vertex_indices (ctx, 4);
 }
@@ -1214,8 +1212,8 @@ _cairo_gl_composite_emit_triangle_as_tristrip (cairo_gl_context_t	*ctx,
     _cairo_gl_composite_prepare_buffer (ctx, 3,
 					CAIRO_GL_PRIMITIVE_TYPE_TRISTRIPS);
 
-    _cairo_gl_composite_emit_point (ctx, &triangle[0], 0);
-    _cairo_gl_composite_emit_point (ctx, &triangle[1], 0);
-    _cairo_gl_composite_emit_point (ctx, &triangle[2], 0);
+    _cairo_gl_composite_emit_point (ctx, &triangle[0]);
+    _cairo_gl_composite_emit_point (ctx, &triangle[1]);
+    _cairo_gl_composite_emit_point (ctx, &triangle[2]);
     return _cairo_gl_composite_append_vertex_indices (ctx, 3);
 }


More information about the cairo-commit mailing list