summaryrefslogtreecommitdiff
path: root/src/i965_render.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2010-06-14 12:15:34 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2010-06-14 12:14:30 +0100
commit995a4b2b1d09c31672d9258a8ac732dcf9a8fe9f (patch)
tree74fe2891b322926a9e699e83992ee16589b32156 /src/i965_render.c
parent84d65bace521ad80b9bede4ae9e3e2a8d0668b90 (diff)
i965: Sanity check ComponentAlpha status in prepare_composite
Fixes: Bug 28446 - Garbled Font with Mathematica 7 https://bugs.freedesktop.org/show_bug.cgi?id=28446 Rewriting the glyphs to render to the destination directly and removing the more expensive multiple invocations of CompositePicture per picture was a great performance boost -- except that it needs special handling in the backend in order to not fallback. Having done so for i915, I neglected to ensure the sanity checking in i965_prepare_composite() was sufficient. As it turns out, it was not and so we misrendered CA-glyphs when rendering directly to the destination. This causes us to fallback properly, but is a performance regression as we no longer try the 2-pass magic helper before resorting to s/w. At the moment, I'd rather live with the temporary regression and fix i965 to do the same magic as i915, as it critical to fixing the severe performance issues currently crippling i965, as I believe that this regression only affects the minority of applications (incorrect, as it turns out, as the glyphs are overlapping) rendering directly to the destination. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/i965_render.c')
-rw-r--r--src/i965_render.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/i965_render.c b/src/i965_render.c
index 4f68b043..f5904cc9 100644
--- a/src/i965_render.c
+++ b/src/i965_render.c
@@ -1509,6 +1509,22 @@ i965_prepare_composite(int op, PicturePtr source_picture,
}
if (mask_picture) {
+ if (mask_picture->componentAlpha &&
+ PICT_FORMAT_RGB(mask_picture->format)) {
+ /* Check if it's component alpha that relies on a source alpha and on
+ * the source value. We can only get one of those into the single
+ * source value that we get to blend with.
+ */
+ if (i965_blend_op[op].src_alpha &&
+ (i965_blend_op[op].src_blend != BRW_BLENDFACTOR_ZERO)) {
+ intel_debug_fallback(scrn,
+ "Component alpha not supported "
+ "with source alpha and source "
+ "value blending.\n");
+ return FALSE;
+ }
+ }
+
composite_op->mask_filter =
sampler_state_filter_from_picture(mask_picture->filter);
if (composite_op->mask_filter < 0) {