Remove get_buffer_size()
authorBrian Paul <brian.paul@tungstengraphics.com>
Tue, 17 Oct 2006 17:51:39 +0000 (17:51 +0000)
committerBrian Paul <brian.paul@tungstengraphics.com>
Tue, 17 Oct 2006 17:51:39 +0000 (17:51 +0000)
Always check window size in XMesaMakeCurrent() in case glViewport is not
called.

src/mesa/drivers/x11/xm_api.c
src/mesa/drivers/x11/xm_dd.c

index 6aa8dc5d7d33c54c928f3100d9805116a8005a30..b50c4757afc8c94ae5dc8f408b5bdaa8736c8cb9 100644 (file)
@@ -1890,7 +1890,7 @@ xmesa_check_and_update_buffer_size(XMesaContext xmctx, XMesaBuffer drawBuffer)
       _mesa_resize_framebuffer(&(xmctx->mesa),
                                &(drawBuffer->mesa_buffer), width, height);
    }
-   drawBuffer->mesa_buffer.Initialized = GL_TRUE;
+   drawBuffer->mesa_buffer.Initialized = GL_TRUE; /* XXX TEMPORARY? */
 }
 
 
@@ -1937,10 +1937,8 @@ GLboolean XMesaMakeCurrent2( XMesaContext c, XMesaBuffer drawBuffer,
        */
       _glapi_check_multithread();
 
-      if (!drawBuffer->mesa_buffer.Initialized)
-         xmesa_check_and_update_buffer_size(c, drawBuffer);
-
-      if (!readBuffer->mesa_buffer.Initialized)
+      xmesa_check_and_update_buffer_size(c, drawBuffer);
+      if (readBuffer != drawBuffer)
          xmesa_check_and_update_buffer_size(c, readBuffer);
 
       _mesa_make_current(&(c->mesa),
index df2fc48e93b60fa45227b372e2f70a9fbc0d6df5..76195e17e47c5fa90b689a916371808d932b139e 100644 (file)
@@ -94,15 +94,6 @@ const int xmesa_kernel1[16] = {
 };
 
 
-/** XXX obsolete ***/
-static void
-get_buffer_size( GLframebuffer *buffer, GLuint *width, GLuint *height )
-{
-   XMesaBuffer b = XMESA_BUFFER(buffer);
-   xmesa_get_window_size(b->display, b, width, height);
-}
-
-
 static void
 finish_or_flush( GLcontext *ctx )
 {
@@ -1176,7 +1167,7 @@ xmesa_init_driver_functions( XMesaVisual xmvisual,
 {
    driver->GetString = get_string;
    driver->UpdateState = xmesa_update_state;
-   driver->GetBufferSize = get_buffer_size;
+   driver->GetBufferSize = NULL; /* OBSOLETE */
    driver->Flush = finish_or_flush;
    driver->Finish = finish_or_flush;
    driver->ClearIndex = clear_index;