gallium: Do not mix winsys-drawable-handle and context-private.
authorChia-I Wu <olv@lunarg.com>
Wed, 10 Mar 2010 14:20:15 +0000 (22:20 +0800)
committerChia-I Wu <olv@lunarg.com>
Wed, 10 Mar 2010 14:21:08 +0000 (22:21 +0800)
update_buffer should be called with context-private, not
winsys-drawable-handle.

src/gallium/include/pipe/p_screen.h
src/gallium/state_trackers/vega/vg_tracker.c
src/mesa/state_tracker/st_cb_flush.c
src/mesa/state_tracker/st_context.c
src/mesa/state_tracker/st_context.h

index 690455f7222b32ba2190cbf206ce398930107821..b771bfe85eccbb2c1766bf8922069d9088309a99 100644 (file)
@@ -265,6 +265,7 @@ struct pipe_screen {
 
    /**
     * Do any special operations to ensure buffer size is correct
+    * \param context_private  the private data of the calling context
     */
    void (*update_buffer)( struct pipe_screen *ws,
                           void *context_private );
@@ -272,10 +273,12 @@ struct pipe_screen {
    /**
     * Do any special operations to ensure frontbuffer contents are
     * displayed, eg copy fake frontbuffer.
+    * \param winsys_drawable_handle  an opaque handle that the calling context
+    *                                gets out-of-band
     */
    void (*flush_frontbuffer)( struct pipe_screen *screen,
                               struct pipe_surface *surf,
-                              void *context_private );
+                              void *winsys_drawable_handle );
 
 
 
index a002e50faf7ed11b3e3ec68d269d80fd17916329..ea5c2ce41f6f2df40d284fd86ec79b93fc5ad74e 100644 (file)
@@ -380,16 +380,8 @@ boolean st_make_current(struct vg_context *st,
                         void *winsys_drawable_handle)
 {
    vg_set_current_context(st);
-   if (st) {
+   if (st)
       st->draw_buffer = draw;
-
-      /* VG state tracker doesn't seem to do front-buffer rendering
-       * (no calls to flush_frontbuffer).  If it ever did start doing
-       * that, it would need to pass this value down in the
-       * flush_frontbuffer call:
-       */
-      st->pipe->priv = winsys_drawable_handle;
-   }
    return VG_TRUE;
 }
 
index 1329f807bc9a43a81e53992478bf2b9a8df48ddd..28a384ba49b6450a0117fe7b57113f8a8009ed26 100644 (file)
@@ -79,7 +79,7 @@ display_front_buffer(struct st_context *st)
       /* Hook for copying "fake" frontbuffer if necessary:
        */
       st->pipe->screen->flush_frontbuffer( st->pipe->screen, front_surf,
-                                           st->pipe->priv );
+                                           st->winsys_drawable_handle );
 
       /*
         st->frontbuffer_status = FRONT_STATUS_UNDEFINED;
index 09f891d691a1b297664726135f4be903e1a6e3a8..ca6d4dfb069fcc3013aa343803c2cb0801c7fddc 100644 (file)
@@ -287,7 +287,7 @@ st_make_current(struct st_context *st,
       }
 
       _mesa_check_init_viewport(st->ctx, draw->InitWidth, draw->InitHeight);
-      st->pipe->priv = winsys_drawable_handle;
+      st->winsys_drawable_handle = winsys_drawable_handle;
 
       return GL_TRUE;
    }
index 6622361a7e3e56c3270ebd8807eb380b1073b9bc..e2d34fb3d1015adb39ae02e228ec0ef387257c92 100644 (file)
@@ -185,6 +185,7 @@ struct st_context
    struct cso_context *cso_context;
 
    int force_msaa;
+   void *winsys_drawable_handle;
 };