+
+ tex_xfer = pipe_get_transfer(pipe, res,
+ 0, 0, // level, layer
+ PIPE_TRANSFER_WRITE,
+ x, y,
+ w, h);
+
+
+ map = pipe_transfer_map(pipe, tex_xfer);
+
+ /* Copy the Drawable content to the mapped texture buffer */
+ sPriv->swrast_loader->getImage(dPriv, x, y, w, h, map,
+ dPriv->loaderPrivate);
+
+ /* The pipe transfer has a pitch rounded up to the nearest 64 pixels.
+ We assume 32 bit pixels. */
+ ximage_stride = w * 4;
+ for (line = h-1; line; --line) {
+ memmove(&map[line * tex_xfer->stride], &map[line * ximage_stride], ximage_stride);
+ }
+
+ pipe_transfer_unmap(pipe, tex_xfer);
+
+ pipe_transfer_destroy(pipe, tex_xfer);
+