summaryrefslogtreecommitdiff
path: root/miext
diff options
context:
space:
mode:
Diffstat (limited to 'miext')
-rw-r--r--miext/cw/cw.c126
-rw-r--r--miext/cw/cw.h39
-rw-r--r--miext/cw/cw_ops.c3
-rwxr-xr-xmiext/damage/damage.c23
4 files changed, 151 insertions, 40 deletions
diff --git a/miext/cw/cw.c b/miext/cw/cw.c
index 4b6458494..ee25c28b3 100644
--- a/miext/cw/cw.c
+++ b/miext/cw/cw.c
@@ -25,10 +25,6 @@
#include "windowstr.h"
#include "cw.h"
-#ifdef LG3D
-#include "../../Xext/lgeint.h"
-#endif /* LG3D */
-
#define CW_DEBUG 1
#if CW_DEBUG
@@ -447,6 +443,17 @@ cwFillRegionTiled(DrawablePtr pDrawable, RegionPtr pRegion, PixmapPtr pTile,
FreeScratchGC(pGC);
}
+#ifdef LG3D
+/*
+** RUDE HACK: need to find a cleaner way to do this!
+** This variable is set by routines in lgwindow.c
+** in order to skip the wrappee paint window call from
+** this routine. This is necessary in order to keep the
+** DDX from preparing the DIDs, which causes visual artifaces.
+*/
+Bool cwPaintWindowCallWrappee = TRUE;
+#endif /* LG3D */
+
static void
cwPaintWindowBackground(WindowPtr pWin, RegionPtr pRegion, int what)
{
@@ -455,7 +462,15 @@ cwPaintWindowBackground(WindowPtr pWin, RegionPtr pRegion, int what)
SCREEN_PROLOGUE(pScreen, PaintWindowBackground);
if (!cwDrawableIsRedirWindow((DrawablePtr)pWin)) {
+#ifdef LG3D
+ /* RUDE HACK: see comment above */
+ if (cwPaintWindowCallWrappee) {
+#endif /* LG3D */
(*pScreen->PaintWindowBackground)(pWin, pRegion, what);
+#ifdef LG3D
+ /* RUDE HACK: see comment above */
+ }
+#endif /* LG3D */
} else {
DrawablePtr pBackingDrawable;
int x_off, y_off, x_screen, y_screen;
@@ -484,6 +499,8 @@ cwPaintWindowBackground(WindowPtr pWin, RegionPtr pRegion, int what)
REGION_TRANSLATE(pScreen, pRegion, -x_screen, -y_screen);
}
+
+ COMPOSITE_DEBUGVIS_BACKING_PIXMAP(pBackingDrawable);
}
SCREEN_EPILOGUE(pScreen, PaintWindowBackground, cwPaintWindowBackground);
@@ -497,7 +514,15 @@ cwPaintWindowBorder(WindowPtr pWin, RegionPtr pRegion, int what)
SCREEN_PROLOGUE(pScreen, PaintWindowBorder);
if (!cwDrawableIsRedirWindow((DrawablePtr)pWin)) {
+#ifdef LG3D
+ /* RUDE HACK: see comment above */
+ if (cwPaintWindowCallWrappee) {
+#endif /* LG3D */
(*pScreen->PaintWindowBorder)(pWin, pRegion, what);
+#ifdef LG3D
+ /* RUDE HACK: see comment above */
+ }
+#endif /* LG3D */
} else {
DrawablePtr pBackingDrawable;
int x_off, y_off, x_screen, y_screen;
@@ -518,6 +543,8 @@ cwPaintWindowBorder(WindowPtr pWin, RegionPtr pRegion, int what)
}
REGION_TRANSLATE(pScreen, pRegion, -x_screen, -y_screen);
+
+ COMPOSITE_DEBUGVIS_BACKING_PIXMAP(pBackingDrawable);
}
SCREEN_EPILOGUE(pScreen, PaintWindowBorder, cwPaintWindowBorder);
@@ -580,6 +607,8 @@ cwCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc)
(*pGC->funcs->DestroyClip) (pGC);
FreeScratchGC(pGC);
+
+ COMPOSITE_DEBUGVIS_BACKING_PIXMAP(&pBackingPixmap->drawable);
}
SCREEN_EPILOGUE(pScreen, CopyWindow, cwCopyWindow);
@@ -659,12 +688,6 @@ miInitializeCompositeWrapper(ScreenPtr pScreen)
cwInitializeRender(pScreen);
#endif
-#ifdef LG3D
- if (lgeDisplayServerIsAlive) {
- SCREEN_EPILOGUE(pScreen, MoveWindow, lg3dMoveWindow);
- SCREEN_EPILOGUE(pScreen, ResizeWindow, lg3dSlideAndSizeWindow);
- }
-#endif /* LG3D */
}
static Bool
@@ -690,14 +713,83 @@ cwCloseScreen (int i, ScreenPtr pScreen)
cwFiniRender(pScreen);
#endif
-#ifdef LG3D
- if (lgeDisplayServerIsAlive) {
- pScreen->MoveWindow = pScreenPriv->MoveWindow;
- pScreen->ResizeWindow = pScreenPriv->ResizeWindow;
- }
-#endif /* LG3D */
-
xfree((pointer)pScreenPriv);
return (*pScreen->CloseScreen)(i, pScreen);
}
+
+#ifdef COMPOSITE_DEBUG_VISUALIZE
+
+int compositeDebugVisualizeBackingPixmap = 0;
+int compositeDebugVisualizeSharedPixmap = 0;
+
+/* The place to display the composite backing pixmap */
+int compositeDebugVisualizeBackingPixmapDstX = 1280 - 500;
+int compositeDebugVisualizeBackingPixmapDstY = 20;
+
+/* The place to display the shared memory pixmap */
+int compositeDebugVisualizeSharedPixmapDstX = 1280 - 500;
+int compositeDebugVisualizeSharedPixmapDstY = 20 + 500 + 20;
+
+static PixmapPtr pScreenPixmapActual = NULL;
+static GCPtr pGCCopy = NULL;
+
+/*
+** Determine the real screen pixmap by unwrapping and rewrapping.
+*/
+
+static void
+cdvGetScreenPixmapActual (ScreenPtr pScreen)
+{
+ WindowPtr pRootWin = WindowTable[pScreen->myNum];
+
+ SCREEN_PROLOGUE(pScreen, GetWindowPixmap);
+ pScreenPixmapActual = (*pScreen->GetWindowPixmap)(pRootWin);
+ SCREEN_EPILOGUE(pScreen, GetWindowPixmap, cwGetWindowPixmap);
+}
+
+static void
+cdvGetGCCopy (ScreenPtr pScreen)
+{
+ cwGCPtr pGCPriv;
+ ChangeGCVal v[1];
+
+ pGCCopy = GetScratchGC(pScreenPixmapActual->drawable.depth, pScreen);
+ v[0].val = GXcopy;
+ dixChangeGC(NullClient, pGCCopy, GCFunction, NULL, v);
+
+ /* Need to unwrap first */
+ pGCPriv = (cwGCPtr) getCwGC(pGCCopy);
+ FUNC_PROLOGUE(pGCCopy, pGCPriv);
+
+ ValidateGC((DrawablePtr)pScreenPixmapActual, pGCCopy);
+}
+
+void
+compositeDebugVisualizeDrawable (DrawablePtr pDrawable, int dstx, int dsty)
+{
+ ScreenPtr pScreen = pDrawable->pScreen;
+
+ if (pScreenPixmapActual == NULL) {
+ cdvGetScreenPixmapActual(pScreen);
+ }
+
+ if (pGCCopy == NULL) {
+ cdvGetGCCopy(pScreen);
+ }
+
+ (void) (*pGCCopy->ops->CopyArea)(pDrawable, (DrawablePtr)pScreenPixmapActual,
+ pGCCopy, 0, 0,
+ pDrawable->width, pDrawable->height,
+ dstx, dsty);
+}
+
+int
+hasBackingDrawable (DrawablePtr pDrawable)
+{
+ return pDrawable->type == DRAWABLE_WINDOW &&
+ (getCwPixmap ((WindowPtr) pDrawable)) != NULL;
+}
+
+#endif /* COMPOSITE_DEBUG_VISUALIZE */
+
diff --git a/miext/cw/cw.h b/miext/cw/cw.h
index dcc5ee91a..7fdd72287 100644
--- a/miext/cw/cw.h
+++ b/miext/cw/cw.h
@@ -175,3 +175,42 @@ extern void lg3dMoveWindow (WindowPtr pWin, int x, int y, WindowPtr pNextSib, VT
extern void lg3dSlideAndSizeWindow (WindowPtr pWin, int x, int y,
unsigned int w, unsigned int h, WindowPtr pSib);
#endif /* LG3D */
+
+#ifdef COMPOSITE_DEBUG_VISUALIZE
+
+#include "pixmapstr.h"
+
+extern int compositeDebugVisualizeBackingPixmap;
+extern int compositeDebugVisualizeSharedPixmap;
+extern int compositeDebugVisualizeBackingPixmapDstX;
+extern int compositeDebugVisualizeBackingPixmapDstY;
+extern int compositeDebugVisualizeSharedPixmapDstX;
+extern int compositeDebugVisualizeSharedPixmapDstY;
+
+extern void compositeDebugVisualizeDrawable (DrawablePtr pDrawable,
+ int dstx, int dsty);
+
+#define COMPOSITE_DEBUGVIS_BACKING_PIXMAP(pDrawable) \
+ if (compositeDebugVisualizeBackingPixmap) { \
+ compositeDebugVisualizeDrawable(pDrawable, \
+ compositeDebugVisualizeBackingPixmapDstX, \
+ compositeDebugVisualizeBackingPixmapDstY); \
+ }
+
+extern int hasBackingDrawable (DrawablePtr pDrawable);
+
+#define DRAWABLE_IS_REDIRECTED_WINDOW(pDraw) hasBackingDrawable(pDraw)
+
+#define COMPOSITE_DEBUGVIS_SHARED_PIXMAP(pDst, pSrc) \
+ if (compositeDebugVisualizeSharedPixmap && \
+ DRAWABLE_IS_REDIRECTED_WINDOW(pSrc) && \
+ pDst->type == DRAWABLE_PIXMAP) { \
+ compositeDebugVisualizeDrawable(pDst, \
+ compositeDebugVisualizeSharedPixmapDstX, \
+ compositeDebugVisualizeSharedPixmapDstY); \
+ }
+
+#else
+#define COMPOSITE_DEBUGVIS_BACKING_PIXMAP(pDrawable)
+#define COMPOSITE_DEBUGVIS_SHARED_PIXMAP(pDst, pSrc)
+#endif
diff --git a/miext/cw/cw_ops.c b/miext/cw/cw_ops.c
index f4d6e3478..fea2cab55 100644
--- a/miext/cw/cw_ops.c
+++ b/miext/cw/cw_ops.c
@@ -46,6 +46,7 @@
pGCPrivate->wrapOps = (pGC)->ops; \
(pGC)->funcs = &cwGCFuncs; \
(pGC)->ops = &cwGCOps; \
+ COMPOSITE_DEBUGVIS_BACKING_PIXMAP(pBackingDst); \
} while (0)
extern GCFuncs cwGCFuncs;
@@ -193,6 +194,8 @@ cwCopyArea(DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC, int srcx, int srcy,
if (exposed != NULL)
REGION_TRANSLATE(pDst->pScreen, exposed, odstx - dstx, odsty - dsty);
+ COMPOSITE_DEBUGVIS_SHARED_PIXMAP(pBackingDst, pSrc);
+
EPILOGUE(pGC);
return exposed;
diff --git a/miext/damage/damage.c b/miext/damage/damage.c
index 84b9b003e..02be613e3 100755
--- a/miext/damage/damage.c
+++ b/miext/damage/damage.c
@@ -1561,19 +1561,6 @@ damageDestroyPixmap (PixmapPtr pPixmap)
return TRUE;
}
-#ifdef LG3D
-/*
-** RUDE HACK: need to find a cleaner way to do this!
-** This variable is set by routines in lgwindow.c
-** in order to skip the wrappee paint window call from
-** this routine. This is necessary in order to keep the
-** DDX from preparing the DIDs where the X server thinks
-** the window is. But this isn't where the 3D window
-** avatar really is.
-*/
-Bool damagePaintWindowCallWrappee = TRUE;
-#endif /* LG3D */
-
static void
damagePaintWindow(WindowPtr pWindow,
RegionPtr prgn,
@@ -1590,11 +1577,6 @@ damagePaintWindow(WindowPtr pWindow,
getWindowDamage (pWindow))
damageDamageRegion (&pWindow->drawable, prgn, FALSE);
-#ifdef LG3D
- /* RUDE HACK: see comment above */
- if (damagePaintWindowCallWrappee) {
-#endif /* LG3D */
-
if(what == PW_BACKGROUND) {
unwrap (pScrPriv, pScreen, PaintWindowBackground);
(*pScreen->PaintWindowBackground) (pWindow, prgn, what);
@@ -1604,11 +1586,6 @@ damagePaintWindow(WindowPtr pWindow,
(*pScreen->PaintWindowBorder) (pWindow, prgn, what);
wrap (pScrPriv, pScreen, PaintWindowBorder, damagePaintWindow);
}
-
-#ifdef LG3D
- /* RUDE HACK: see comment above */
- }
-#endif /* LG3D */
}