g3dvl: Grab surface pointer when flushing front buffer in SP winsys.
authorYounes Manton <younes.m@gmail.com>
Wed, 25 Feb 2009 20:09:20 +0000 (15:09 -0500)
committerYounes Manton <younes.m@gmail.com>
Mon, 2 Mar 2009 18:05:05 +0000 (13:05 -0500)
src/gallium/winsys/g3dvl/xsp_winsys.c

index acfb8ec4ea2f7d8ca76d32296e51062f94736bd6..c4623e82f90e34b16004053104385f7417607e29 100644 (file)
@@ -6,6 +6,7 @@
 #include <util/u_memory.h>
 #include <util/u_math.h>
 #include <softpipe/sp_winsys.h>
+#include <softpipe/sp_texture.h>
 
 /* pipe_winsys implementation */
 
@@ -162,7 +163,7 @@ static void xsp_flush_frontbuffer(struct pipe_winsys *pws, struct pipe_surface *
        xsp_winsys->fbimage.width = surface->width;
        xsp_winsys->fbimage.height = surface->height;
        xsp_winsys->fbimage.bytes_per_line = surface->width * (xsp_winsys->fbimage.bits_per_pixel >> 3);
-       xsp_winsys->fbimage.data = pipe_surface_map(surface, 0);
+       xsp_winsys->fbimage.data = ((struct xsp_buffer *)softpipe_texture(surface->texture)->buffer)->data + surface->offset;
 
        XPutImage
        (
@@ -178,7 +179,6 @@ static void xsp_flush_frontbuffer(struct pipe_winsys *pws, struct pipe_surface *
                surface->height
        );
        XFlush(xsp_context->display);
-       pipe_surface_unmap(surface);
 }
 
 static const char* xsp_get_name(struct pipe_winsys *pws)