summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/vega/renderer.c
diff options
context:
space:
mode:
authorChia-I Wu <[email protected]>2011-09-21 11:40:27 +0800
committerChia-I Wu <[email protected]>2011-09-21 12:01:21 +0800
commit4a96a02de7c1b8c136ffc0cd278401c85faab233 (patch)
tree4013803f8828ec0fd99f9a4f557f7455d5b960fb /src/gallium/state_trackers/vega/renderer.c
parentceb6d34906c7c03c102c7e78dd02f5b0ebab4ca9 (diff)
st/vega: fix drawing images with alpha channel
Checking if the paints are opaque in renderer_validate_blend() does not work. We could be drawing images. Remove the check from renderer_validate_blend() and take image drawing into consideration in blend_use_shader(). The bug was introduced by 3f0a966807f03a364edea0272ddf45f08ab7ce4f, which affects the lookup demo.
Diffstat (limited to 'src/gallium/state_trackers/vega/renderer.c')
-rw-r--r--src/gallium/state_trackers/vega/renderer.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/gallium/state_trackers/vega/renderer.c b/src/gallium/state_trackers/vega/renderer.c
index 5715073e2d9..e4c1fd5e3a3 100644
--- a/src/gallium/state_trackers/vega/renderer.c
+++ b/src/gallium/state_trackers/vega/renderer.c
@@ -28,7 +28,6 @@
#include "renderer.h"
#include "vg_context.h"
-#include "paint.h" /* for paint_is_opaque */
#include "pipe/p_context.h"
#include "pipe/p_state.h"
@@ -1292,11 +1291,8 @@ static void renderer_validate_blend(struct renderer *renderer,
blend.rt[0].alpha_dst_factor = PIPE_BLENDFACTOR_ZERO;
break;
case VG_BLEND_SRC_OVER:
- if (paint_is_opaque(state->fill_paint) &&
- paint_is_opaque(state->stroke_paint)) {
- /* no blending */
- }
- else if (!util_format_has_alpha(fb_format)) {
+ /* use the blend state only when there is no alpha channel */
+ if (!util_format_has_alpha(fb_format)) {
blend.rt[0].rgb_src_factor = PIPE_BLENDFACTOR_SRC_ALPHA;
blend.rt[0].alpha_src_factor = PIPE_BLENDFACTOR_ONE;
blend.rt[0].rgb_dst_factor = PIPE_BLENDFACTOR_INV_SRC_ALPHA;