summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/windows/gdi/wmesa.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/drivers/windows/gdi/wmesa.c')
-rw-r--r--src/mesa/drivers/windows/gdi/wmesa.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/mesa/drivers/windows/gdi/wmesa.c b/src/mesa/drivers/windows/gdi/wmesa.c
index 78e3d9ec8d1..8c3229ab14c 100644
--- a/src/mesa/drivers/windows/gdi/wmesa.c
+++ b/src/mesa/drivers/windows/gdi/wmesa.c
@@ -281,13 +281,13 @@ static void clear_color(GLcontext *ctx, const GLfloat color[4])
* Clearing of the other non-color buffers is left to the swrast.
*/
-static void clear(GLcontext *ctx,
- GLbitfield mask,
- GLboolean all,
- GLint x, GLint y,
- GLint width, GLint height)
+static void clear(GLcontext *ctx, GLbitfield mask)
{
#define FLIP(Y) (ctx->DrawBuffer->Height - (Y) - 1)
+ const GLint x = ctx->DrawBuffer->_Xmin;
+ const GLint y = ctx->DrawBuffer->_Ymin;
+ const GLint height = ctx->DrawBuffer->_Ymax - ctx->DrawBuffer->_Ymin;
+ const GLint width = ctx->DrawBuffer->_Xmax - ctx->DrawBuffer->_Xmin;
WMesaContext pwc = wmesa_context(ctx);
WMesaFramebuffer pwfb = wmesa_framebuffer(ctx->DrawBuffer);
@@ -299,7 +299,7 @@ static void clear(GLcontext *ctx,
ctx->Color.ColorMask[1] != 0xff ||
ctx->Color.ColorMask[2] != 0xff ||
ctx->Color.ColorMask[3] != 0xff) {
- _swrast_Clear(ctx, mask, all, x, y, width, height);
+ _swrast_Clear(ctx, mask);
return;
}
@@ -318,7 +318,8 @@ static void clear(GLcontext *ctx,
/* Try for a fast clear - clearing entire buffer with a single
* byte value. */
- if (all) { /* entire buffer */
+ if (width == ctx->DrawBuffer->Width &&
+ height == ctx->DrawBuffer->Height) { /* entire buffer */
/* Now check for an easy clear value */
switch (bytesPerPixel) {
case 1:
@@ -431,7 +432,7 @@ static void clear(GLcontext *ctx,
/* Call swrast if there is anything left to clear (like DEPTH) */
if (mask)
- _swrast_Clear(ctx, mask, all, x, y, width, height);
+ _swrast_Clear(ctx, mask);
#undef FLIP
}