Get DRI drawable from framebuffer object.
authorIan Romanick <idr@us.ibm.com>
Mon, 30 Oct 2006 22:07:00 +0000 (22:07 +0000)
committerIan Romanick <idr@us.ibm.com>
Mon, 30 Oct 2006 22:07:00 +0000 (22:07 +0000)
In the software rasterization fallbacks, get the __DRIdrawablePrivate
pointer from the driRenderbuffer that is passed in.  This eliminates
the need for the mesa_drawable pointer in MGA context structure.

This partially fixes bug #8799.  wincopy no longer produces a black
window for the destination window, but it does produce incorrect
results if the destination window is resized.

src/mesa/drivers/dri/mga/mga_xmesa.c
src/mesa/drivers/dri/mga/mgacontext.h
src/mesa/drivers/dri/mga/mgaspan.c

index 73bcfcce738c465c7882a349728a9652a9b5f7a8..f02913c6af25f98b26c302f480683f8d1324397d 100644 (file)
@@ -883,7 +883,6 @@ mgaMakeCurrent(__DRIcontextPrivate *driContextPriv,
         mmesa->driDrawable = driDrawPriv;
         mmesa->dirty = ~0; 
         mmesa->dirty_cliprects = (MGA_FRONT|MGA_BACK); 
-        mmesa->mesa_drawable = driDrawPriv;
       }
 
       mmesa->driReadable = driReadPriv;
index 81348b6c7f9169562bc407dc111f304f9c24c51a..2124006ade600b7b6d470aaa6487d864c7270139 100644 (file)
@@ -303,13 +303,6 @@ struct mga_context_t {
    __DRIdrawablePrivate *driDrawable;
    __DRIdrawablePrivate *driReadable;
 
-   /**
-    * Drawable used by Mesa for software fallbacks for reading and
-    * writing.  It is set by Mesa's \c SetBuffer callback, and will always be
-    * either \c mga_context_t::driDrawable or \c mga_context_t::driReadable.
-    */
-   __DRIdrawablePrivate *mesa_drawable;
-
    __DRIscreenPrivate *driScreen;
    struct mga_screen_private_s *mgaScreen;
    drm_mga_sarea_t *sarea;
index dbc7fc884ceabae2da95ee753475424086c09f8b..05dcbb852639efbcbc94043d7fad8cc915dd2932 100644 (file)
@@ -36,9 +36,9 @@
 
 #define LOCAL_VARS                                     \
    mgaContextPtr mmesa = MGA_CONTEXT(ctx);             \
-   __DRIdrawablePrivate *dPriv = mmesa->mesa_drawable; \
    __DRIscreenPrivate *sPriv = mmesa->driScreen;       \
    driRenderbuffer *drb = (driRenderbuffer *) rb;      \
+   const __DRIdrawablePrivate *dPriv = drb->dPriv;     \
    GLuint pitch = drb->pitch;                          \
    GLuint height = dPriv->h;                           \
    char *buf = (char *)(sPriv->pFB +                   \
@@ -52,9 +52,9 @@
 
 #define LOCAL_DEPTH_VARS                                               \
    mgaContextPtr mmesa = MGA_CONTEXT(ctx);                             \
-   __DRIdrawablePrivate *dPriv = mmesa->mesa_drawable;                 \
    __DRIscreenPrivate *sPriv = mmesa->driScreen;                       \
    driRenderbuffer *drb = (driRenderbuffer *) rb;                      \
+   const __DRIdrawablePrivate *dPriv = drb->dPriv;                     \
    GLuint pitch = drb->pitch;                                          \
    GLuint height = dPriv->h;                                           \
    char *buf = (char *)(sPriv->pFB +                                   \