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>
This commit is contained in:
Chris Wilson 2012-05-11 17:17:05 +01:00
parent 0196327b30
commit 117a44a335

View file

@ -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);