diff options
author | Dave Airlie <[email protected]> | 2011-09-16 09:39:34 +0100 |
---|---|---|
committer | Dave Airlie <[email protected]> | 2011-09-18 15:12:47 +0100 |
commit | 6dd284f7c8fac22f64c13fdf9909094f5ec59086 (patch) | |
tree | 8fe6c89638f05d1638b3a5d0395e011d68eda336 /src/gallium/auxiliary/vl | |
parent | 78026b8acef9d6eea4f37d9c5435447944d1befd (diff) |
gallium: move clear paths from rgba to a pointer to a color union (v2)
This moves the gallium interface for clears from using a pointer to 4 floats to a pointer to a union of float/unsigned/int values.
Notes:
1. the value is opaque.
2. only when the value is used should it be interpretered according to
the surface format it is going to be used with.
3. float clears on integer buffers and vice-versa are undefined.
v2: fixed up vega and graw, dropped hunks that shouldn't have been in
patch.
Signed-off-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/gallium/auxiliary/vl')
-rw-r--r-- | src/gallium/auxiliary/vl/vl_compositor.c | 20 | ||||
-rw-r--r-- | src/gallium/auxiliary/vl/vl_compositor.h | 6 |
2 files changed, 10 insertions, 16 deletions
diff --git a/src/gallium/auxiliary/vl/vl_compositor.c b/src/gallium/auxiliary/vl/vl_compositor.c index ebe6d7ae45c..322ef8e9954 100644 --- a/src/gallium/auxiliary/vl/vl_compositor.c +++ b/src/gallium/auxiliary/vl/vl_compositor.c @@ -552,26 +552,20 @@ vl_compositor_reset_dirty_area(struct vl_compositor *c) } void -vl_compositor_set_clear_color(struct vl_compositor *c, float color[4]) +vl_compositor_set_clear_color(struct vl_compositor *c, union pipe_color_union *color) { - unsigned i; - assert(c); - for (i = 0; i < 4; ++i) - c->clear_color[i] = color[i]; + c->clear_color = *color; } void -vl_compositor_get_clear_color(struct vl_compositor *c, float color[4]) +vl_compositor_get_clear_color(struct vl_compositor *c, union pipe_color_union *color) { - unsigned i; - assert(c); assert(color); - for (i = 0; i < 4; ++i) - color[i] = c->clear_color[i]; + *color = c->clear_color; } void @@ -760,7 +754,7 @@ vl_compositor_render(struct vl_compositor *c, if (clear_dirty_area && (c->dirty_tl.x < c->dirty_br.x || c->dirty_tl.y < c->dirty_br.y)) { - util_clear_render_target(c->pipe, dst_surface, c->clear_color, + util_clear_render_target(c->pipe, dst_surface, &c->clear_color, 0, 0, dst_surface->width, dst_surface->height); c->dirty_tl.x = c->dirty_tl.y = 1.0f; c->dirty_br.x = c->dirty_br.y = 0.0f; @@ -804,8 +798,8 @@ vl_compositor_init(struct vl_compositor *c, struct pipe_context *pipe) vl_csc_get_matrix(VL_CSC_COLOR_STANDARD_IDENTITY, NULL, true, csc_matrix); vl_compositor_set_csc_matrix(c, csc_matrix); - c->clear_color[0] = c->clear_color[1] = 0.0f; - c->clear_color[2] = c->clear_color[3] = 0.0f; + c->clear_color.f[0] = c->clear_color.f[1] = 0.0f; + c->clear_color.f[2] = c->clear_color.f[3] = 0.0f; vl_compositor_reset_dirty_area(c); return true; diff --git a/src/gallium/auxiliary/vl/vl_compositor.h b/src/gallium/auxiliary/vl/vl_compositor.h index 0b9b9939a8c..f60f7da3ec1 100644 --- a/src/gallium/auxiliary/vl/vl_compositor.h +++ b/src/gallium/auxiliary/vl/vl_compositor.h @@ -81,7 +81,7 @@ struct vl_compositor void *yuv; } fs_palette; - float clear_color[4]; + union pipe_color_union clear_color; struct vertex2f dirty_tl, dirty_br; unsigned used_layers:VL_COMPOSITOR_MAX_LAYERS; @@ -110,13 +110,13 @@ vl_compositor_reset_dirty_area(struct vl_compositor *compositor); * set the clear color */ void -vl_compositor_set_clear_color(struct vl_compositor *compositor, float color[4]); +vl_compositor_set_clear_color(struct vl_compositor *compositor, union pipe_color_union *color); /** * get the clear color */ void -vl_compositor_get_clear_color(struct vl_compositor *compositor, float color[4]); +vl_compositor_get_clear_color(struct vl_compositor *compositor, union pipe_color_union *color); /** * set overlay samplers |