summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/windows
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2011-09-12 10:57:40 +0100
committerDave Airlie <airlied@redhat.com>2011-09-14 11:18:07 +0100
commit093dc9e548537e6c77e33064a584f849ad90dfa5 (patch)
tree4a3ecd84f123cd89a29fea6700603a5da53d62cb /src/mesa/drivers/windows
parentb06613c6cc029c3ff200430b0706b5229c4508bd (diff)
downloadexternal_mesa3d-093dc9e548537e6c77e33064a584f849ad90dfa5.zip
external_mesa3d-093dc9e548537e6c77e33064a584f849ad90dfa5.tar.gz
external_mesa3d-093dc9e548537e6c77e33064a584f849ad90dfa5.tar.bz2
mesa: introduce a clear color union to be used for int/unsigned buffers
This introduces a new gl_color_union union and moves the current ClearColorUnclamped to use it, it removes current ClearColor completely and renames CCU to CC, then all drivers are modified to expected unclamped floats instead. also fixes st to use translated color in one place it wasn't. Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'src/mesa/drivers/windows')
-rw-r--r--src/mesa/drivers/windows/gdi/wmesa.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/mesa/drivers/windows/gdi/wmesa.c b/src/mesa/drivers/windows/gdi/wmesa.c
index 35a150d..14d15ed 100644
--- a/src/mesa/drivers/windows/gdi/wmesa.c
+++ b/src/mesa/drivers/windows/gdi/wmesa.c
@@ -249,14 +249,15 @@ static void wmesa_flush(struct gl_context *ctx)
/*
* Set the color used to clear the color buffer.
*/
-static void clear_color(struct gl_context *ctx, const GLfloat color[4])
+static void clear_color(struct gl_context *ctx,
+ const union gl_color_union color)
{
WMesaContext pwc = wmesa_context(ctx);
GLubyte col[3];
- CLAMPED_FLOAT_TO_UBYTE(col[0], color[0]);
- CLAMPED_FLOAT_TO_UBYTE(col[1], color[1]);
- CLAMPED_FLOAT_TO_UBYTE(col[2], color[2]);
+ UNCLAMPED_FLOAT_TO_UBYTE(col[0], color.f[0]);
+ UNCLAMPED_FLOAT_TO_UBYTE(col[1], color.f[1]);
+ UNCLAMPED_FLOAT_TO_UBYTE(col[2], color.f[2]);
pwc->clearColorRef = RGB(col[0], col[1], col[2]);
DeleteObject(pwc->clearPen);
DeleteObject(pwc->clearBrush);