pass __DRIdrawablePrivate to intelWindowMoved(), rather than context ptr
authorBrian <brian.paul@tungstengraphics.com>
Sat, 3 Nov 2007 16:35:39 +0000 (10:35 -0600)
committerBrian <brian.paul@tungstengraphics.com>
Mon, 5 Nov 2007 15:04:48 +0000 (08:04 -0700)
src/mesa/drivers/dri/intel_winsys/intel_context.c
src/mesa/drivers/dri/intel_winsys/intel_swapbuffers.c
src/mesa/drivers/dri/intel_winsys/intel_swapbuffers.h

index 2b581a6b0f9425431c6032533e5855afd9df062a..443276cfc0bef9631d7a2e465f2a6a787ec3c8d0 100644 (file)
@@ -232,7 +232,7 @@ intelMakeCurrent(__DRIcontextPrivate * driContextPriv,
       if ((intel->driDrawable != driDrawPriv) ||
          (intel->lastStamp != driDrawPriv->lastStamp)) {
          intel->driDrawable = driDrawPriv;
-         intelWindowMoved(intel);
+         intelWindowMoved(driDrawPriv);
          intel->lastStamp = driDrawPriv->lastStamp;
       }
 
@@ -241,7 +241,7 @@ intelMakeCurrent(__DRIcontextPrivate * driContextPriv,
        * If the readbuffer is a different window, check/update its size now.
        */
       if (driReadPriv != driDrawPriv) {
-         st_resize_framebuffer(read_fb, driReadPriv->w, driReadPriv->h);
+         intelWindowMoved(driReadPriv);
       }
 #endif
 
index 5d04815da85ac09c04deb2c40b0e31eaf217bc81..2db3a29db2df42aa1b616b694b355ef9aefaa232 100644 (file)
@@ -222,16 +222,10 @@ intelDisplaySurface(__DRIdrawablePrivate * dPriv,
 
    UNLOCK_HARDWARE(intel);
 
-   /* XXX this is bogus. The context here may not even be bound to this drawable! */
    if (intel->lastStamp != dPriv->lastStamp) {
-      GET_CURRENT_CONTEXT(currctx);
-      struct intel_context *intelcurrent = intel_context(currctx);
-      if (intelcurrent == intel && intelcurrent->driDrawable == dPriv) {
-         intelWindowMoved(intel);
-         intel->lastStamp = dPriv->lastStamp;
-      }
+      intelWindowMoved(dPriv);
+      intel->lastStamp = dPriv->lastStamp;
    }
-
 }
 
 
@@ -240,12 +234,10 @@ intelDisplaySurface(__DRIdrawablePrivate * dPriv,
  * This will be called whenever the currently bound window is moved/resized.
  */
 void
-intelWindowMoved(struct intel_context *intel)
+intelWindowMoved(__DRIdrawablePrivate *dPriv)
 {
-   __DRIdrawablePrivate *dPriv = intel->driDrawable;
    struct st_framebuffer *stfb
       = (struct st_framebuffer *) dPriv->driverPrivate;
-
    st_resize_framebuffer(stfb, dPriv->w, dPriv->h);
 }
 
index 8d77ffce8560041733c455e0d5196d929540de6a..7bea6e6d40c9434930e13e2540c587a00971b847 100644 (file)
@@ -46,6 +46,7 @@ extern void intelDisplaySurface(__DRIdrawablePrivate * dPriv,
 
 extern void intelSwapBuffers(__DRIdrawablePrivate * dPriv);
 
-extern void intelWindowMoved(struct intel_context *intel);
+extern void intelWindowMoved(__DRIdrawablePrivate *dPriv);
+
 
 #endif /* INTEL_BUFFERS_H */