aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/drivers
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2012-03-13 08:34:09 +0100
committermarha <marha@users.sourceforge.net>2012-03-13 08:34:09 +0100
commit7d894e32566b710952c44cbc71939ad1d9e2fa8d (patch)
tree2c324c18b71f48bcb8bb2c4c35fa0fce1b02a5fb /mesalib/src/mesa/drivers
parent96276c847a5c266f9f51f3ec4ece8fe3f1381c96 (diff)
parentfc72edebf875378459368c5383d9023730cbca54 (diff)
downloadvcxsrv-7d894e32566b710952c44cbc71939ad1d9e2fa8d.tar.gz
vcxsrv-7d894e32566b710952c44cbc71939ad1d9e2fa8d.tar.bz2
vcxsrv-7d894e32566b710952c44cbc71939ad1d9e2fa8d.zip
Merge remote-tracking branch 'origin/released'
Diffstat (limited to 'mesalib/src/mesa/drivers')
-rw-r--r--mesalib/src/mesa/drivers/common/driverfuncs.c3
-rw-r--r--mesalib/src/mesa/drivers/windows/gdi/wmesa.c47
2 files changed, 15 insertions, 35 deletions
diff --git a/mesalib/src/mesa/drivers/common/driverfuncs.c b/mesalib/src/mesa/drivers/common/driverfuncs.c
index 1df838173..ca120578d 100644
--- a/mesalib/src/mesa/drivers/common/driverfuncs.c
+++ b/mesalib/src/mesa/drivers/common/driverfuncs.c
@@ -131,9 +131,6 @@ _mesa_init_driver_functions(struct dd_function_table *driver)
driver->BlendColor = NULL;
driver->BlendEquationSeparate = NULL;
driver->BlendFuncSeparate = NULL;
- driver->ClearColor = NULL;
- driver->ClearDepth = NULL;
- driver->ClearStencil = NULL;
driver->ClipPlane = NULL;
driver->ColorMask = NULL;
driver->ColorMaterial = NULL;
diff --git a/mesalib/src/mesa/drivers/windows/gdi/wmesa.c b/mesalib/src/mesa/drivers/windows/gdi/wmesa.c
index ba11998eb..93da05fe7 100644
--- a/mesalib/src/mesa/drivers/windows/gdi/wmesa.c
+++ b/mesalib/src/mesa/drivers/windows/gdi/wmesa.c
@@ -243,39 +243,9 @@ static void wmesa_flush(struct gl_context *ctx)
/***** CLEAR Functions *****/
/**********************************************************************/
-/* If we do not implement these, Mesa clears the buffers via the pixel
- * span writing interface, which is very slow for a clear operation.
- */
-
-/*
- * Set the color used to clear the color buffer.
- */
-static void clear_color(struct gl_context *ctx,
- const union gl_color_union color)
-{
- WMesaContext pwc = wmesa_context(ctx);
- GLubyte col[3];
-
- 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);
- pwc->clearPen = CreatePen(PS_SOLID, 1, pwc->clearColorRef);
- pwc->clearBrush = CreateSolidBrush(pwc->clearColorRef);
-}
-
-
/*
- * Clear the specified region of the color buffer using the clear color
- * or index as specified by one of the two functions above.
- *
- * This procedure clears either the front and/or the back COLOR buffers.
- * Only the "left" buffer is cleared since we are not stereo.
- * Clearing of the other non-color buffers is left to the swrast.
+ * Clear the color/depth/stencil buffers.
*/
-
static void clear(struct gl_context *ctx, GLbitfield mask)
{
#define FLIP(Y) (ctx->DrawBuffer->Height - (Y) - 1)
@@ -298,6 +268,20 @@ static void clear(struct gl_context *ctx, GLbitfield mask)
return;
}
+ if (mask & BUFFER_BITS_COLOR) {
+ /* setup the clearing color */
+ const union gl_color_union color = ctx->Color.ClearColor;
+ GLubyte col[3];
+ 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);
+ pwc->clearPen = CreatePen(PS_SOLID, 1, pwc->clearColorRef);
+ pwc->clearBrush = CreateSolidBrush(pwc->clearColorRef);
+ }
+
/* Back buffer */
if (mask & BUFFER_BIT_BACK_LEFT) {
@@ -1095,7 +1079,6 @@ WMesaContext WMesaCreateContext(HDC hDC,
functions.GetBufferSize = wmesa_get_buffer_size;
functions.Flush = wmesa_flush;
functions.Clear = clear;
- functions.ClearColor = clear_color;
functions.ResizeBuffers = wmesa_resize_buffers;
functions.Viewport = wmesa_viewport;