summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2014-04-10 20:41:57 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2014-04-10 23:15:32 +0100
commita79eb2e29a158910785580409c51a585f25876a7 (patch)
tree5887f3db3b2e83c7824d489bd0e062e50e54ee34
parent25fa4f5bb4c9ed12755edfeec38b9bdc134736f1 (diff)
sna/gen2: Fix CA/a8 blend factors
This is a revert of commit 142f8461944b294dbc3fb0a7bf607bccf0bccc1f [2.99.911] Author: Chris Wilson <chris@chris-wilson.co.uk> Date: Mon Mar 10 15:20:16 2014 +0000 sna/gen2: Tidy blend factor selection for the source as that broke glyph rendering in firefox for instance. Reported-by: Carl Eitsger <4607vrfcr84spd21f08@weg-werf-email.de> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77201 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/gen2_render.c41
1 files changed, 26 insertions, 15 deletions
diff --git a/src/sna/gen2_render.c b/src/sna/gen2_render.c
index a4788177..a6c24f7c 100644
--- a/src/sna/gen2_render.c
+++ b/src/sna/gen2_render.c
@@ -350,28 +350,39 @@ gen2_get_blend_factors(const struct sna_composite_op *op,
cblend = TB0C_LAST_STAGE | TB0C_RESULT_SCALE_1X | TB0C_OUTPUT_WRITE_CURRENT;
ablend = TB0A_RESULT_SCALE_1X | TB0A_OUTPUT_WRITE_CURRENT;
-
/* Get the source picture's channels into TBx_ARG1 */
- if (op->src.is_solid)
- cblend |= TB0C_ARG1_SEL_DIFFUSE;
- else if (PICT_FORMAT_RGB(op->src.pict_format) != 0)
- cblend |= TB0C_ARG1_SEL_TEXEL0;
- else
- cblend |= TB0C_ARG1_SEL_ONE | TB0C_ARG1_INVERT; /* 0.0 */
- if (op->src.is_solid)
- ablend |= TB0A_ARG1_SEL_DIFFUSE;
- else if (op->src.is_opaque)
- ablend |= TB0A_ARG1_SEL_ONE;
- else
- ablend |= TB0A_ARG1_SEL_TEXEL0;
if ((op->has_component_alpha && gen2_blend_op[blend].src_alpha) ||
- op->dst.format == PICT_a8)
+ op->dst.format == PICT_a8) {
/* Producing source alpha value, so the first set of channels
* is src.A instead of src.X. We also do this if the destination
* is a8, in which case src.G is what's written, and the other
* channels are ignored.
*/
- cblend |= TB0C_ARG1_REPLICATE_ALPHA;
+ if (op->src.is_opaque) {
+ ablend |= TB0C_ARG1_SEL_ONE;
+ cblend |= TB0C_ARG1_SEL_ONE;
+ } else if (op->src.is_solid) {
+ ablend |= TB0C_ARG1_SEL_DIFFUSE;
+ cblend |= TB0C_ARG1_SEL_DIFFUSE | TB0C_ARG1_REPLICATE_ALPHA;
+ } else {
+ ablend |= TB0C_ARG1_SEL_TEXEL0;
+ cblend |= TB0C_ARG1_SEL_TEXEL0 | TB0C_ARG1_REPLICATE_ALPHA;
+ }
+ } else {
+ if (op->src.is_solid)
+ cblend |= TB0C_ARG1_SEL_DIFFUSE;
+ else if (PICT_FORMAT_RGB(op->src.pict_format) != 0)
+ cblend |= TB0C_ARG1_SEL_TEXEL0;
+ else
+ cblend |= TB0C_ARG1_SEL_ONE | TB0C_ARG1_INVERT; /* 0.0 */
+
+ if (op->src.is_opaque)
+ ablend |= TB0A_ARG1_SEL_ONE;
+ else if (op->src.is_solid)
+ ablend |= TB0A_ARG1_SEL_DIFFUSE;
+ else
+ ablend |= TB0A_ARG1_SEL_TEXEL0;
+ }
if (op->mask.bo) {
if (op->src.is_solid) {