diff options
author | Chia-I Wu <[email protected]> | 2010-11-29 11:49:18 +0800 |
---|---|---|
committer | Chia-I Wu <[email protected]> | 2010-12-01 11:23:52 +0800 |
commit | e360f91f152615b35857a4d008d0439a3c3285a8 (patch) | |
tree | 0567639af63cafa34dcb26adbb6928432ff1870a /src/gallium/state_trackers/vega/mask.c | |
parent | 213e288e78bf5b0fb0a996cc17dfd959756c2c53 (diff) |
st/vega: Add color transformation support.
Per OpenVG 1.1. A new shader stage is added. It uses the first two
constants of the fragment shader for color transformation parameters.
Diffstat (limited to 'src/gallium/state_trackers/vega/mask.c')
-rw-r--r-- | src/gallium/state_trackers/vega/mask.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/gallium/state_trackers/vega/mask.c b/src/gallium/state_trackers/vega/mask.c index 0e25833cda3..670790c0238 100644 --- a/src/gallium/state_trackers/vega/mask.c +++ b/src/gallium/state_trackers/vega/mask.c @@ -253,7 +253,11 @@ static void mask_resource_fill(struct pipe_resource *dst, VGfloat coverage) { struct vg_context *ctx = vg_current_context(); - VGfloat color[4] = { 0.0f, 0.0f, 0.0f, coverage }; + VGfloat fs_consts[12] = { + 0.0f, 0.0f, 0.0f, 0.0f, /* not used */ + 0.0f, 0.0f, 0.0f, 0.0f, /* not used */ + 0.0f, 0.0f, 0.0f, coverage /* color */ + }; void *fs; if (x < 0) { @@ -267,8 +271,8 @@ static void mask_resource_fill(struct pipe_resource *dst, fs = shaders_cache_fill(ctx->sc, VEGA_SOLID_FILL_SHADER); - if (renderer_filter_begin(ctx->renderer, dst, VG_FALSE, - ~0, NULL, NULL, 0, fs, (const void *) color, sizeof(color))) { + if (renderer_filter_begin(ctx->renderer, dst, VG_FALSE, ~0, + NULL, NULL, 0, fs, (const void *) fs_consts, sizeof(fs_consts))) { renderer_filter(ctx->renderer, x, y, width, height, 0, 0, 0, 0); renderer_filter_end(ctx->renderer); } |