gallium: remove xlib_driver::display_surface
authorKeith Whitwell <keithw@vmware.com>
Mon, 8 Mar 2010 19:23:10 +0000 (19:23 +0000)
committerKeith Whitwell <keithw@vmware.com>
Mon, 8 Mar 2010 19:23:10 +0000 (19:23 +0000)
Just use flush_frontbuffer directly.  The flush_frontbuffer routine has
been somewhat devalued recently, but it is actually just the right
interface for our needs.

It is in pipe_screen, meaning that any wrapping (eg trace module)
will get properly unwrapped before we try and use the pipe_surface
argument for real.

If a particular co-state-tracker needs to implement this itself, it
should organize a way to allow the winsys to call back up to its
level, rather than hijacking the driver-supplied implementation.

src/gallium/include/state_tracker/xlib_sw_winsys.h
src/gallium/state_trackers/glx/xlib/xm_api.c
src/gallium/winsys/xlib/xlib_llvmpipe.c
src/gallium/winsys/xlib/xlib_softpipe.c

index c703d3b66ca2cecc33af3c5680479977c5382137..915a7b37fb5a03504ad036ec625085ed85682700 100644 (file)
@@ -22,9 +22,6 @@ struct xlib_drawable {
 
 struct xm_driver {
    struct pipe_screen *(*create_pipe_screen)( Display *display );
-
-   void (*display_surface)( struct xlib_drawable *, 
-                            struct pipe_surface * );
 };
 
 /* Called by the libgl-xlib target code to build the rendering stack.
index d878740ab12a99256bd4ef2f54da51bfc5f0650b..d8aa59b3b7cde7672efd31981d8482fb753b3a66 100644 (file)
@@ -1092,13 +1092,9 @@ void XMesaSwapBuffers( XMesaBuffer b )
    st_swapbuffers(b->stfb, &frontLeftSurf, NULL);
 
    if (frontLeftSurf) {
-      if (_screen != screen) {
-         struct trace_surface *tr_surf = trace_surface( frontLeftSurf );
-         struct pipe_surface *surf = tr_surf->surface;
-         frontLeftSurf = surf;
-      }
-
-      driver.display_surface(&b->ws, frontLeftSurf);
+      screen->flush_frontbuffer( screen,
+                                 frontLeftSurf, 
+                                 &b->ws );
    }
 
    xmesa_check_and_update_buffer_size(NULL, b);
index ceefc1624cce3bf1ee6dc1095c5e8002465e6836..8b66b7459d9f8327361469b79195d9c0490c468b 100644 (file)
@@ -69,22 +69,9 @@ fail:
 }
 
 
-static void
-xlib_llvmpipe_display_surface(struct xlib_drawable *xm_buffer,
-                              struct pipe_surface *surf)
-{
-   struct llvmpipe_texture *texture = llvmpipe_texture(surf->texture);
-
-   assert(texture->dt);
-   if (texture->dt)
-      xlib_sw_display(xm_buffer, texture->dt);
-}
-
-
 struct xm_driver xlib_llvmpipe_driver = 
 {
    .create_pipe_screen = xlib_create_llvmpipe_screen,
-   .display_surface = xlib_llvmpipe_display_surface
 };
 
 
index 3b51d7c17c4ffb08c526fc1581cac22111376e49..08b7f08837f7a98c46e80659c1f46d02ffe69587 100644 (file)
@@ -57,22 +57,11 @@ fail:
 }
 
 
-static void
-xlib_softpipe_display_surface(struct xlib_drawable *xm_buffer,
-                              struct pipe_surface *surf)
-{
-   struct softpipe_texture *texture = softpipe_texture(surf->texture);
-
-   assert(texture->dt);
-   if (texture->dt)
-      xlib_sw_display(xm_buffer, texture->dt);
-}
 
 
 struct xm_driver xlib_softpipe_driver = 
 {
    .create_pipe_screen = xlib_create_softpipe_screen,
-   .display_surface = xlib_softpipe_display_surface
 };