summaryrefslogtreecommitdiff
path: root/src/cairo-gl-composite.c
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2010-05-16 21:10:45 +0200
committerBenjamin Otte <otte@redhat.com>2010-05-17 01:16:14 +0200
commitb768a33a602942825e5ec651ae7bafd6d5fc33ac (patch)
treedfb01e54accf1c14e1b57a305fa30a328fa70a0e /src/cairo-gl-composite.c
parent1cde4601df8a3689450e2a0e15888c53aff12983 (diff)
gl: Set composite->has_component_alpha based on mask
Previously it was set when initing the composite structure, but that doesn't allow resetting it when a new mask is used.
Diffstat (limited to 'src/cairo-gl-composite.c')
-rw-r--r--src/cairo-gl-composite.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/cairo-gl-composite.c b/src/cairo-gl-composite.c
index eae83b29..a9c7e255 100644
--- a/src/cairo-gl-composite.c
+++ b/src/cairo-gl-composite.c
@@ -507,6 +507,7 @@ _cairo_gl_composite_set_mask (cairo_gl_context_t *ctx,
int width, int height)
{
_cairo_gl_operand_destroy (&setup->mask);
+ setup->has_component_alpha = pattern && pattern->has_component_alpha;
return _cairo_gl_operand_init (ctx, &setup->mask, pattern,
setup->dst,
src_x, src_y,
@@ -520,6 +521,7 @@ _cairo_gl_composite_set_mask_spans (cairo_gl_context_t *ctx,
{
_cairo_gl_operand_destroy (&setup->mask);
setup->mask.type = CAIRO_GL_OPERAND_SPANS;
+ setup->has_component_alpha = FALSE;
}
void
@@ -1379,12 +1381,12 @@ _cairo_gl_composite_init (cairo_gl_context_t *ctx,
cairo_gl_surface_t *dst,
const cairo_pattern_t *src,
const cairo_pattern_t *mask,
- cairo_bool_t has_component_alpha,
+ cairo_bool_t assume_component_alpha,
const cairo_rectangle_int_t *rect)
{
memset (setup, 0, sizeof (cairo_gl_composite_t));
- if (has_component_alpha) {
+ if (assume_component_alpha) {
if (op != CAIRO_OPERATOR_CLEAR &&
op != CAIRO_OPERATOR_OVER &&
op != CAIRO_OPERATOR_ADD)
@@ -1395,7 +1397,6 @@ _cairo_gl_composite_init (cairo_gl_context_t *ctx,
}
setup->dst = dst;
- setup->has_component_alpha = has_component_alpha;
setup->op = op;
return CAIRO_STATUS_SUCCESS;