diff options
author | Chia-I Wu <[email protected]> | 2011-01-30 22:54:40 +0800 |
---|---|---|
committer | Chia-I Wu <[email protected]> | 2011-01-30 23:22:40 +0800 |
commit | 3f0a966807f03a364edea0272ddf45f08ab7ce4f (patch) | |
tree | b6d5fee2968cc39727752aa37e7734da0c26bee0 /src/gallium/state_trackers/vega/vg_context.c | |
parent | e919dee1edd469c174c5c07c95efd4932a674b67 (diff) |
st/vega: Disable blending when the paint is opaque.
When the paint is opaque (currently, solid color with alpha 1.0f), no
blending is needed for VG_BLEND_SRC_OVER. This eliminates the serious
performance hit introduced by 859106f196ade77f59f8787b071739901cd1a843
for a common scenario.
Diffstat (limited to 'src/gallium/state_trackers/vega/vg_context.c')
-rw-r--r-- | src/gallium/state_trackers/vega/vg_context.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/gallium/state_trackers/vega/vg_context.c b/src/gallium/state_trackers/vega/vg_context.c index cd251838e02..83b42609e03 100644 --- a/src/gallium/state_trackers/vega/vg_context.c +++ b/src/gallium/state_trackers/vega/vg_context.c @@ -408,8 +408,9 @@ void vg_validate_state(struct vg_context *ctx) if (vg_context_update_depth_stencil_rb(ctx, stfb->width, stfb->height)) ctx->state.dirty |= DEPTH_STENCIL_DIRTY; - /* blend state depends on fb format */ - if (ctx->state.dirty & FRAMEBUFFER_DIRTY) + /* blend state depends on fb format and paint color */ + if ((ctx->state.dirty & FRAMEBUFFER_DIRTY) || + (ctx->state.dirty & PAINT_DIRTY)) ctx->state.dirty |= BLEND_DIRTY; renderer_validate(ctx->renderer, ctx->state.dirty, |