summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2010-05-28 21:55:26 +0200
committerBenjamin Otte <otte@redhat.com>2010-06-07 13:37:48 +0200
commite15348d8d0bbff6968b1f640e63315d159f143f5 (patch)
tree6364a564c39775ada818126b01134b375503a0ee
parenta8d6ac1efc3f1f5ff4f92f4e7a3492e62518f3f7 (diff)
gl: Don't reset vertex size
-rw-r--r--src/cairo-gl-composite.c10
-rw-r--r--src/cairo-gl-device.c1
2 files changed, 7 insertions, 4 deletions
diff --git a/src/cairo-gl-composite.c b/src/cairo-gl-composite.c
index 24291cfd..f7206140 100644
--- a/src/cairo-gl-composite.c
+++ b/src/cairo-gl-composite.c
@@ -960,7 +960,7 @@ cairo_status_t
_cairo_gl_composite_begin (cairo_gl_composite_t *setup,
cairo_gl_context_t **ctx_out)
{
- unsigned int dst_size, src_size, mask_size;
+ unsigned int dst_size, src_size, mask_size, vertex_size;
cairo_gl_context_t *ctx;
cairo_status_t status;
cairo_bool_t component_alpha;
@@ -1008,7 +1008,11 @@ _cairo_gl_composite_begin (cairo_gl_composite_t *setup,
src_size = _cairo_gl_operand_get_vertex_size (setup->src.type);
mask_size = _cairo_gl_operand_get_vertex_size (setup->mask.type);
- ctx->vertex_size = dst_size + src_size + mask_size;
+ vertex_size = dst_size + src_size + mask_size;
+ if (ctx->vertex_size != vertex_size) {
+ _cairo_gl_composite_flush (ctx);
+ ctx->vertex_size = vertex_size;
+ }
_cairo_gl_context_set_destination (ctx, setup->dst);
_cairo_gl_set_operator (setup->dst,
@@ -1243,8 +1247,6 @@ _cairo_gl_composite_end (cairo_gl_context_t *ctx,
_cairo_gl_context_destroy_operand (ctx, CAIRO_GL_TEX_SOURCE);
_cairo_gl_context_destroy_operand (ctx, CAIRO_GL_TEX_MASK);
-
- ctx->vertex_size = 0;
}
void
diff --git a/src/cairo-gl-device.c b/src/cairo-gl-device.c
index 603de6cf..a957381c 100644
--- a/src/cairo-gl-device.c
+++ b/src/cairo-gl-device.c
@@ -80,6 +80,7 @@ _gl_flush (void *device)
ctx->clip_region = NULL;
}
+ ctx->vertex_size = 0;
ctx->pre_shader = NULL;
_cairo_gl_set_shader (ctx, NULL);