aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/hw/xfree86/dri2/dri2.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2011-12-23 11:12:22 +0100
committermarha <marha@users.sourceforge.net>2011-12-23 11:12:22 +0100
commit6f6a4d4a600eabf5d6a624eb5b0e98ee67afb52d (patch)
tree8dc28411ab42ebb9183bc090c10024a39fc669d6 /xorg-server/hw/xfree86/dri2/dri2.c
parent22891980a76b862bfcda406521b454f072090fb8 (diff)
parente22891346b85a7db40dec7260a100f90b451cbc8 (diff)
downloadvcxsrv-6f6a4d4a600eabf5d6a624eb5b0e98ee67afb52d.tar.gz
vcxsrv-6f6a4d4a600eabf5d6a624eb5b0e98ee67afb52d.tar.bz2
vcxsrv-6f6a4d4a600eabf5d6a624eb5b0e98ee67afb52d.zip
Merge remote-tracking branch 'origin/released'
Conflicts: xorg-server/glx/dispatch.h xorg-server/glx/glapi.c xorg-server/glx/indirect_dispatch.h xorg-server/glx/indirect_reqsize.c xorg-server/glx/indirect_reqsize.h xorg-server/glx/indirect_size.h xorg-server/glx/indirect_size_get.c xorg-server/glx/indirect_size_get.h xorg-server/glx/indirect_table.c xorg-server/mi/mieq.c
Diffstat (limited to 'xorg-server/hw/xfree86/dri2/dri2.c')
-rw-r--r--xorg-server/hw/xfree86/dri2/dri2.c36
1 files changed, 34 insertions, 2 deletions
diff --git a/xorg-server/hw/xfree86/dri2/dri2.c b/xorg-server/hw/xfree86/dri2/dri2.c
index 0d613be8e..d6441a234 100644
--- a/xorg-server/hw/xfree86/dri2/dri2.c
+++ b/xorg-server/hw/xfree86/dri2/dri2.c
@@ -181,6 +181,7 @@ DRI2AllocateDrawable(DrawablePtr pDraw)
pPriv->last_swap_ust = 0;
list_init(&pPriv->reference_list);
pPriv->serialNumber = DRI2DrawableSerial(pDraw);
+ pPriv->needInvalidate = FALSE;
if (pDraw->type == DRAWABLE_WINDOW) {
pWin = (WindowPtr) pDraw;
@@ -376,6 +377,7 @@ allocate_or_reuse_buffer(DrawablePtr pDraw, DRI2ScreenPtr ds,
int old_buf = find_attachment(pPriv, attachment);
if ((old_buf < 0)
+ || attachment == DRI2BufferFrontLeft
|| !dimensions_match
|| (pPriv->buffers[old_buf]->format != format)) {
*buffer = (*ds->CreateBuffer)(pDraw, attachment, format);
@@ -585,7 +587,7 @@ DRI2InvalidateDrawable(DrawablePtr pDraw)
pPriv->needInvalidate = FALSE;
list_for_each_entry(ref, &pPriv->reference_list, link)
- ref->invalidate(pDraw, ref->priv);
+ ref->invalidate(pDraw, ref->priv, ref->id);
}
/*
@@ -828,6 +830,19 @@ DRI2WaitSwap(ClientPtr client, DrawablePtr pDrawable)
return FALSE;
}
+/*
+ * A TraverseTree callback to invalidate all windows using the same
+ * pixmap
+ */
+static int
+DRI2InvalidateWalk(WindowPtr pWin, pointer data)
+{
+ if (pWin->drawable.pScreen->GetWindowPixmap(pWin) != data)
+ return WT_DONTWALKCHILDREN;
+ DRI2InvalidateDrawable(&pWin->drawable);
+ return WT_WALKCHILDREN;
+}
+
int
DRI2SwapBuffers(ClientPtr client, DrawablePtr pDraw, CARD64 target_msc,
CARD64 divisor, CARD64 remainder, CARD64 *swap_target,
@@ -928,7 +943,24 @@ DRI2SwapBuffers(ClientPtr client, DrawablePtr pDraw, CARD64 target_msc,
*/
*swap_target = pPriv->swap_count + pPriv->swapsPending;
- DRI2InvalidateDrawable(pDraw);
+ if (pDraw->type == DRAWABLE_WINDOW) {
+ WindowPtr pWin = (WindowPtr) pDraw;
+ PixmapPtr pPixmap = pScreen->GetWindowPixmap(pWin);
+
+ /*
+ * Find the top-most window using this pixmap
+ */
+ while (pWin->parent && pScreen->GetWindowPixmap(pWin->parent) == pPixmap)
+ pWin = pWin->parent;
+
+ /*
+ * Walk the sub-tree to invalidate all of the
+ * windows using the same pixmap
+ */
+ TraverseTree(pWin, DRI2InvalidateWalk, pPixmap);
+ DRI2InvalidateDrawable(&pPixmap->drawable);
+ } else
+ DRI2InvalidateDrawable(pDraw);
return Success;
}