[cairo-commit] 2 commits - src/cairo-gl-composite.c src/cairo-gl-shaders.c

Chris Wilson ickle at kemper.freedesktop.org
Tue Oct 11 03:58:31 PDT 2011


 src/cairo-gl-composite.c |    2 +-
 src/cairo-gl-shaders.c   |    6 +++++-
 2 files changed, 6 insertions(+), 2 deletions(-)

New commits:
commit 4f5d42f6e59010ceaa68bff9be4353aa5f4d2e53
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Tue Oct 11 11:42:45 2011 +0100

    gl: Spans start after the mask, not coincident!
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/cairo-gl-composite.c b/src/cairo-gl-composite.c
index 6413255..382b13b 100644
--- a/src/cairo-gl-composite.c
+++ b/src/cairo-gl-composite.c
@@ -534,7 +534,7 @@ _cairo_gl_composite_begin (cairo_gl_composite_t *setup,
     _cairo_gl_context_setup_operand (ctx, CAIRO_GL_TEX_SOURCE, &setup->src, vertex_size, dst_size);
     _cairo_gl_context_setup_operand (ctx, CAIRO_GL_TEX_MASK, &setup->mask, vertex_size, dst_size + src_size);
     if (setup->spans)
-	_cairo_gl_context_setup_spans (ctx, vertex_size, dst_size + src_size);
+	_cairo_gl_context_setup_spans (ctx, vertex_size, dst_size + src_size + mask_size);
     else
 	ctx->dispatch.DisableVertexAttribArray (CAIRO_GL_COLOR_ATTRIB_INDEX);
 
commit 41633913229fac2833edb6f10ab8d39d4df16aed
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Tue Oct 11 11:30:47 2011 +0100

    gl: Include use-coverage in shader hash
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/cairo-gl-shaders.c b/src/cairo-gl-shaders.c
index 446b6af..b3af6f7 100644
--- a/src/cairo-gl-shaders.c
+++ b/src/cairo-gl-shaders.c
@@ -315,6 +315,7 @@ typedef struct _cairo_shader_cache_entry {
     cairo_gl_operand_type_t src;
     cairo_gl_operand_type_t mask;
     cairo_gl_operand_type_t dest;
+    cairo_bool_t use_coverage;
     cairo_gl_shader_in_t in;
     GLint src_gl_filter;
     cairo_bool_t src_border_fade;
@@ -334,6 +335,7 @@ _cairo_gl_shader_cache_equal_desktop (const void *key_a, const void *key_b)
     return a->src  == b->src  &&
            a->mask == b->mask &&
            a->dest == b->dest &&
+	   a->use_coverage == b->use_coverage &&
            a->in   == b->in;
 }
 
@@ -351,6 +353,7 @@ _cairo_gl_shader_cache_equal_gles2 (const void *key_a, const void *key_b)
     return a->src  == b->src  &&
 	   a->mask == b->mask &&
 	   a->dest == b->dest &&
+	   a->use_coverage == b->use_coverage &&
 	   a->in   == b->in   &&
 	   a->src_gl_filter == b->src_gl_filter &&
 	   a->src_border_fade == b->src_border_fade &&
@@ -361,7 +364,7 @@ _cairo_gl_shader_cache_equal_gles2 (const void *key_a, const void *key_b)
 static unsigned long
 _cairo_gl_shader_cache_hash (const cairo_shader_cache_entry_t *entry)
 {
-    return (entry->src << 24) | (entry->mask << 16) | (entry->dest << 8) | (entry->in);
+    return (entry->src << 24) | (entry->mask << 16) | (entry->dest << 8) | (entry->in << 1) | entry->use_coverage;
 }
 
 static void
@@ -1065,6 +1068,7 @@ _cairo_gl_get_shader_by_type (cairo_gl_context_t *ctx,
     lookup.src = source->type;
     lookup.mask = mask->type;
     lookup.dest = CAIRO_GL_OPERAND_NONE;
+    lookup.use_coverage = use_coverage;
     lookup.in = in;
     lookup.src_gl_filter = _cairo_gl_operand_get_gl_filter (source);
     lookup.src_border_fade = _cairo_gl_shader_needs_border_fade (source);


More information about the cairo-commit mailing list