summaryrefslogtreecommitdiff
path: root/src/cairo-gl-composite.c
diff options
context:
space:
mode:
authorMartin Robinson <mrobinson@webkit.org>2011-10-07 15:34:13 -0700
committerChris Wilson <chris@chris-wilson.co.uk>2011-10-13 14:42:23 +0100
commitc25027f2a1570b78c314896a127e518db370645c (patch)
tree42cd2b04b30de5641cf66bddb214dcaadccdd1dd /src/cairo-gl-composite.c
parent32aa361c5ea0c761e26bc6fd94acfddd8df3b759 (diff)
gl/msaa: Support for solid color strokes.
Add support for basic solid color strokes using the fixed path stroke shaper. Currently components of the stroke overlap, but that will be handled in the following patch.
Diffstat (limited to 'src/cairo-gl-composite.c')
-rw-r--r--src/cairo-gl-composite.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/cairo-gl-composite.c b/src/cairo-gl-composite.c
index f260c1d9..2f9697a7 100644
--- a/src/cairo-gl-composite.c
+++ b/src/cairo-gl-composite.c
@@ -789,7 +789,7 @@ _cairo_gl_composite_init (cairo_gl_composite_t *setup,
static void
_cairo_gl_composite_emit_tristrip_vertex (cairo_gl_context_t *ctx,
- cairo_point_t *point)
+ const cairo_point_t *point)
{
GLfloat *vb = (GLfloat *) (void *) &ctx->vb[ctx->vb_offset];
@@ -841,7 +841,7 @@ _cairo_gl_composite_append_vertex_indices (cairo_gl_context_t *ctx,
cairo_int_status_t
_cairo_gl_composite_emit_quad_as_tristrip (cairo_gl_context_t *ctx,
cairo_gl_composite_t *setup,
- cairo_point_t quad[4])
+ const cairo_point_t quad[4])
{
_cairo_gl_composite_prepare_buffer (ctx, 4);
@@ -857,6 +857,19 @@ _cairo_gl_composite_emit_quad_as_tristrip (cairo_gl_context_t *ctx,
return _cairo_gl_composite_append_vertex_indices (ctx, 4);
}
+cairo_int_status_t
+_cairo_gl_composite_emit_triangle_as_tristrip (cairo_gl_context_t *ctx,
+ cairo_gl_composite_t *setup,
+ const cairo_point_t triangle[3])
+{
+ _cairo_gl_composite_prepare_buffer (ctx, 3);
+
+ _cairo_gl_composite_emit_tristrip_vertex (ctx, &triangle[0]);
+ _cairo_gl_composite_emit_tristrip_vertex (ctx, &triangle[1]);
+ _cairo_gl_composite_emit_tristrip_vertex (ctx, &triangle[2]);
+ return _cairo_gl_composite_append_vertex_indices (ctx, 3);
+}
+
cairo_status_t
_cairo_gl_composite_begin_tristrip (cairo_gl_composite_t *setup,
cairo_gl_context_t **ctx_out)