aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/drivers/dri/swrast/swrast.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2013-12-22 13:12:15 +0100
committermarha <marha@users.sourceforge.net>2013-12-22 13:16:58 +0100
commit1d03b6f684ab1ea6772f00058605a9ebb2910628 (patch)
tree8b393bd59900eba6aa9010cab9e714922cac2536 /mesalib/src/mesa/drivers/dri/swrast/swrast.c
parent5567cf1befbda64f2dc6fae1d337567cd984b46e (diff)
parentc81020559f329a516191927222b3698ba7370aca (diff)
downloadvcxsrv-1d03b6f684ab1ea6772f00058605a9ebb2910628.tar.gz
vcxsrv-1d03b6f684ab1ea6772f00058605a9ebb2910628.tar.bz2
vcxsrv-1d03b6f684ab1ea6772f00058605a9ebb2910628.zip
Merge remote-tracking branch 'origin/released'
* origin/released: libxtrans fontconfig glproto libX11 libxcb xcbproto mesa xserver pixman xkeyboard-config git update 22 Dec 2013 Conflicts: mesalib/include/GL/glext.h mesalib/src/mesa/drivers/dri/common/dri_util.c mesalib/src/mesa/drivers/dri/swrast/swrast.c xorg-server/damageext/damageext.c xorg-server/dix/dispatch.c xorg-server/glx/glxdriswrast.c xorg-server/glx/indirect_dispatch.c xorg-server/glx/indirect_dispatch_swap.c xorg-server/glx/indirect_program.c xorg-server/glx/render2.c xorg-server/glx/render2swap.c xorg-server/hw/xwin/glx/gen_gl_wrappers.py xorg-server/hw/xwin/glx/glthunk.c xorg-server/hw/xwin/glx/indirect.c xorg-server/include/os.h xorg-server/present/present_request.c
Diffstat (limited to 'mesalib/src/mesa/drivers/dri/swrast/swrast.c')
-rw-r--r--[-rwxr-xr-x]mesalib/src/mesa/drivers/dri/swrast/swrast.c39
1 files changed, 38 insertions, 1 deletions
diff --git a/mesalib/src/mesa/drivers/dri/swrast/swrast.c b/mesalib/src/mesa/drivers/dri/swrast/swrast.c
index d0ca80fa7..1848da5d9 100755..100644
--- a/mesalib/src/mesa/drivers/dri/swrast/swrast.c
+++ b/mesalib/src/mesa/drivers/dri/swrast/swrast.c
@@ -407,7 +407,7 @@ swrast_map_renderbuffer(struct gl_context *ctx,
stride = w * cpp;
xrb->Base.Buffer = (GLubyte*)malloc(h * stride);
- sPriv->swrast_loader->getImage(dPriv, x, y, w, h,
+ sPriv->swrast_loader->getImage(dPriv, x, rb->Height - y - h, w, h,
(char *) xrb->Base.Buffer,
dPriv->loaderPrivate);
@@ -710,6 +710,8 @@ dri_create_context(gl_api api,
goto context_fail;
}
+ driContextSetFlags(mesaCtx, flags);
+
/* do bounds checking to prevent segfaults and server crashes! */
mesaCtx->Const.CheckArrayBounds = GL_TRUE;
@@ -825,6 +827,39 @@ dri_unbind_context(__DRIcontext * cPriv)
return GL_TRUE;
}
+static void
+dri_copy_sub_buffer(__DRIdrawable *dPriv, int x, int y,
+ int w, int h)
+{
+ __DRIscreen *sPriv = dPriv->driScreenPriv;
+ void *data;
+ int iy;
+ struct dri_drawable *drawable = dri_drawable(dPriv);
+ struct gl_framebuffer *fb;
+ struct dri_swrast_renderbuffer *frontrb, *backrb;
+
+ TRACE;
+
+ fb = &drawable->Base;
+
+ frontrb =
+ dri_swrast_renderbuffer(fb->Attachment[BUFFER_FRONT_LEFT].Renderbuffer);
+ backrb =
+ dri_swrast_renderbuffer(fb->Attachment[BUFFER_BACK_LEFT].Renderbuffer);
+
+ /* check for signle-buffered */
+ if (backrb == NULL)
+ return;
+
+ iy = frontrb->Base.Base.Height - y - h;
+ data = (char *)backrb->Base.Buffer + (iy * backrb->pitch) + (x * ((backrb->bpp + 7) / 8));
+ sPriv->swrast_loader->putImage2(dPriv, __DRI_SWRAST_IMAGE_OP_SWAP,
+ x, iy, w, h,
+ frontrb->pitch,
+ data,
+ dPriv->loaderPrivate);
+}
+
static const struct __DriverAPIRec swrast_driver_api = {
/*.InitScreen = */dri_init_screen,
@@ -836,6 +871,7 @@ static const struct __DriverAPIRec swrast_driver_api = {
/*.SwapBuffers = */dri_swap_buffers,
/*.MakeCurrent = */dri_make_current,
/*.UnbindContext = */dri_unbind_context,
+ /*.CopySubBuffer = */dri_copy_sub_buffer,
/*.AllocateBuffer = */NULL,
/*.ReleaseBuffer = */NULL
};
@@ -848,6 +884,7 @@ static const struct __DRIDriverVtableExtensionRec swrast_vtable = {
static const __DRIextension *swrast_driver_extensions[] = {
&driCoreExtension.base,
&driSWRastExtension.base,
+ &driCopySubBufferExtension.base,
&swrast_vtable.base,
NULL
};