properly notify driver on scissor change in MakeCurrent
authorKeith Whitwell <keith@tungstengraphics.com>
Fri, 30 Dec 2005 13:02:27 +0000 (13:02 +0000)
committerKeith Whitwell <keith@tungstengraphics.com>
Fri, 30 Dec 2005 13:02:27 +0000 (13:02 +0000)
src/mesa/main/buffers.c
src/mesa/main/buffers.h
src/mesa/main/context.c

index bfec9b5..89e9203 100644 (file)
@@ -669,20 +669,9 @@ _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 &&
@@ -700,6 +689,24 @@ _mesa_Scissor( GLint x, GLint y, GLsizei width, GLsizei 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);
+}
+
+
 
 /**********************************************************************/
 /** \name Initialization */
index b10d680..547fb28 100644 (file)
@@ -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
index a506326..4101c9f 100644 (file)
@@ -1611,8 +1611,10 @@ _mesa_make_current( GLcontext *newCtx, GLframebuffer *drawBuffer,
             /* 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 );
          }
       }