Revert "mi: drop obsolete miOverlaySetRootClip()"

This reverts commit 00796cbf8c.

Requested by Nvidia - their proprietary driver still needs it.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1843>
This commit is contained in:
Enrico Weigelt, metux IT consult 2025-02-26 17:53:30 +01:00 committed by Marge Bot
parent 0463d7aaaa
commit d4f92a5688
2 changed files with 58 additions and 0 deletions

View File

@ -54,3 +54,59 @@ typedef struct {
Bool underlayMarked;
Bool copyUnderlay;
} miOverlayScreenRec, *miOverlayScreenPtr;
static DevPrivateKeyRec miOverlayWindowKeyRec;
#define miOverlayWindowKey (&miOverlayWindowKeyRec)
static void MarkUnderlayWindow(WindowPtr);
#define MIOVERLAY_GET_WINDOW_PRIVATE(pWin) ((miOverlayWindowPtr) \
dixLookupPrivate(&(pWin)->devPrivates, miOverlayWindowKey))
#define MIOVERLAY_GET_WINDOW_TREE(pWin) \
(MIOVERLAY_GET_WINDOW_PRIVATE(pWin)->tree)
#define MARK_UNDERLAY(w) MarkUnderlayWindow(w)
/* We need this as an addition since the xf86 common code doesn't
know about the second tree which is static to this file. */
void
miOverlaySetRootClip(ScreenPtr pScreen, Bool enable)
{
WindowPtr pRoot = pScreen->root;
miOverlayTreePtr pTree = MIOVERLAY_GET_WINDOW_TREE(pRoot);
MARK_UNDERLAY(pRoot);
if (enable) {
BoxRec box;
box.x1 = 0;
box.y1 = 0;
box.x2 = pScreen->width;
box.y2 = pScreen->height;
RegionReset(&pTree->borderClip, &box);
}
else
RegionEmpty(&pTree->borderClip);
RegionBreak(&pTree->clipList);
}
/****************************************************************/
static void
MarkUnderlayWindow(WindowPtr pWin)
{
miOverlayTreePtr pTree = MIOVERLAY_GET_WINDOW_TREE(pWin);
if (pTree->valdata)
return;
pTree->valdata =
(miOverlayValDataPtr) XNFalloc(sizeof(miOverlayValDataRec));
pTree->valdata->oldAbsCorner.x = pWin->drawable.x;
pTree->valdata->oldAbsCorner.y = pWin->drawable.y;
pTree->valdata->borderVisible = NullRegion;
}

View File

@ -9,4 +9,6 @@
typedef void (*miOverlayTransFunc) (ScreenPtr, int, BoxPtr);
typedef Bool (*miOverlayInOverlayFunc) (WindowPtr);
extern _X_EXPORT void miOverlaySetRootClip(ScreenPtr, Bool);
#endif /* __MIOVERLAY_H */