diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2012-05-11 17:17:05 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2012-05-11 17:30:42 +0100 |
commit | 117a44a33526a7738cac6643ea35fb73dc8a710f (patch) | |
tree | 500613be9f47bf2e67654259da203b71f6b1272a /src | |
parent | 0196327b30dd01ce0169a7bc67024b932368af4e (diff) |
gl: Reject SOURCE + mask in composite_boxes()
As SOURCE requires a bounded operation and the GL compositor only
implements a simple operation (i.e. it just blits from source to
destination instead of applying a linear interpolation as required), we
need to reject the operation and fallback. In the future, we should
make the linear interpolation available through a GL shader or as a
dual-source blend (better).
Spotted-by: Chuanbo Weng <strgnm@gmail.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src')
-rw-r--r-- | src/cairo-gl-spans-compositor.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/cairo-gl-spans-compositor.c b/src/cairo-gl-spans-compositor.c index 023cfd9f..4c5cef65 100644 --- a/src/cairo-gl-spans-compositor.c +++ b/src/cairo-gl-spans-compositor.c @@ -365,10 +365,16 @@ composite_boxes (void *_dst, TRACE ((stderr, "%s mask=(%d,%d), dst=(%d, %d)\n", __FUNCTION__, mask_x, mask_y, dst_x, dst_y)); - if (abstract_mask && op == CAIRO_OPERATOR_CLEAR) { - _cairo_gl_solid_operand_init (&tmp_operand, CAIRO_COLOR_WHITE); - src_operand = &tmp_operand; - op = CAIRO_OPERATOR_DEST_OUT; + if (abstract_mask) { + if (op == CAIRO_OPERATOR_CLEAR) { + _cairo_gl_solid_operand_init (&tmp_operand, CAIRO_COLOR_WHITE); + src_operand = &tmp_operand; + op = CAIRO_OPERATOR_DEST_OUT; + } else if (op == CAIRO_OPERATOR_SOURCE) { + /* requires a LERP in the shader between dest and source */ + return CAIRO_INT_STATUS_UNSUPPORTED; + } else + src_operand = source_to_operand (abstract_src); } else src_operand = source_to_operand (abstract_src); |