diff options
author | Zack Rusin <[email protected]> | 2009-10-11 01:07:26 -0400 |
---|---|---|
committer | Zack Rusin <[email protected]> | 2009-10-14 19:04:29 -0400 |
commit | 59cf40059a7c451b1d1bc0c90f674e8e4baa5ab8 (patch) | |
tree | 1080f1f08ee25ddcdc1dd0d0e2fa9967b7bff40c /src/gallium/state_trackers/xorg | |
parent | 96c9b39a6a9553573fcbdb5fd6db0e9d59768442 (diff) |
st/xorg: get transparency on fills working (fixes Qt/KDE apps)
Diffstat (limited to 'src/gallium/state_trackers/xorg')
-rw-r--r-- | src/gallium/state_trackers/xorg/xorg_composite.c | 19 | ||||
-rw-r--r-- | src/gallium/state_trackers/xorg/xorg_renderer.c | 3 |
2 files changed, 15 insertions, 7 deletions
diff --git a/src/gallium/state_trackers/xorg/xorg_composite.c b/src/gallium/state_trackers/xorg/xorg_composite.c index 6871625605f..b39b39511e1 100644 --- a/src/gallium/state_trackers/xorg/xorg_composite.c +++ b/src/gallium/state_trackers/xorg/xorg_composite.c @@ -40,6 +40,14 @@ static const struct xorg_composite_blend xorg_blends[] = { { PictOpOverReverse, PIPE_BLENDFACTOR_SRC_ALPHA, PIPE_BLENDFACTOR_ONE, PIPE_BLENDFACTOR_INV_SRC_ALPHA, PIPE_BLENDFACTOR_INV_SRC_ALPHA }, + + { PictOpOutReverse, + PIPE_BLENDFACTOR_SRC_ALPHA, PIPE_BLENDFACTOR_ONE, + PIPE_BLENDFACTOR_INV_SRC_ALPHA, PIPE_BLENDFACTOR_INV_SRC_ALPHA }, + + { PictOpAdd, + PIPE_BLENDFACTOR_SRC_ALPHA, PIPE_BLENDFACTOR_ONE, + PIPE_BLENDFACTOR_INV_SRC_ALPHA, PIPE_BLENDFACTOR_INV_SRC_ALPHA }, }; @@ -138,7 +146,9 @@ boolean xorg_composite_accelerated(int op, (!accelerated_ops[i].with_mask || (pMaskPicture->componentAlpha && !accelerated_ops[i].component_alpha)))) - XORG_FALLBACK("component alpha unsupported"); + XORG_FALLBACK("component alpha unsupported (PictOpOver=%s(%d)", + (accelerated_ops[i].op == PictOpOver) ? "yes" : "no", + accelerated_ops[i].op); return TRUE; } } @@ -156,10 +166,7 @@ bind_blend_state(struct exa_context *exa, int op, memset(&blend, 0, sizeof(struct pipe_blend_state)); blend.blend_enable = 1; - blend.colormask |= PIPE_MASK_R; - blend.colormask |= PIPE_MASK_G; - blend.colormask |= PIPE_MASK_B; - blend.colormask |= PIPE_MASK_A; + blend.colormask |= PIPE_MASK_RGBA; blend.rgb_src_factor = blend_opt.rgb_src_factor; blend.alpha_src_factor = blend_opt.alpha_src_factor; @@ -346,8 +353,6 @@ boolean xorg_solid_bind_state(struct exa_context *exa, pixel_to_float4(fg, exa->solid_color); exa->has_solid_color = TRUE; - exa->solid_color[3] = 1.f; - #if 0 debug_printf("Color Pixel=(%d, %d, %d, %d), RGBA=(%f, %f, %f, %f)\n", (fg >> 24) & 0xff, (fg >> 16) & 0xff, diff --git a/src/gallium/state_trackers/xorg/xorg_renderer.c b/src/gallium/state_trackers/xorg/xorg_renderer.c index 1eecf7d2b97..81b209cb596 100644 --- a/src/gallium/state_trackers/xorg/xorg_renderer.c +++ b/src/gallium/state_trackers/xorg/xorg_renderer.c @@ -681,6 +681,9 @@ void renderer_draw_solid_rect(struct xorg_renderer *r, struct pipe_context *pipe = r->pipe; struct pipe_buffer *buf = 0; + /* + debug_printf("solid rect[(%d, %d), (%d, %d)], rgba[%f, %f, %f, %f]\n", + x0, y0, x1, y1, color[0], color[1], color[2], color[3]);*/ /* 1st vertex */ setup_vertex0(r->vertices2[0], x0, y0, color); /* 2nd vertex */ |