summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/vega/api_paint.c
diff options
context:
space:
mode:
authorChia-I Wu <[email protected]>2011-01-30 22:54:40 +0800
committerChia-I Wu <[email protected]>2011-01-30 23:22:40 +0800
commit3f0a966807f03a364edea0272ddf45f08ab7ce4f (patch)
treeb6d5fee2968cc39727752aa37e7734da0c26bee0 /src/gallium/state_trackers/vega/api_paint.c
parente919dee1edd469c174c5c07c95efd4932a674b67 (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/api_paint.c')
-rw-r--r--src/gallium/state_trackers/vega/api_paint.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/gallium/state_trackers/vega/api_paint.c b/src/gallium/state_trackers/vega/api_paint.c
index 6a8ae9c96c8..2610ebe0576 100644
--- a/src/gallium/state_trackers/vega/api_paint.c
+++ b/src/gallium/state_trackers/vega/api_paint.c
@@ -72,6 +72,8 @@ void vegaSetPaint(VGPaint paint, VGbitfield paintModes)
if (paintModes & VG_STROKE_PATH) {
ctx->state.vg.stroke_paint = handle_to_paint(paint);
}
+
+ ctx->state.dirty |= PAINT_DIRTY;
}
VGPaint vegaGetPaint(VGPaintMode paintMode)
@@ -98,6 +100,7 @@ VGPaint vegaGetPaint(VGPaintMode paintMode)
void vegaSetColor(VGPaint paint, VGuint rgba)
{
struct vg_context *ctx = vg_current_context();
+ struct vg_paint *p;
if (paint == VG_INVALID_HANDLE) {
vg_set_error(ctx, VG_BAD_HANDLE_ERROR);
@@ -109,7 +112,12 @@ void vegaSetColor(VGPaint paint, VGuint rgba)
return;
}
- paint_set_colori(handle_to_paint(paint), rgba);
+ p = handle_to_paint(paint);
+ paint_set_colori(p, rgba);
+
+ if (ctx->state.vg.fill_paint == p ||
+ ctx->state.vg.stroke_paint == p)
+ ctx->state.dirty |= PAINT_DIRTY;
}
VGuint vegaGetColor(VGPaint paint)