Merge branch 'master' of git+ssh://joukj@git.freedesktop.org/git/mesa/mesa
[mesa.git] / src / mesa / drivers / dri / r200 / r200_context.c
index a1533d7f3e42c156f2830c1b3a54505bcc5078f0..5a178442bdb7bb2a494a1d3a9e3876a7c624c4ee 100644 (file)
@@ -1,4 +1,3 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_context.c,v 1.3 2003/05/06 23:52:08 daenzer Exp $ */
 /*
 Copyright (C) The Weather Channel, Inc.  2002.  All Rights Reserved.
 
@@ -86,21 +85,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 int R200_DEBUG = (0);
 #endif
 
-
-/* Return the width and height of the given buffer.
- */
-static void r200GetBufferSize( GLframebuffer *buffer,
-                              GLuint *width, GLuint *height )
-{
-   GET_CURRENT_CONTEXT(ctx);
-   r200ContextPtr rmesa = R200_CONTEXT(ctx);
-
-   LOCK_HARDWARE( rmesa );
-   *width  = rmesa->dri.drawable->w;
-   *height = rmesa->dri.drawable->h;
-   UNLOCK_HARDWARE( rmesa );
-}
-
 /* Return various strings for glGetString().
  */
 static const GLubyte *r200GetString( GLcontext *ctx, GLenum name )
@@ -207,7 +191,6 @@ static const struct tnl_pipeline_stage *r200_pipeline[] = {
    &_tnl_texgen_stage,
    &_tnl_texture_transform_stage,
    &_tnl_point_attenuation_stage,
-   &_tnl_arb_vertex_program_stage,
    &_tnl_vertex_program_stage,
    /* Try again to go to tcl? 
     *     - no good for asymmetric-twoside (do with multipass)
@@ -232,12 +215,8 @@ static const struct tnl_pipeline_stage *r200_pipeline[] = {
  */
 static void r200InitDriverFuncs( struct dd_function_table *functions )
 {
-    functions->GetBufferSize           = r200GetBufferSize;
+    functions->GetBufferSize           = NULL; /* OBSOLETE */
     functions->GetString               = r200GetString;
-
-    functions->Error                   = NULL;
-    functions->DrawPixels              = NULL;
-    functions->Bitmap                  = NULL;
 }
 
 static const struct dri_debug_control debug_control[] =
@@ -690,8 +669,15 @@ r200MakeCurrent( __DRIcontextPrivate *driContextPriv,
       if ( newCtx->dri.drawable != driDrawPriv ) {
         driDrawableInitVBlank( driDrawPriv, newCtx->vblank_flags,
                                &newCtx->vbl_seq );
+      }
+
+      newCtx->dri.readable = driReadPriv;
+
+      if ( newCtx->dri.drawable != driDrawPriv ||
+           newCtx->lastStamp != driDrawPriv->lastStamp ) {
         newCtx->dri.drawable = driDrawPriv;
-        r200UpdateWindow( newCtx->glCtx );
+
+        r200SetCliprects(newCtx);
         r200UpdateViewportOffset( newCtx->glCtx );
       }