summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2010-06-14 12:15:34 +0100
committerOwain G. Ainsworth <oga@openbsd.org>2010-06-14 17:38:46 +0100
commit6ac82c3da3f3cf1df15532fc65624d548fbdb8bf (patch)
tree34d5be66013794bdf1a72bafde77b753df1ab1d6
parent3a4e72daee2e89054d588a5fabf690b9f15705c6 (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> (cherry picked from commit 995a4b2b1d09c31672d9258a8ac732dcf9a8fe9f) Signed-off-by: Owain G. Ainsworth <oga@openbsd.org>
-rw-r--r--src/i830_render.c14
-rw-r--r--src/i965_render.c16
2 files changed, 30 insertions, 0 deletions
diff --git a/src/i830_render.c b/src/i830_render.c
index f87a6926..43f4e28b 100644
--- a/src/i830_render.c
+++ b/src/i830_render.c
@@ -466,6 +466,20 @@ i830_prepare_composite(int op, PicturePtr source_picture,
if (!intel_check_pitch_3d(source))
return FALSE;
if (mask) {
+ 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 (i830_blend_op[op].src_alpha &&
+ (i830_blend_op[op].src_blend != BLENDFACTOR_ZERO)) {
+ intel_debug_fallback(scrn, "Component alpha not "
+ "supported with source alpha and "
+ "source value blending.\n");
+ return FALSE;
+ }
+ }
if (!intel_check_pitch_3d(mask))
return FALSE;
}
diff --git a/src/i965_render.c b/src/i965_render.c
index 3e425efc..02b74f42 100644
--- a/src/i965_render.c
+++ b/src/i965_render.c
@@ -1491,6 +1491,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) {