summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2006-03-29 18:38:54 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>2006-03-29 18:38:54 +0000
commit26b6e4e77d5f07484c2e7f98a0dc8c278d8e5f97 (patch)
treee58e97ce89efc1622d744ddce6b9cd048610d1ef
parent95119e90a9cc6b4fae5eb9b9c080abf4ed4b7f11 (diff)
Dave Reveman's scissor fix (bug 6222)
-rw-r--r--src/mesa/main/buffers.c36
-rw-r--r--src/mesa/main/buffers.h3
-rw-r--r--src/mesa/main/context.c3
3 files changed, 26 insertions, 16 deletions
diff --git a/src/mesa/main/buffers.c b/src/mesa/main/buffers.c
index 58435e0ede..e266453814 100644
--- a/src/mesa/main/buffers.c
+++ b/src/mesa/main/buffers.c
@@ -653,20 +653,10 @@ _mesa_SampleCoverageARB(GLclampf value, GLboolean invert)
* change flushes the vertices and notifies the driver via
* the dd_function_table::Scissor callback.
*/
-void GLAPIENTRY
-_mesa_Scissor( GLint x, GLint y, GLsizei width, GLsizei height )
+void
+_mesa_set_scissor(GLcontext *ctx,
+ GLint x, GLint y, GLsizei width, GLsizei height)
{
- GET_CURRENT_CONTEXT(ctx);
- ASSERT_OUTSIDE_BEGIN_END(ctx);
-
- if (width < 0 || height < 0) {
- _mesa_error( ctx, GL_INVALID_VALUE, "glScissor" );
- return;
- }
-
- if (MESA_VERBOSE & VERBOSE_API)
- _mesa_debug(ctx, "glScissor %d %d %d %d\n", x, y, width, height);
-
if (x == ctx->Scissor.X &&
y == ctx->Scissor.Y &&
width == ctx->Scissor.Width &&
@@ -680,7 +670,25 @@ _mesa_Scissor( GLint x, GLint y, GLsizei width, GLsizei height )
ctx->Scissor.Height = height;
if (ctx->Driver.Scissor)
- ctx->Driver.Scissor( ctx, x, y, width, height );
+ ctx->Driver.Scissor(ctx, x, y, width, height);
+}
+
+
+void GLAPIENTRY
+_mesa_Scissor( GLint x, GLint y, GLsizei width, GLsizei height )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ ASSERT_OUTSIDE_BEGIN_END(ctx);
+
+ if (width < 0 || height < 0) {
+ _mesa_error( ctx, GL_INVALID_VALUE, "glScissor" );
+ return;
+ }
+
+ if (MESA_VERBOSE & VERBOSE_API)
+ _mesa_debug(ctx, "glScissor %d %d %d %d\n", x, y, width, height);
+
+ _mesa_set_scissor(ctx, x, y, width, height);
}
diff --git a/src/mesa/main/buffers.h b/src/mesa/main/buffers.h
index 0c7f68ee79..a3e59c1329 100644
--- a/src/mesa/main/buffers.h
+++ b/src/mesa/main/buffers.h
@@ -74,5 +74,8 @@ _mesa_init_scissor(GLcontext *ctx);
extern void
_mesa_init_multisample(GLcontext *ctx);
+extern void
+_mesa_set_scissor(GLcontext *ctx,
+ GLint x, GLint y, GLsizei width, GLsizei height);
#endif
diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c
index 3baad5dba6..97018d7d27 100644
--- a/src/mesa/main/context.c
+++ b/src/mesa/main/context.c
@@ -1588,8 +1588,7 @@ _mesa_make_current( GLcontext *newCtx, GLframebuffer *drawBuffer,
if (newCtx->FirstTimeCurrent) {
/* set initial viewport and scissor size now */
_mesa_set_viewport(newCtx, 0, 0, drawBuffer->Width, drawBuffer->Height);
- newCtx->Scissor.Width = drawBuffer->Width;
- newCtx->Scissor.Height = drawBuffer->Height;
+ _mesa_set_scissor(newCtx, 0, 0, drawBuffer->Width, drawBuffer->Height );
}
}